From 3a92537a30c9d6dcfc87ba348fc023c402425bbe Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Fri, 20 Sep 2019 16:32:34 +0000 Subject: [PATCH] refactor: rename RPCs The following RPCs have been renamed: - ps to containers - top to processes - df to mounts Signed-off-by: Andrew Rynhard --- api/machine/api.pb.go | 485 +++++++------- api/machine/api.proto | 18 +- api/network/api.pb.go | 147 ++--- api/network/api.proto | 10 +- api/os/api.pb.go | 441 ++++++------- api/os/api.proto | 30 +- api/security/api.pb.go | 106 +-- api/security/api.proto | 10 +- api/time/api.pb.go | 68 +- api/time/api.proto | 14 +- cmd/osctl/cmd/{ps.go => containers.go} | 35 +- cmd/osctl/cmd/interfaces.go | 4 +- cmd/osctl/cmd/logs.go | 6 +- cmd/osctl/cmd/ls.go | 4 +- cmd/osctl/cmd/{df.go => mounts.go} | 21 +- cmd/osctl/cmd/{top.go => processes.go} | 29 +- cmd/osctl/cmd/restart.go | 6 +- cmd/osctl/cmd/routes.go | 4 +- cmd/osctl/cmd/service.go | 4 +- cmd/osctl/cmd/stats.go | 8 +- cmd/osctl/cmd/time.go | 4 +- cmd/osctl/pkg/client/client.go | 136 ++-- internal/app/machined/internal/api/reg/reg.go | 104 +-- .../internal/phase/upgrade/upgrade.go | 4 +- .../machined/internal/sequencer/sequencer.go | 4 +- .../internal/sequencer/v1alpha1/types.go | 4 +- internal/app/machined/main.go | 6 +- .../app/machined/pkg/system/events/events.go | 10 +- .../app/machined/pkg/system/health/status.go | 6 +- .../app/machined/pkg/system/service_runner.go | 6 +- .../machined/pkg/system/services/kubeadm.go | 12 +- .../pkg/system/services/kubeadm/kubeadm.go | 22 +- .../system/services/kubeadm/kubeadm_test.go | 10 +- internal/app/networkd/pkg/reg/reg.go | 26 +- internal/app/networkd/pkg/reg/reg_test.go | 6 +- internal/app/networkd/proto/api.pb.go | 617 ------------------ internal/app/ntpd/pkg/reg/reg.go | 20 +- internal/app/ntpd/pkg/reg/reg_test.go | 8 +- internal/app/ntpd/proto/api.pb.go | 262 -------- internal/app/osd/internal/reg/init_client.go | 134 ---- .../app/osd/internal/reg/machine_client.go | 134 ++++ .../app/osd/internal/reg/network_client.go | 44 ++ .../app/osd/internal/reg/networkd_client.go | 44 -- internal/app/osd/internal/reg/reg.go | 36 +- .../reg/{ntp_client.go => time_client.go} | 24 +- internal/app/osd/main.go | 14 +- internal/app/proxyd/internal/reg/reg.go | 2 +- internal/app/trustd/internal/reg/reg.go | 24 +- internal/app/trustd/proto/api.pb.go | 475 -------------- pkg/grpc/gen/gen.go | 14 +- 50 files changed, 1156 insertions(+), 2506 deletions(-) rename cmd/osctl/cmd/{ps.go => containers.go} (62%) rename cmd/osctl/cmd/{df.go => mounts.go} (75%) rename cmd/osctl/cmd/{top.go => processes.go} (85%) delete mode 100644 internal/app/networkd/proto/api.pb.go delete mode 100644 internal/app/ntpd/proto/api.pb.go delete mode 100644 internal/app/osd/internal/reg/init_client.go create mode 100644 internal/app/osd/internal/reg/machine_client.go create mode 100644 internal/app/osd/internal/reg/network_client.go delete mode 100644 internal/app/osd/internal/reg/networkd_client.go rename internal/app/osd/internal/reg/{ntp_client.go => time_client.go} (53%) delete mode 100644 internal/app/trustd/proto/api.pb.go diff --git a/api/machine/api.pb.go b/api/machine/api.pb.go index 42addc8ef..9fb393e3b 100644 --- a/api/machine/api.pb.go +++ b/api/machine/api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: api.proto -package proto +package machineapi import ( context "context" @@ -1206,43 +1206,43 @@ func (m *FileInfo) GetRelativeName() string { } // The response message containing the requested df stats. -type DFReply struct { - Stats []*DFStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type MountsReply struct { + Stats []*MountStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *DFReply) Reset() { *m = DFReply{} } -func (m *DFReply) String() string { return proto.CompactTextString(m) } -func (*DFReply) ProtoMessage() {} -func (*DFReply) Descriptor() ([]byte, []int) { +func (m *MountsReply) Reset() { *m = MountsReply{} } +func (m *MountsReply) String() string { return proto.CompactTextString(m) } +func (*MountsReply) ProtoMessage() {} +func (*MountsReply) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{24} } -func (m *DFReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DFReply.Unmarshal(m, b) +func (m *MountsReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MountsReply.Unmarshal(m, b) } -func (m *DFReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DFReply.Marshal(b, m, deterministic) +func (m *MountsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MountsReply.Marshal(b, m, deterministic) } -func (m *DFReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_DFReply.Merge(m, src) +func (m *MountsReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_MountsReply.Merge(m, src) } -func (m *DFReply) XXX_Size() int { - return xxx_messageInfo_DFReply.Size(m) +func (m *MountsReply) XXX_Size() int { + return xxx_messageInfo_MountsReply.Size(m) } -func (m *DFReply) XXX_DiscardUnknown() { - xxx_messageInfo_DFReply.DiscardUnknown(m) +func (m *MountsReply) XXX_DiscardUnknown() { + xxx_messageInfo_MountsReply.DiscardUnknown(m) } -var xxx_messageInfo_DFReply proto.InternalMessageInfo +var xxx_messageInfo_MountsReply proto.InternalMessageInfo -func (m *DFReply) GetStats() []*DFStat { +func (m *MountsReply) GetStats() []*MountStat { if m != nil { return m.Stats } @@ -1250,7 +1250,7 @@ func (m *DFReply) GetStats() []*DFStat { } // The response message containing the requested processes. -type DFStat struct { +type MountStat struct { Filesystem string `protobuf:"bytes,1,opt,name=filesystem,proto3" json:"filesystem,omitempty"` Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` Available uint64 `protobuf:"varint,3,opt,name=available,proto3" json:"available,omitempty"` @@ -1260,57 +1260,57 @@ type DFStat struct { XXX_sizecache int32 `json:"-"` } -func (m *DFStat) Reset() { *m = DFStat{} } -func (m *DFStat) String() string { return proto.CompactTextString(m) } -func (*DFStat) ProtoMessage() {} -func (*DFStat) Descriptor() ([]byte, []int) { +func (m *MountStat) Reset() { *m = MountStat{} } +func (m *MountStat) String() string { return proto.CompactTextString(m) } +func (*MountStat) ProtoMessage() {} +func (*MountStat) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{25} } -func (m *DFStat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DFStat.Unmarshal(m, b) +func (m *MountStat) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MountStat.Unmarshal(m, b) } -func (m *DFStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DFStat.Marshal(b, m, deterministic) +func (m *MountStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MountStat.Marshal(b, m, deterministic) } -func (m *DFStat) XXX_Merge(src proto.Message) { - xxx_messageInfo_DFStat.Merge(m, src) +func (m *MountStat) XXX_Merge(src proto.Message) { + xxx_messageInfo_MountStat.Merge(m, src) } -func (m *DFStat) XXX_Size() int { - return xxx_messageInfo_DFStat.Size(m) +func (m *MountStat) XXX_Size() int { + return xxx_messageInfo_MountStat.Size(m) } -func (m *DFStat) XXX_DiscardUnknown() { - xxx_messageInfo_DFStat.DiscardUnknown(m) +func (m *MountStat) XXX_DiscardUnknown() { + xxx_messageInfo_MountStat.DiscardUnknown(m) } -var xxx_messageInfo_DFStat proto.InternalMessageInfo +var xxx_messageInfo_MountStat proto.InternalMessageInfo -func (m *DFStat) GetFilesystem() string { +func (m *MountStat) GetFilesystem() string { if m != nil { return m.Filesystem } return "" } -func (m *DFStat) GetSize() uint64 { +func (m *MountStat) GetSize() uint64 { if m != nil { return m.Size } return 0 } -func (m *DFStat) GetAvailable() uint64 { +func (m *MountStat) GetAvailable() uint64 { if m != nil { return m.Available } return 0 } -func (m *DFStat) GetMountedOn() string { +func (m *MountStat) GetMountedOn() string { if m != nil { return m.MountedOn } @@ -1425,84 +1425,85 @@ func init() { proto.RegisterType((*CopyOutRequest)(nil), "proto.CopyOutRequest") proto.RegisterType((*LSRequest)(nil), "proto.LSRequest") proto.RegisterType((*FileInfo)(nil), "proto.FileInfo") - proto.RegisterType((*DFReply)(nil), "proto.DFReply") - proto.RegisterType((*DFStat)(nil), "proto.DFStat") + proto.RegisterType((*MountsReply)(nil), "proto.MountsReply") + proto.RegisterType((*MountStat)(nil), "proto.MountStat") proto.RegisterType((*VersionReply)(nil), "proto.VersionReply") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 1103 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x56, 0x5b, 0x73, 0xdc, 0x34, - 0x14, 0x1e, 0xef, 0x7d, 0xcf, 0x5e, 0x92, 0x28, 0x4d, 0x31, 0x6e, 0x29, 0xa9, 0x53, 0x9a, 0x14, - 0xca, 0xb6, 0x84, 0xc2, 0x74, 0xb8, 0xcd, 0x34, 0xdd, 0x66, 0x28, 0x13, 0x68, 0xc6, 0x0b, 0x3c, - 0xf0, 0xb2, 0xa3, 0xdd, 0x55, 0xbc, 0x9a, 0xd8, 0x96, 0xb1, 0xb4, 0xe9, 0x2c, 0xbf, 0x80, 0x19, - 0x1e, 0xf8, 0x11, 0xbc, 0xf1, 0x4b, 0xf8, 0x59, 0x8c, 0x2e, 0x56, 0xec, 0x34, 0xce, 0x93, 0x75, - 0x3e, 0x7d, 0x3a, 0x37, 0x1d, 0x9f, 0x23, 0xe8, 0xe2, 0x94, 0x8e, 0xd2, 0x8c, 0x09, 0x86, 0x9a, - 0xea, 0xe3, 0xdd, 0x09, 0x19, 0x0b, 0x23, 0xf2, 0x44, 0x49, 0xb3, 0xd5, 0xd9, 0x13, 0x12, 0xa7, - 0x62, 0xad, 0x39, 0xde, 0x87, 0x57, 0x37, 0x05, 0x8d, 0x09, 0x17, 0x38, 0x4e, 0x35, 0xc1, 0x1f, - 0x40, 0x2f, 0x20, 0x33, 0xc6, 0x44, 0x40, 0xd2, 0x68, 0xed, 0xf7, 0x01, 0x02, 0xc2, 0x89, 0x91, - 0x36, 0x60, 0x30, 0x59, 0xae, 0xc4, 0x82, 0xbd, 0x4d, 0x34, 0xf0, 0x10, 0x86, 0xbf, 0xa4, 0x61, - 0x86, 0x17, 0x24, 0x20, 0xbf, 0xaf, 0x08, 0x17, 0xe8, 0x16, 0x34, 0x69, 0x8c, 0x43, 0xe2, 0x3a, - 0xbb, 0xce, 0x41, 0x37, 0xd0, 0x82, 0xbf, 0x0b, 0x7d, 0xcb, 0x4b, 0xa3, 0x35, 0xda, 0x84, 0x3a, - 0x9e, 0x9f, 0x1b, 0x8e, 0x5c, 0xfa, 0x47, 0xb0, 0x39, 0x21, 0xd9, 0x05, 0x9d, 0x93, 0x13, 0xca, - 0xb5, 0x39, 0x34, 0x82, 0x0e, 0xd7, 0x18, 0x77, 0x9d, 0xdd, 0xfa, 0x41, 0xef, 0x10, 0x69, 0x2f, - 0x47, 0x86, 0xfa, 0x3a, 0x39, 0x63, 0x81, 0xe5, 0xf8, 0x7f, 0x3b, 0xd0, 0x2b, 0xec, 0xa0, 0x21, - 0xd4, 0xe8, 0xc2, 0x18, 0xa9, 0xd1, 0x85, 0xf4, 0x8d, 0x0b, 0x2c, 0x88, 0x5b, 0xd3, 0xbe, 0x29, - 0x01, 0x3d, 0x86, 0x16, 0xb9, 0x20, 0x89, 0xe0, 0x6e, 0x7d, 0xd7, 0x39, 0xe8, 0x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, 0xb4, 0x5d, 0xf3, 0xaa, 0x23, 0x97, 0xdd, 0xf2, 0x07, 0x18, 0x96, - 0x5b, 0x3a, 0xba, 0x5b, 0xa6, 0x96, 0x47, 0x82, 0xe7, 0x55, 0xec, 0x4a, 0x5d, 0xcf, 0xa0, 0xa9, - 0xa3, 0xb1, 0xaf, 0x82, 0xe2, 0xc9, 0xad, 0x32, 0x28, 0x9f, 0x5f, 0xf5, 0x3f, 0x6b, 0x0e, 0xfa, - 0x0c, 0x1a, 0xca, 0x7b, 0xfb, 0x36, 0x2a, 0xb8, 0xbd, 0x59, 0xc2, 0xec, 0x91, 0x2f, 0xa1, 0x9d, - 0xff, 0x23, 0x55, 0x99, 0xcf, 0x5d, 0x28, 0xfe, 0xa9, 0x47, 0xf7, 0xa0, 0x3b, 0x67, 0xb1, 0xde, - 0x39, 0xea, 0xbc, 0x48, 0xe9, 0xa9, 0x5c, 0x9d, 0x3a, 0xbf, 0xe9, 0xa7, 0xe7, 0xac, 0xa5, 0x3e, - 0x9f, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x84, 0x80, 0x11, 0x12, 0x95, 0x0a, 0x00, 0x00, + // 1114 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x56, 0xeb, 0x72, 0xdb, 0xc4, + 0x17, 0x1f, 0xf9, 0xee, 0x63, 0x3b, 0x97, 0x4d, 0xd3, 0xbf, 0xfe, 0x6a, 0x81, 0x54, 0x2d, 0x49, + 0x4a, 0xc1, 0x85, 0xd0, 0x32, 0x1d, 0x6e, 0x33, 0x4d, 0x53, 0x06, 0x98, 0x84, 0x76, 0xd6, 0xc0, + 0x07, 0xbe, 0x78, 0xd6, 0xf6, 0x46, 0xde, 0x89, 0xa4, 0x15, 0xda, 0x75, 0x3a, 0x66, 0x78, 0x00, + 0x66, 0xf8, 0xc0, 0x43, 0xf0, 0x0c, 0xbc, 0x03, 0x8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, 0x4f, 0x03, 0xff, 0xc6, 0x3d, 0x75, 0xca, + 0x73, 0xc7, 0x42, 0xf5, 0x44, 0xf4, 0xff, 0xeb, 0x40, 0xd7, 0x4a, 0xaf, 0x13, 0xb9, 0x6a, 0xa1, + 0xdf, 0xc2, 0x46, 0xb5, 0xcf, 0xa3, 0xbb, 0x55, 0x68, 0x75, 0x4e, 0x04, 0xc1, 0x8a, 0x5d, 0x75, + 0xd6, 0x13, 0x68, 0x1a, 0x6f, 0xdc, 0x53, 0xa1, 0xfc, 0xe7, 0x76, 0x55, 0xa9, 0xde, 0x64, 0xf5, + 0xdf, 0x6a, 0x1e, 0xfa, 0x08, 0x1a, 0x9a, 0xbd, 0x7b, 0x30, 0x95, 0x68, 0x6f, 0x55, 0x74, 0xee, + 0x97, 0x4f, 0xa0, 0x5d, 0x5c, 0x97, 0x55, 0x91, 0x2f, 0x28, 0x94, 0x2f, 0xed, 0xf1, 0x23, 0xd8, + 0x9c, 0xf2, 0x64, 0x98, 0x98, 0xab, 0x33, 0x24, 0x19, 0x3b, 0x06, 0x7b, 0x8f, 0x9e, 0x67, 0xec, + 0xb5, 0xf7, 0x13, 0xd8, 0x2d, 0x92, 0xb1, 0x49, 0x4b, 0x1f, 0xf0, 0xf1, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x5b, 0x31, 0x28, 0xb2, 0xb7, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1513,13 +1514,13 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// InitClient is the client API for Init service. +// MachineClient is the client API for Machine service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type InitClient interface { - CopyOut(ctx context.Context, in *CopyOutRequest, opts ...grpc.CallOption) (Init_CopyOutClient, error) - DF(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DFReply, error) - LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOption) (Init_LSClient, error) +type MachineClient interface { + CopyOut(ctx context.Context, in *CopyOutRequest, opts ...grpc.CallOption) (Machine_CopyOutClient, error) + Mounts(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*MountsReply, error) + LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOption) (Machine_LSClient, error) Reboot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RebootReply, error) Reset(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ResetReply, error) Shutdown(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ShutdownReply, error) @@ -1533,20 +1534,20 @@ type InitClient interface { Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VersionReply, error) } -type initClient struct { +type machineClient struct { cc *grpc.ClientConn } -func NewInitClient(cc *grpc.ClientConn) InitClient { - return &initClient{cc} +func NewMachineClient(cc *grpc.ClientConn) MachineClient { + return &machineClient{cc} } -func (c *initClient) CopyOut(ctx context.Context, in *CopyOutRequest, opts ...grpc.CallOption) (Init_CopyOutClient, error) { - stream, err := c.cc.NewStream(ctx, &_Init_serviceDesc.Streams[0], "/proto.Init/CopyOut", opts...) +func (c *machineClient) CopyOut(ctx context.Context, in *CopyOutRequest, opts ...grpc.CallOption) (Machine_CopyOutClient, error) { + stream, err := c.cc.NewStream(ctx, &_Machine_serviceDesc.Streams[0], "/proto.Machine/CopyOut", opts...) if err != nil { return nil, err } - x := &initCopyOutClient{stream} + x := &machineCopyOutClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -1556,16 +1557,16 @@ func (c *initClient) CopyOut(ctx context.Context, in *CopyOutRequest, opts ...gr return x, nil } -type Init_CopyOutClient interface { +type Machine_CopyOutClient interface { Recv() (*StreamingData, error) grpc.ClientStream } -type initCopyOutClient struct { +type machineCopyOutClient struct { grpc.ClientStream } -func (x *initCopyOutClient) Recv() (*StreamingData, error) { +func (x *machineCopyOutClient) Recv() (*StreamingData, error) { m := new(StreamingData) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -1573,21 +1574,21 @@ func (x *initCopyOutClient) Recv() (*StreamingData, error) { return m, nil } -func (c *initClient) DF(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DFReply, error) { - out := new(DFReply) - err := c.cc.Invoke(ctx, "/proto.Init/DF", in, out, opts...) +func (c *machineClient) Mounts(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*MountsReply, error) { + out := new(MountsReply) + err := c.cc.Invoke(ctx, "/proto.Machine/Mounts", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOption) (Init_LSClient, error) { - stream, err := c.cc.NewStream(ctx, &_Init_serviceDesc.Streams[1], "/proto.Init/LS", opts...) +func (c *machineClient) LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOption) (Machine_LSClient, error) { + stream, err := c.cc.NewStream(ctx, &_Machine_serviceDesc.Streams[1], "/proto.Machine/LS", opts...) if err != nil { return nil, err } - x := &initLSClient{stream} + x := &machineLSClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -1597,16 +1598,16 @@ func (c *initClient) LS(ctx context.Context, in *LSRequest, opts ...grpc.CallOpt return x, nil } -type Init_LSClient interface { +type Machine_LSClient interface { Recv() (*FileInfo, error) grpc.ClientStream } -type initLSClient struct { +type machineLSClient struct { grpc.ClientStream } -func (x *initLSClient) Recv() (*FileInfo, error) { +func (x *machineLSClient) Recv() (*FileInfo, error) { m := new(FileInfo) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -1614,72 +1615,72 @@ func (x *initLSClient) Recv() (*FileInfo, error) { return m, nil } -func (c *initClient) Reboot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RebootReply, error) { +func (c *machineClient) Reboot(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RebootReply, error) { out := new(RebootReply) - err := c.cc.Invoke(ctx, "/proto.Init/Reboot", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Reboot", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) Reset(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ResetReply, error) { +func (c *machineClient) Reset(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ResetReply, error) { out := new(ResetReply) - err := c.cc.Invoke(ctx, "/proto.Init/Reset", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Reset", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) Shutdown(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ShutdownReply, error) { +func (c *machineClient) Shutdown(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ShutdownReply, error) { out := new(ShutdownReply) - err := c.cc.Invoke(ctx, "/proto.Init/Shutdown", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Shutdown", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeReply, error) { +func (c *machineClient) Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeReply, error) { out := new(UpgradeReply) - err := c.cc.Invoke(ctx, "/proto.Init/Upgrade", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Upgrade", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) ServiceList(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServiceListReply, error) { +func (c *machineClient) ServiceList(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServiceListReply, error) { out := new(ServiceListReply) - err := c.cc.Invoke(ctx, "/proto.Init/ServiceList", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/ServiceList", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) ServiceStart(ctx context.Context, in *ServiceStartRequest, opts ...grpc.CallOption) (*ServiceStartReply, error) { +func (c *machineClient) ServiceStart(ctx context.Context, in *ServiceStartRequest, opts ...grpc.CallOption) (*ServiceStartReply, error) { out := new(ServiceStartReply) - err := c.cc.Invoke(ctx, "/proto.Init/ServiceStart", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/ServiceStart", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) ServiceStop(ctx context.Context, in *ServiceStopRequest, opts ...grpc.CallOption) (*ServiceStopReply, error) { +func (c *machineClient) ServiceStop(ctx context.Context, in *ServiceStopRequest, opts ...grpc.CallOption) (*ServiceStopReply, error) { out := new(ServiceStopReply) - err := c.cc.Invoke(ctx, "/proto.Init/ServiceStop", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/ServiceStop", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) ServiceRestart(ctx context.Context, in *ServiceRestartRequest, opts ...grpc.CallOption) (*ServiceRestartReply, error) { +func (c *machineClient) ServiceRestart(ctx context.Context, in *ServiceRestartRequest, opts ...grpc.CallOption) (*ServiceRestartReply, error) { out := new(ServiceRestartReply) - err := c.cc.Invoke(ctx, "/proto.Init/ServiceRestart", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/ServiceRestart", in, out, opts...) if err != nil { return nil, err } @@ -1687,9 +1688,9 @@ func (c *initClient) ServiceRestart(ctx context.Context, in *ServiceRestartReque } // Deprecated: Do not use. -func (c *initClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartReply, error) { +func (c *machineClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartReply, error) { out := new(StartReply) - err := c.cc.Invoke(ctx, "/proto.Init/Start", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Start", in, out, opts...) if err != nil { return nil, err } @@ -1697,29 +1698,29 @@ func (c *initClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.C } // Deprecated: Do not use. -func (c *initClient) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopReply, error) { +func (c *machineClient) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopReply, error) { out := new(StopReply) - err := c.cc.Invoke(ctx, "/proto.Init/Stop", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Stop", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *initClient) Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VersionReply, error) { +func (c *machineClient) Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VersionReply, error) { out := new(VersionReply) - err := c.cc.Invoke(ctx, "/proto.Init/Version", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Machine/Version", in, out, opts...) if err != nil { return nil, err } return out, nil } -// InitServer is the server API for Init service. -type InitServer interface { - CopyOut(*CopyOutRequest, Init_CopyOutServer) error - DF(context.Context, *empty.Empty) (*DFReply, error) - LS(*LSRequest, Init_LSServer) error +// MachineServer is the server API for Machine service. +type MachineServer interface { + CopyOut(*CopyOutRequest, Machine_CopyOutServer) error + Mounts(context.Context, *empty.Empty) (*MountsReply, error) + LS(*LSRequest, Machine_LSServer) error Reboot(context.Context, *empty.Empty) (*RebootReply, error) Reset(context.Context, *empty.Empty) (*ResetReply, error) Shutdown(context.Context, *empty.Empty) (*ShutdownReply, error) @@ -1733,330 +1734,330 @@ type InitServer interface { Version(context.Context, *empty.Empty) (*VersionReply, error) } -func RegisterInitServer(s *grpc.Server, srv InitServer) { - s.RegisterService(&_Init_serviceDesc, srv) +func RegisterMachineServer(s *grpc.Server, srv MachineServer) { + s.RegisterService(&_Machine_serviceDesc, srv) } -func _Init_CopyOut_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Machine_CopyOut_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(CopyOutRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(InitServer).CopyOut(m, &initCopyOutServer{stream}) + return srv.(MachineServer).CopyOut(m, &machineCopyOutServer{stream}) } -type Init_CopyOutServer interface { +type Machine_CopyOutServer interface { Send(*StreamingData) error grpc.ServerStream } -type initCopyOutServer struct { +type machineCopyOutServer struct { grpc.ServerStream } -func (x *initCopyOutServer) Send(m *StreamingData) error { +func (x *machineCopyOutServer) Send(m *StreamingData) error { return x.ServerStream.SendMsg(m) } -func _Init_DF_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Mounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).DF(ctx, in) + return srv.(MachineServer).Mounts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/DF", + FullMethod: "/proto.Machine/Mounts", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).DF(ctx, req.(*empty.Empty)) + return srv.(MachineServer).Mounts(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Init_LS_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Machine_LS_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(LSRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(InitServer).LS(m, &initLSServer{stream}) + return srv.(MachineServer).LS(m, &machineLSServer{stream}) } -type Init_LSServer interface { +type Machine_LSServer interface { Send(*FileInfo) error grpc.ServerStream } -type initLSServer struct { +type machineLSServer struct { grpc.ServerStream } -func (x *initLSServer) Send(m *FileInfo) error { +func (x *machineLSServer) Send(m *FileInfo) error { return x.ServerStream.SendMsg(m) } -func _Init_Reboot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Reboot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Reboot(ctx, in) + return srv.(MachineServer).Reboot(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Reboot", + FullMethod: "/proto.Machine/Reboot", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Reboot(ctx, req.(*empty.Empty)) + return srv.(MachineServer).Reboot(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Init_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Reset(ctx, in) + return srv.(MachineServer).Reset(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Reset", + FullMethod: "/proto.Machine/Reset", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Reset(ctx, req.(*empty.Empty)) + return srv.(MachineServer).Reset(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Init_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Shutdown(ctx, in) + return srv.(MachineServer).Shutdown(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Shutdown", + FullMethod: "/proto.Machine/Shutdown", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Shutdown(ctx, req.(*empty.Empty)) + return srv.(MachineServer).Shutdown(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Init_Upgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Upgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpgradeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Upgrade(ctx, in) + return srv.(MachineServer).Upgrade(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Upgrade", + FullMethod: "/proto.Machine/Upgrade", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Upgrade(ctx, req.(*UpgradeRequest)) + return srv.(MachineServer).Upgrade(ctx, req.(*UpgradeRequest)) } return interceptor(ctx, in, info, handler) } -func _Init_ServiceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_ServiceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).ServiceList(ctx, in) + return srv.(MachineServer).ServiceList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/ServiceList", + FullMethod: "/proto.Machine/ServiceList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).ServiceList(ctx, req.(*empty.Empty)) + return srv.(MachineServer).ServiceList(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Init_ServiceStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_ServiceStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ServiceStartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).ServiceStart(ctx, in) + return srv.(MachineServer).ServiceStart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/ServiceStart", + FullMethod: "/proto.Machine/ServiceStart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).ServiceStart(ctx, req.(*ServiceStartRequest)) + return srv.(MachineServer).ServiceStart(ctx, req.(*ServiceStartRequest)) } return interceptor(ctx, in, info, handler) } -func _Init_ServiceStop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_ServiceStop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ServiceStopRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).ServiceStop(ctx, in) + return srv.(MachineServer).ServiceStop(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/ServiceStop", + FullMethod: "/proto.Machine/ServiceStop", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).ServiceStop(ctx, req.(*ServiceStopRequest)) + return srv.(MachineServer).ServiceStop(ctx, req.(*ServiceStopRequest)) } return interceptor(ctx, in, info, handler) } -func _Init_ServiceRestart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_ServiceRestart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ServiceRestartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).ServiceRestart(ctx, in) + return srv.(MachineServer).ServiceRestart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/ServiceRestart", + FullMethod: "/proto.Machine/ServiceRestart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).ServiceRestart(ctx, req.(*ServiceRestartRequest)) + return srv.(MachineServer).ServiceRestart(ctx, req.(*ServiceRestartRequest)) } return interceptor(ctx, in, info, handler) } -func _Init_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Start(ctx, in) + return srv.(MachineServer).Start(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Start", + FullMethod: "/proto.Machine/Start", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Start(ctx, req.(*StartRequest)) + return srv.(MachineServer).Start(ctx, req.(*StartRequest)) } return interceptor(ctx, in, info, handler) } -func _Init_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Stop(ctx, in) + return srv.(MachineServer).Stop(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Stop", + FullMethod: "/proto.Machine/Stop", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Stop(ctx, req.(*StopRequest)) + return srv.(MachineServer).Stop(ctx, req.(*StopRequest)) } return interceptor(ctx, in, info, handler) } -func _Init_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Machine_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InitServer).Version(ctx, in) + return srv.(MachineServer).Version(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Init/Version", + FullMethod: "/proto.Machine/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InitServer).Version(ctx, req.(*empty.Empty)) + return srv.(MachineServer).Version(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -var _Init_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Init", - HandlerType: (*InitServer)(nil), +var _Machine_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Machine", + HandlerType: (*MachineServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "DF", - Handler: _Init_DF_Handler, + MethodName: "Mounts", + Handler: _Machine_Mounts_Handler, }, { MethodName: "Reboot", - Handler: _Init_Reboot_Handler, + Handler: _Machine_Reboot_Handler, }, { MethodName: "Reset", - Handler: _Init_Reset_Handler, + Handler: _Machine_Reset_Handler, }, { MethodName: "Shutdown", - Handler: _Init_Shutdown_Handler, + Handler: _Machine_Shutdown_Handler, }, { MethodName: "Upgrade", - Handler: _Init_Upgrade_Handler, + Handler: _Machine_Upgrade_Handler, }, { MethodName: "ServiceList", - Handler: _Init_ServiceList_Handler, + Handler: _Machine_ServiceList_Handler, }, { MethodName: "ServiceStart", - Handler: _Init_ServiceStart_Handler, + Handler: _Machine_ServiceStart_Handler, }, { MethodName: "ServiceStop", - Handler: _Init_ServiceStop_Handler, + Handler: _Machine_ServiceStop_Handler, }, { MethodName: "ServiceRestart", - Handler: _Init_ServiceRestart_Handler, + Handler: _Machine_ServiceRestart_Handler, }, { MethodName: "Start", - Handler: _Init_Start_Handler, + Handler: _Machine_Start_Handler, }, { MethodName: "Stop", - Handler: _Init_Stop_Handler, + Handler: _Machine_Stop_Handler, }, { MethodName: "Version", - Handler: _Init_Version_Handler, + Handler: _Machine_Version_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "CopyOut", - Handler: _Init_CopyOut_Handler, + Handler: _Machine_CopyOut_Handler, ServerStreams: true, }, { StreamName: "LS", - Handler: _Init_LS_Handler, + Handler: _Machine_LS_Handler, ServerStreams: true, }, }, diff --git a/api/machine/api.proto b/api/machine/api.proto index bc430a9d6..5ea0d88e5 100644 --- a/api/machine/api.proto +++ b/api/machine/api.proto @@ -2,18 +2,18 @@ syntax = "proto3"; package proto; -option go_package = "proto"; +option go_package = "machineapi"; option java_multiple_files = true; -option java_outer_classname = "ApiProto"; -option java_package = "com.proto"; +option java_outer_classname = "MachineApi"; +option java_package = "com.machine.api"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; -// The Init service definition. -service Init { +// The machine service definition. +service Machine { rpc CopyOut(CopyOutRequest) returns (stream StreamingData); - rpc DF(google.protobuf.Empty) returns (DFReply); + rpc Mounts(google.protobuf.Empty) returns (MountsReply); rpc LS(LSRequest) returns (stream FileInfo); rpc Reboot(google.protobuf.Empty) returns (RebootReply); rpc Reset(google.protobuf.Empty) returns (ResetReply); @@ -171,12 +171,12 @@ message FileInfo { } // The response message containing the requested df stats. -message DFReply { - repeated DFStat stats = 1; +message MountsReply { + repeated MountStat stats = 1; } // The response message containing the requested processes. -message DFStat { +message MountStat { string filesystem = 1; uint64 size = 2; uint64 available = 3; diff --git a/api/network/api.pb.go b/api/network/api.pb.go index e4171f752..a8bc4777a 100644 --- a/api/network/api.pb.go +++ b/api/network/api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: api.proto -package proto +package networkapi import ( context "context" @@ -463,52 +463,53 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4f, 0x6f, 0xda, 0x4e, - 0x10, 0xfd, 0x99, 0x7f, 0xc1, 0x03, 0x86, 0xcd, 0x26, 0xbf, 0xd4, 0x4a, 0xab, 0x0a, 0xa1, 0x1e, - 0x10, 0xad, 0x48, 0x94, 0x44, 0x39, 0xf5, 0x62, 0x83, 0x49, 0x2d, 0x88, 0xed, 0x6e, 0x4c, 0x5b, - 0xe5, 0x82, 0x1c, 0xbc, 0x50, 0xab, 0x80, 0x91, 0x31, 0x4a, 0xb9, 0xf4, 0xd2, 0xcf, 0xd1, 0xcf, - 0xd0, 0x5b, 0x3f, 0x5f, 0xe5, 0xdd, 0x35, 0x31, 0x91, 0x7a, 0xf2, 0xbe, 0x37, 0x6f, 0x67, 0x77, - 0xde, 0x78, 0x07, 0x64, 0x6f, 0x15, 0x74, 0x56, 0x51, 0x18, 0x87, 0xb8, 0xc8, 0x3e, 0xa7, 0x2f, - 0x67, 0x61, 0x38, 0x9b, 0xd3, 0x33, 0x86, 0x1e, 0x36, 0xd3, 0x33, 0xba, 0x58, 0xc5, 0x5b, 0xae, - 0x69, 0x5e, 0x42, 0x85, 0x84, 0x9b, 0x98, 0xae, 0x09, 0x5d, 0xcd, 0xb7, 0xf8, 0x0d, 0x94, 0x22, - 0x06, 0x55, 0xa9, 0x91, 0x6f, 0x55, 0x2e, 0xaa, 0x5c, 0xd6, 0x61, 0x1a, 0x22, 0x62, 0xcd, 0x5f, - 0x39, 0x28, 0x32, 0x06, 0xbf, 0x02, 0x39, 0x58, 0xc6, 0x34, 0x9a, 0x7a, 0x13, 0xaa, 0x4a, 0x0d, - 0xa9, 0x25, 0x93, 0x27, 0x02, 0x37, 0xa0, 0xe2, 0xd3, 0x75, 0x1c, 0x2c, 0xbd, 0x38, 0x08, 0x97, - 0x6a, 0x8e, 0xc5, 0xb3, 0x14, 0x56, 0xe1, 0x60, 0xe6, 0xc5, 0xf4, 0xd1, 0xdb, 0xaa, 0x79, 0x16, - 0x4d, 0x21, 0x3e, 0x81, 0xd2, 0x82,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4, 0xc8, 0xb3, 0xae, - 0xa7, 0x44, 0xfb, 0x23, 0x28, 0x7b, 0xf6, 0x62, 0x05, 0x64, 0xad, 0x3f, 0x1e, 0x59, 0x77, 0x8e, - 0xd1, 0x45, 0xff, 0xe1, 0x0a, 0x1c, 0x68, 0xfd, 0xb1, 0x69, 0x19, 0x2e, 0xca, 0xe1, 0x32, 0x14, - 0x4c, 0xe7, 0xd3, 0x15, 0xca, 0xe1, 0x2a, 0x94, 0x05, 0x7d, 0x8d, 0x40, 0xf0, 0xd7, 0x08, 0x4e, - 0x73, 0x48, 0x6a, 0xff, 0xce, 0x81, 0xb2, 0xd7, 0x02, 0x7c, 0x08, 0x0a, 0x71, 0x1d, 0x62, 0xbb, - 0x4f, 0x79, 0x8f, 0xa0, 0x2e, 0x28, 0x62, 0xf4, 0x4c, 0x62, 0x74, 0x5d, 0x24, 0x65, 0x74, 0x03, - 0x83, 0x58, 0xc6, 0x10, 0xe5, 0x70, 0x1d, 0x2a, 0x82, 0xd2, 0x6d, 0xdb, 0x45, 0xf9, 0x8c, 0xe6, - 0xce, 0xd5, 0x5c, 0xb3, 0x8b, 0x0a, 0x18, 0x41, 0x55, 0x50, 0x37, 0x9a, 0x6b, 0xf4, 0x50, 0x39, - 0x29, 0x22, 0xcd, 0xae, 0x21, 0x19, 0xd7, 0x00, 0x04, 0xbc, 0x25, 0x2e, 0x82, 0xcc, 0x86, 0x7b, - 0x43, 0x27, 0x1a, 0xaa, 0x64, 0x8f, 0x31, 0x49, 0x0f, 0x55, 0x33, 0xf7, 0xeb, 0x59, 0xc4, 0x1e, - 0x25, 0x69, 0x95, 0x8c, 0xea, 0x8b, 0x4d, 0x1c, 0x54, 0xcb, 0x24, 0xb6, 0xdc, 0x01, 0xaa, 0x67, - 0x04, 0xbd, 0x0f, 0x5d, 0x07, 0x21, 0x8c, 0xa1, 0xb6, 0x3b, 0x99, 0x67, 0x39, 0xcc, 0x9c, 0xae, - 0x6b, 0xba, 0x31, 0x44, 0xed, 0xf6, 0x4f, 0x09, 0x6a, 0xfb, 0xcd, 0x4b, 0x44, 0xfd, 0xa1, 0x76, - 0x33, 0x1e, 0x59, 0x03, 0xcb, 0xfe, 0x6c, 0xf1, 0x4e, 0x70, 0xc6, 0x41, 0x52, 0x92, 0x97, 0x01, - 0x9d, 0xd8, 0x5a, 0xaf, 0xab, 0xdd, 0x25, 0xdd, 0x39, 0x04, 0x85, 0x71, 0x43, 0xdb, 0x76, 0x74, - 0xad, 0x3b, 0x40, 0x79, 0xfc, 0x02, 0x8e, 0x18, 0xe5, 0xd8, 0xa6, 0xe5, 0x8e, 0x5d, 0x9b, 0x2f, - 0x50, 0x61, 0xb7, 0xff, 0x76, 0x34, 0x74, 0x4d, 0xb6, 0xbf, 0x78, 0xf1, 0x03, 0xca, 0x16, 0x8d, - 0x1f, 0xc3, 0xe8, 0x9b, 0x8f, 0xaf, 0xa0, 0xc4, 0x27, 0x0d, 0x3e, 0xe9, 0xf0, 0x89, 0xd4, 0x49, - 0x27, 0x52, 0xc7, 0x48, 0x26, 0xd2, 0x29, 0xce, 0x3e, 0x36, 0xf1, 0x6e, 0xde, 0x03, 0x3c, 0x3d, - 0xa5, 0x7f, 0xee, 0x3c, 0x79, 0xfe, 0xbb, 0xf2, 0xdd, 0xfa, 0x6b, 0x90, 0x27, 0xe1, 0x82, 0x07, - 0xf5, 0xb2, 0xb6, 0x0a, 0xd8, 0xff, 0xe3, 0x48, 0xf7, 0x7c, 0x34, 0x3e, 0x94, 0xd8, 0xe7, 0xf2, - 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xb7, 0x4b, 0x85, 0x35, 0x05, 0x00, 0x00, + // 723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4d, 0x6f, 0xda, 0x4a, + 0x14, 0x7d, 0xe6, 0xdb, 0x17, 0x0c, 0x93, 0x49, 0x5e, 0x9e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 0xdd, + 0x4d, 0xc6, 0xd6, 0xd0, 0xb2, 0x3f, 0x5a, 0x7c, 0x13, 0x9c, 0x71, 0x90, 0x94, 0xd4, 0x65, 0x40, + 0x27, 0xb6, 0xd6, 0xef, 0x69, 0x0f, 0xc9, 0x76, 0x8e, 0x40, 0x61, 0xdc, 0xc8, 0xb6, 0x1d, 0x5d, + 0xeb, 0x0d, 0x51, 0x1e, 0xff, 0x03, 0xc7, 0x8c, 0x72, 0x6c, 0xd3, 0x72, 0x27, 0xae, 0xcd, 0x3f, + 0x50, 0x61, 0x9f, 0x7f, 0x3f, 0x1e, 0xb9, 0x26, 0xcb, 0x2f, 0x5e, 0x7d, 0x83, 0xb2, 0x45, 0xe3, + 0xe7, 0x20, 0xfa, 0x82, 0x6f, 0xa0, 0xc4, 0x1f, 0x1a, 0x7c, 0xda, 0xe5, 0x0f, 0x52, 0x37, 0x7d, + 0x90, 0xba, 0x46, 0xf2, 0x20, 0x9d, 0xe1, 0xec, 0x5d, 0x13, 0xd7, 0xe6, 0x2d, 0xc0, 0xcb, 0x4d, + 0xfa, 0x63, 0xe6, 0xe9, 0xeb, 0x7f, 0x2b, 0xcf, 0xd6, 0xcf, 0xa1, 0x31, 0x0d, 0x56, 0xdd, 0x35, + 0x6f, 0xa1, 0xeb, 0x85, 0xbe, 0x0e, 0xa2, 0x1f, 0x2d, 0xf4, 0x1d, 0xe9, 0x11, 0x44, 0xc8, 0x0b, + 0xfd, 0xa7, 0x12, 0xab, 0x71, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x03, 0x0c, 0xfa, 0x41, + 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -519,97 +520,97 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// NetworkdClient is the client API for Networkd service. +// NetworkClient is the client API for Network service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NetworkdClient interface { +type NetworkClient interface { Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) } -type networkdClient struct { +type networkClient struct { cc *grpc.ClientConn } -func NewNetworkdClient(cc *grpc.ClientConn) NetworkdClient { - return &networkdClient{cc} +func NewNetworkClient(cc *grpc.ClientConn) NetworkClient { + return &networkClient{cc} } -func (c *networkdClient) Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) { +func (c *networkClient) Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) { out := new(RoutesReply) - err := c.cc.Invoke(ctx, "/proto.Networkd/Routes", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Network/Routes", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *networkdClient) Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) { +func (c *networkClient) Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) { out := new(InterfacesReply) - err := c.cc.Invoke(ctx, "/proto.Networkd/Interfaces", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Network/Interfaces", in, out, opts...) if err != nil { return nil, err } return out, nil } -// NetworkdServer is the server API for Networkd service. -type NetworkdServer interface { +// NetworkServer is the server API for Network service. +type NetworkServer interface { Routes(context.Context, *empty.Empty) (*RoutesReply, error) Interfaces(context.Context, *empty.Empty) (*InterfacesReply, error) } -func RegisterNetworkdServer(s *grpc.Server, srv NetworkdServer) { - s.RegisterService(&_Networkd_serviceDesc, srv) +func RegisterNetworkServer(s *grpc.Server, srv NetworkServer) { + s.RegisterService(&_Network_serviceDesc, srv) } -func _Networkd_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Network_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NetworkdServer).Routes(ctx, in) + return srv.(NetworkServer).Routes(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Networkd/Routes", + FullMethod: "/proto.Network/Routes", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NetworkdServer).Routes(ctx, req.(*empty.Empty)) + return srv.(NetworkServer).Routes(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Networkd_Interfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Network_Interfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NetworkdServer).Interfaces(ctx, in) + return srv.(NetworkServer).Interfaces(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Networkd/Interfaces", + FullMethod: "/proto.Network/Interfaces", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NetworkdServer).Interfaces(ctx, req.(*empty.Empty)) + return srv.(NetworkServer).Interfaces(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -var _Networkd_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Networkd", - HandlerType: (*NetworkdServer)(nil), +var _Network_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Network", + HandlerType: (*NetworkServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Routes", - Handler: _Networkd_Routes_Handler, + Handler: _Network_Routes_Handler, }, { MethodName: "Interfaces", - Handler: _Networkd_Interfaces_Handler, + Handler: _Network_Interfaces_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/network/api.proto b/api/network/api.proto index 2fa79d3c4..94de9d4ba 100644 --- a/api/network/api.proto +++ b/api/network/api.proto @@ -2,15 +2,15 @@ syntax = "proto3"; package proto; -option go_package = "proto"; +option go_package = "networkapi"; option java_multiple_files = true; -option java_outer_classname = "ApiProto"; -option java_package = "com.proto"; +option java_outer_classname = "NetworkApi"; +option java_package = "com.network.api"; import "google/protobuf/empty.proto"; -// The Init service definition. -service Networkd { +// The network service definition. +service Network { rpc Routes(google.protobuf.Empty) returns (RoutesReply); rpc Interfaces(google.protobuf.Empty) returns (InterfacesReply); } diff --git a/api/os/api.pb.go b/api/os/api.pb.go index cacdf0545..f79561dd3 100644 --- a/api/os/api.pb.go +++ b/api/os/api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: api.proto -package proto +package osapi import ( context "context" @@ -50,7 +50,7 @@ func (ContainerDriver) EnumDescriptor() ([]byte, []int) { } // The request message containing the containerd namespace. -type ProcessesRequest struct { +type ContainersRequest struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // driver might be default "containerd" or "cri" Driver ContainerDriver `protobuf:"varint,2,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"` @@ -59,95 +59,95 @@ type ProcessesRequest struct { XXX_sizecache int32 `json:"-"` } -func (m *ProcessesRequest) Reset() { *m = ProcessesRequest{} } -func (m *ProcessesRequest) String() string { return proto.CompactTextString(m) } -func (*ProcessesRequest) ProtoMessage() {} -func (*ProcessesRequest) Descriptor() ([]byte, []int) { +func (m *ContainersRequest) Reset() { *m = ContainersRequest{} } +func (m *ContainersRequest) String() string { return proto.CompactTextString(m) } +func (*ContainersRequest) ProtoMessage() {} +func (*ContainersRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } -func (m *ProcessesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProcessesRequest.Unmarshal(m, b) +func (m *ContainersRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ContainersRequest.Unmarshal(m, b) } -func (m *ProcessesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProcessesRequest.Marshal(b, m, deterministic) +func (m *ContainersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ContainersRequest.Marshal(b, m, deterministic) } -func (m *ProcessesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProcessesRequest.Merge(m, src) +func (m *ContainersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContainersRequest.Merge(m, src) } -func (m *ProcessesRequest) XXX_Size() int { - return xxx_messageInfo_ProcessesRequest.Size(m) +func (m *ContainersRequest) XXX_Size() int { + return xxx_messageInfo_ContainersRequest.Size(m) } -func (m *ProcessesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ProcessesRequest.DiscardUnknown(m) +func (m *ContainersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ContainersRequest.DiscardUnknown(m) } -var xxx_messageInfo_ProcessesRequest proto.InternalMessageInfo +var xxx_messageInfo_ContainersRequest proto.InternalMessageInfo -func (m *ProcessesRequest) GetNamespace() string { +func (m *ContainersRequest) GetNamespace() string { if m != nil { return m.Namespace } return "" } -func (m *ProcessesRequest) GetDriver() ContainerDriver { +func (m *ContainersRequest) GetDriver() ContainerDriver { if m != nil { return m.Driver } return ContainerDriver_CONTAINERD } -// The response message containing the requested processes. -type ProcessesReply struct { - Processes []*Process `protobuf:"bytes,1,rep,name=processes,proto3" json:"processes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +// The response message containing the requested containers. +type ContainersReply struct { + Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ProcessesReply) Reset() { *m = ProcessesReply{} } -func (m *ProcessesReply) String() string { return proto.CompactTextString(m) } -func (*ProcessesReply) ProtoMessage() {} -func (*ProcessesReply) Descriptor() ([]byte, []int) { +func (m *ContainersReply) Reset() { *m = ContainersReply{} } +func (m *ContainersReply) String() string { return proto.CompactTextString(m) } +func (*ContainersReply) ProtoMessage() {} +func (*ContainersReply) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } -func (m *ProcessesReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProcessesReply.Unmarshal(m, b) +func (m *ContainersReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ContainersReply.Unmarshal(m, b) } -func (m *ProcessesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProcessesReply.Marshal(b, m, deterministic) +func (m *ContainersReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ContainersReply.Marshal(b, m, deterministic) } -func (m *ProcessesReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProcessesReply.Merge(m, src) +func (m *ContainersReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContainersReply.Merge(m, src) } -func (m *ProcessesReply) XXX_Size() int { - return xxx_messageInfo_ProcessesReply.Size(m) +func (m *ContainersReply) XXX_Size() int { + return xxx_messageInfo_ContainersReply.Size(m) } -func (m *ProcessesReply) XXX_DiscardUnknown() { - xxx_messageInfo_ProcessesReply.DiscardUnknown(m) +func (m *ContainersReply) XXX_DiscardUnknown() { + xxx_messageInfo_ContainersReply.DiscardUnknown(m) } -var xxx_messageInfo_ProcessesReply proto.InternalMessageInfo +var xxx_messageInfo_ContainersReply proto.InternalMessageInfo -func (m *ProcessesReply) GetProcesses() []*Process { +func (m *ContainersReply) GetContainers() []*Container { if m != nil { - return m.Processes + return m.Containers } return nil } -// The response message containing the requested processes. -type Process struct { +// The response message containing the requested containers. +type Container struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` @@ -160,78 +160,78 @@ type Process struct { XXX_sizecache int32 `json:"-"` } -func (m *Process) Reset() { *m = Process{} } -func (m *Process) String() string { return proto.CompactTextString(m) } -func (*Process) ProtoMessage() {} -func (*Process) Descriptor() ([]byte, []int) { +func (m *Container) Reset() { *m = Container{} } +func (m *Container) String() string { return proto.CompactTextString(m) } +func (*Container) ProtoMessage() {} +func (*Container) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } -func (m *Process) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Process.Unmarshal(m, b) +func (m *Container) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Container.Unmarshal(m, b) } -func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Process.Marshal(b, m, deterministic) +func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Container.Marshal(b, m, deterministic) } -func (m *Process) XXX_Merge(src proto.Message) { - xxx_messageInfo_Process.Merge(m, src) +func (m *Container) XXX_Merge(src proto.Message) { + xxx_messageInfo_Container.Merge(m, src) } -func (m *Process) XXX_Size() int { - return xxx_messageInfo_Process.Size(m) +func (m *Container) XXX_Size() int { + return xxx_messageInfo_Container.Size(m) } -func (m *Process) XXX_DiscardUnknown() { - xxx_messageInfo_Process.DiscardUnknown(m) +func (m *Container) XXX_DiscardUnknown() { + xxx_messageInfo_Container.DiscardUnknown(m) } -var xxx_messageInfo_Process proto.InternalMessageInfo +var xxx_messageInfo_Container proto.InternalMessageInfo -func (m *Process) GetNamespace() string { +func (m *Container) GetNamespace() string { if m != nil { return m.Namespace } return "" } -func (m *Process) GetId() string { +func (m *Container) GetId() string { if m != nil { return m.Id } return "" } -func (m *Process) GetImage() string { +func (m *Container) GetImage() string { if m != nil { return m.Image } return "" } -func (m *Process) GetPid() uint32 { +func (m *Container) GetPid() uint32 { if m != nil { return m.Pid } return 0 } -func (m *Process) GetStatus() string { +func (m *Container) GetStatus() string { if m != nil { return m.Status } return "" } -func (m *Process) GetPodId() string { +func (m *Container) GetPodId() string { if m != nil { return m.PodId } return "" } -func (m *Process) GetName() string { +func (m *Container) GetName() string { if m != nil { return m.Name } @@ -621,78 +621,78 @@ func (m *Data) GetBytes() []byte { return nil } -type TopRequest struct { +type ProcessesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *TopRequest) Reset() { *m = TopRequest{} } -func (m *TopRequest) String() string { return proto.CompactTextString(m) } -func (*TopRequest) ProtoMessage() {} -func (*TopRequest) Descriptor() ([]byte, []int) { +func (m *ProcessesRequest) Reset() { *m = ProcessesRequest{} } +func (m *ProcessesRequest) String() string { return proto.CompactTextString(m) } +func (*ProcessesRequest) ProtoMessage() {} +func (*ProcessesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{10} } -func (m *TopRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TopRequest.Unmarshal(m, b) +func (m *ProcessesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessesRequest.Unmarshal(m, b) } -func (m *TopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TopRequest.Marshal(b, m, deterministic) +func (m *ProcessesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessesRequest.Marshal(b, m, deterministic) } -func (m *TopRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TopRequest.Merge(m, src) +func (m *ProcessesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessesRequest.Merge(m, src) } -func (m *TopRequest) XXX_Size() int { - return xxx_messageInfo_TopRequest.Size(m) +func (m *ProcessesRequest) XXX_Size() int { + return xxx_messageInfo_ProcessesRequest.Size(m) } -func (m *TopRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TopRequest.DiscardUnknown(m) +func (m *ProcessesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessesRequest.DiscardUnknown(m) } -var xxx_messageInfo_TopRequest proto.InternalMessageInfo +var xxx_messageInfo_ProcessesRequest proto.InternalMessageInfo -type TopReply struct { +type ProcessesReply struct { ProcessList *ProcessList `protobuf:"bytes,1,opt,name=process_list,json=processList,proto3" json:"process_list,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *TopReply) Reset() { *m = TopReply{} } -func (m *TopReply) String() string { return proto.CompactTextString(m) } -func (*TopReply) ProtoMessage() {} -func (*TopReply) Descriptor() ([]byte, []int) { +func (m *ProcessesReply) Reset() { *m = ProcessesReply{} } +func (m *ProcessesReply) String() string { return proto.CompactTextString(m) } +func (*ProcessesReply) ProtoMessage() {} +func (*ProcessesReply) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{11} } -func (m *TopReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TopReply.Unmarshal(m, b) +func (m *ProcessesReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessesReply.Unmarshal(m, b) } -func (m *TopReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TopReply.Marshal(b, m, deterministic) +func (m *ProcessesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessesReply.Marshal(b, m, deterministic) } -func (m *TopReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_TopReply.Merge(m, src) +func (m *ProcessesReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessesReply.Merge(m, src) } -func (m *TopReply) XXX_Size() int { - return xxx_messageInfo_TopReply.Size(m) +func (m *ProcessesReply) XXX_Size() int { + return xxx_messageInfo_ProcessesReply.Size(m) } -func (m *TopReply) XXX_DiscardUnknown() { - xxx_messageInfo_TopReply.DiscardUnknown(m) +func (m *ProcessesReply) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessesReply.DiscardUnknown(m) } -var xxx_messageInfo_TopReply proto.InternalMessageInfo +var xxx_messageInfo_ProcessesReply proto.InternalMessageInfo -func (m *TopReply) GetProcessList() *ProcessList { +func (m *ProcessesReply) GetProcessList() *ProcessList { if m != nil { return m.ProcessList } @@ -744,9 +744,9 @@ func (m *ProcessList) GetBytes() []byte { func init() { proto.RegisterEnum("proto.ContainerDriver", ContainerDriver_name, ContainerDriver_value) - proto.RegisterType((*ProcessesRequest)(nil), "proto.ProcessesRequest") - proto.RegisterType((*ProcessesReply)(nil), "proto.ProcessesReply") - proto.RegisterType((*Process)(nil), "proto.Process") + proto.RegisterType((*ContainersRequest)(nil), "proto.ContainersRequest") + proto.RegisterType((*ContainersReply)(nil), "proto.ContainersReply") + proto.RegisterType((*Container)(nil), "proto.Container") proto.RegisterType((*StatsRequest)(nil), "proto.StatsRequest") proto.RegisterType((*StatsReply)(nil), "proto.StatsReply") proto.RegisterType((*Stat)(nil), "proto.Stat") @@ -754,53 +754,54 @@ func init() { proto.RegisterType((*RestartReply)(nil), "proto.RestartReply") proto.RegisterType((*LogsRequest)(nil), "proto.LogsRequest") proto.RegisterType((*Data)(nil), "proto.Data") - proto.RegisterType((*TopRequest)(nil), "proto.TopRequest") - proto.RegisterType((*TopReply)(nil), "proto.TopReply") + proto.RegisterType((*ProcessesRequest)(nil), "proto.ProcessesRequest") + proto.RegisterType((*ProcessesReply)(nil), "proto.ProcessesReply") proto.RegisterType((*ProcessList)(nil), "proto.ProcessList") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 608 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 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, 0x56, 0x41, 0x19, 0x10, - 0x81, 0x7d, 0x45, 0xd9, 0x1f, 0xef, 0xbe, 0x6e, 0x22, 0xaa, 0x07, 0x3f, 0x7c, 0x0a, 0x6e, 0x42, - 0x73, 0x8d, 0x1e, 0xae, 0x1d, 0xb0, 0xec, 0x42, 0xee, 0x2e, 0xac, 0x0f, 0x7a, 0x94, 0x8f, 0x1a, - 0x6a, 0x79, 0xf5, 0x33, 0x00, 0x00, 0xff, 0xff, 0x23, 0xd2, 0x37, 0xc4, 0xe5, 0x05, 0x00, 0x00, + // 610 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0x27, 0x6d, 0xd3, 0x91, 0x97, 0x52, 0x3a, 0x8f, 0x55, 0xd1, 0xb6, 0x43, 0x17, 0x2e, 0x65, + 0x42, 0xe9, 0x28, 0xe2, 0xc2, 0x01, 0x69, 0x6b, 0x27, 0x34, 0x31, 0x6d, 0x93, 0x07, 0x17, 0x84, + 0x34, 0xb9, 0x8d, 0x57, 0x59, 0x34, 0xb5, 0x89, 0x1d, 0xa4, 0x7e, 0x1a, 0x2e, 0x7c, 0x44, 0x3e, + 0x00, 0xb2, 0x9d, 0xa6, 0x69, 0x35, 0x44, 0x77, 0x80, 0x53, 0xf2, 0x7e, 0xef, 0xf7, 0xfe, 0xf8, + 0xf7, 0xec, 0x07, 0x1e, 0x11, 0x2c, 0x12, 0x29, 0x57, 0x1c, 0xb9, 0xe6, 0xb3, 0xb7, 0x3f, 0xe1, + 0x7c, 0x32, 0xa5, 0x3d, 0x63, 0x8d, 0xb2, 0xbb, 0x1e, 0x4d, 0x84, 0x9a, 0x5b, 0x4e, 0x48, 0x60, + 0x7b, 0xc0, 0x67, 0x8a, 0xb0, 0x19, 0x4d, 0x25, 0xa6, 0xdf, 0x32, 0x2a, 0x15, 0x3a, 0x00, 0x6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6c, 0x44, 0xc7, 0x7c, 0x76, 0xc7, + 0x36, 0x0c, 0x79, 0x01, 0x35, 0x3d, 0x20, 0xb4, 0x38, 0x61, 0x69, 0x5a, 0x2b, 0xc4, 0x63, 0x07, + 0xbd, 0x03, 0x58, 0x2e, 0x1a, 0x14, 0xac, 0x0f, 0xa3, 0x08, 0x6b, 0xdf, 0xe3, 0xb1, 0xd2, 0x6e, + 0xe5, 0x77, 0x03, 0xed, 0xe6, 0x94, 0xd5, 0xbb, 0xb9, 0xb7, 0xb3, 0x0e, 0xeb, 0xb0, 0x1e, 0xb8, + 0xe6, 0x55, 0xa2, 0x9d, 0xd2, 0x0b, 0x2c, 0x8a, 0x6d, 0xaf, 0x82, 0x3a, 0xe0, 0x2d, 0x78, 0xc5, + 0x50, 0xff, 0x28, 0xc2, 0xee, 0xea, 0x44, 0xf3, 0xf1, 0x9f, 0x1e, 0xe8, 0xcd, 0x99, 0x44, 0x5c, + 0x46, 0x44, 0xb0, 0x53, 0xf7, 0x4a, 0x9e, 0x08, 0x76, 0xed, 0x7c, 0x76, 0xb9, 0x24, 0x82, 0x8d, + 0xea, 0x26, 0xe6, 0xf5, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xa5, 0x03, 0x8b, 0x05, 0x06, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -811,51 +812,51 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// OSDClient is the client API for OSD service. +// OSClient is the client API for OS service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type OSDClient interface { +type OSClient interface { Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) - Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OSD_LogsClient, error) - Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesReply, error) + Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OS_LogsClient, error) + Containers(ctx context.Context, in *ContainersRequest, opts ...grpc.CallOption) (*ContainersReply, error) Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) - Top(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TopReply, error) + Processes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ProcessesReply, error) } -type oSDClient struct { +type oSClient struct { cc *grpc.ClientConn } -func NewOSDClient(cc *grpc.ClientConn) OSDClient { - return &oSDClient{cc} +func NewOSClient(cc *grpc.ClientConn) OSClient { + return &oSClient{cc} } -func (c *oSDClient) Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { +func (c *oSClient) Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { out := new(Data) - err := c.cc.Invoke(ctx, "/proto.OSD/Dmesg", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.OS/Dmesg", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *oSDClient) Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { +func (c *oSClient) Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Data, error) { out := new(Data) - err := c.cc.Invoke(ctx, "/proto.OSD/Kubeconfig", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.OS/Kubeconfig", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *oSDClient) Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OSD_LogsClient, error) { - stream, err := c.cc.NewStream(ctx, &_OSD_serviceDesc.Streams[0], "/proto.OSD/Logs", opts...) +func (c *oSClient) Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OS_LogsClient, error) { + stream, err := c.cc.NewStream(ctx, &_OS_serviceDesc.Streams[0], "/proto.OS/Logs", opts...) if err != nil { return nil, err } - x := &oSDLogsClient{stream} + x := &oSLogsClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -865,16 +866,16 @@ func (c *oSDClient) Logs(ctx context.Context, in *LogsRequest, opts ...grpc.Call return x, nil } -type OSD_LogsClient interface { +type OS_LogsClient interface { Recv() (*Data, error) grpc.ClientStream } -type oSDLogsClient struct { +type oSLogsClient struct { grpc.ClientStream } -func (x *oSDLogsClient) Recv() (*Data, error) { +func (x *oSLogsClient) Recv() (*Data, error) { m := new(Data) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -882,219 +883,219 @@ func (x *oSDLogsClient) Recv() (*Data, error) { return m, nil } -func (c *oSDClient) Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesReply, error) { - out := new(ProcessesReply) - err := c.cc.Invoke(ctx, "/proto.OSD/Processes", in, out, opts...) +func (c *oSClient) Containers(ctx context.Context, in *ContainersRequest, opts ...grpc.CallOption) (*ContainersReply, error) { + out := new(ContainersReply) + err := c.cc.Invoke(ctx, "/proto.OS/Containers", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *oSDClient) Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) { +func (c *oSClient) Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) { out := new(RestartReply) - err := c.cc.Invoke(ctx, "/proto.OSD/Restart", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.OS/Restart", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *oSDClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) { +func (c *oSClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) { out := new(StatsReply) - err := c.cc.Invoke(ctx, "/proto.OSD/Stats", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.OS/Stats", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *oSDClient) Top(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TopReply, error) { - out := new(TopReply) - err := c.cc.Invoke(ctx, "/proto.OSD/Top", in, out, opts...) +func (c *oSClient) Processes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ProcessesReply, error) { + out := new(ProcessesReply) + err := c.cc.Invoke(ctx, "/proto.OS/Processes", in, out, opts...) if err != nil { return nil, err } return out, nil } -// OSDServer is the server API for OSD service. -type OSDServer interface { +// OSServer is the server API for OS service. +type OSServer interface { Dmesg(context.Context, *empty.Empty) (*Data, error) Kubeconfig(context.Context, *empty.Empty) (*Data, error) - Logs(*LogsRequest, OSD_LogsServer) error - Processes(context.Context, *ProcessesRequest) (*ProcessesReply, error) + Logs(*LogsRequest, OS_LogsServer) error + Containers(context.Context, *ContainersRequest) (*ContainersReply, error) Restart(context.Context, *RestartRequest) (*RestartReply, error) Stats(context.Context, *StatsRequest) (*StatsReply, error) - Top(context.Context, *empty.Empty) (*TopReply, error) + Processes(context.Context, *empty.Empty) (*ProcessesReply, error) } -func RegisterOSDServer(s *grpc.Server, srv OSDServer) { - s.RegisterService(&_OSD_serviceDesc, srv) +func RegisterOSServer(s *grpc.Server, srv OSServer) { + s.RegisterService(&_OS_serviceDesc, srv) } -func _OSD_Dmesg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _OS_Dmesg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OSDServer).Dmesg(ctx, in) + return srv.(OSServer).Dmesg(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.OSD/Dmesg", + FullMethod: "/proto.OS/Dmesg", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OSDServer).Dmesg(ctx, req.(*empty.Empty)) + return srv.(OSServer).Dmesg(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _OSD_Kubeconfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _OS_Kubeconfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OSDServer).Kubeconfig(ctx, in) + return srv.(OSServer).Kubeconfig(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.OSD/Kubeconfig", + FullMethod: "/proto.OS/Kubeconfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OSDServer).Kubeconfig(ctx, req.(*empty.Empty)) + return srv.(OSServer).Kubeconfig(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _OSD_Logs_Handler(srv interface{}, stream grpc.ServerStream) error { +func _OS_Logs_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(LogsRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(OSDServer).Logs(m, &oSDLogsServer{stream}) + return srv.(OSServer).Logs(m, &oSLogsServer{stream}) } -type OSD_LogsServer interface { +type OS_LogsServer interface { Send(*Data) error grpc.ServerStream } -type oSDLogsServer struct { +type oSLogsServer struct { grpc.ServerStream } -func (x *oSDLogsServer) Send(m *Data) error { +func (x *oSLogsServer) Send(m *Data) error { return x.ServerStream.SendMsg(m) } -func _OSD_Processes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ProcessesRequest) +func _OS_Containers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContainersRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OSDServer).Processes(ctx, in) + return srv.(OSServer).Containers(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.OSD/Processes", + FullMethod: "/proto.OS/Containers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OSDServer).Processes(ctx, req.(*ProcessesRequest)) + return srv.(OSServer).Containers(ctx, req.(*ContainersRequest)) } return interceptor(ctx, in, info, handler) } -func _OSD_Restart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _OS_Restart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RestartRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OSDServer).Restart(ctx, in) + return srv.(OSServer).Restart(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.OSD/Restart", + FullMethod: "/proto.OS/Restart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OSDServer).Restart(ctx, req.(*RestartRequest)) + return srv.(OSServer).Restart(ctx, req.(*RestartRequest)) } return interceptor(ctx, in, info, handler) } -func _OSD_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _OS_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OSDServer).Stats(ctx, in) + return srv.(OSServer).Stats(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.OSD/Stats", + FullMethod: "/proto.OS/Stats", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OSDServer).Stats(ctx, req.(*StatsRequest)) + return srv.(OSServer).Stats(ctx, req.(*StatsRequest)) } return interceptor(ctx, in, info, handler) } -func _OSD_Top_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _OS_Processes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OSDServer).Top(ctx, in) + return srv.(OSServer).Processes(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.OSD/Top", + FullMethod: "/proto.OS/Processes", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OSDServer).Top(ctx, req.(*empty.Empty)) + return srv.(OSServer).Processes(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -var _OSD_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.OSD", - HandlerType: (*OSDServer)(nil), +var _OS_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.OS", + HandlerType: (*OSServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Dmesg", - Handler: _OSD_Dmesg_Handler, + Handler: _OS_Dmesg_Handler, }, { MethodName: "Kubeconfig", - Handler: _OSD_Kubeconfig_Handler, + Handler: _OS_Kubeconfig_Handler, }, { - MethodName: "Processes", - Handler: _OSD_Processes_Handler, + MethodName: "Containers", + Handler: _OS_Containers_Handler, }, { MethodName: "Restart", - Handler: _OSD_Restart_Handler, + Handler: _OS_Restart_Handler, }, { MethodName: "Stats", - Handler: _OSD_Stats_Handler, + Handler: _OS_Stats_Handler, }, { - MethodName: "Top", - Handler: _OSD_Top_Handler, + MethodName: "Processes", + Handler: _OS_Processes_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Logs", - Handler: _OSD_Logs_Handler, + Handler: _OS_Logs_Handler, ServerStreams: true, }, }, diff --git a/api/os/api.proto b/api/os/api.proto index 495ed019b..91148e684 100644 --- a/api/os/api.proto +++ b/api/os/api.proto @@ -2,24 +2,24 @@ syntax = "proto3"; package proto; -option go_package = "proto"; +option go_package = "osapi"; option java_multiple_files = true; -option java_outer_classname = "ApiProto"; -option java_package = "com.proto"; +option java_outer_classname = "OsApi"; +option java_package = "com.os.api"; import "google/protobuf/empty.proto"; -// The OSD service definition. +// The OS service definition. // -// OSD Service also implements all the API of Init Service -service OSD { +// OS Service also implements all the API of Init Service +service OS { rpc Dmesg(google.protobuf.Empty) returns (Data); rpc Kubeconfig(google.protobuf.Empty) returns (Data); rpc Logs(LogsRequest) returns (stream Data); - rpc Processes(ProcessesRequest) returns (ProcessesReply); + rpc Containers(ContainersRequest) returns (ContainersReply); rpc Restart(RestartRequest) returns (RestartReply); rpc Stats(StatsRequest) returns (StatsReply); - rpc Top(google.protobuf.Empty) returns (TopReply); + rpc Processes(google.protobuf.Empty) returns (ProcessesReply); } enum ContainerDriver { @@ -28,17 +28,17 @@ enum ContainerDriver { } // The request message containing the containerd namespace. -message ProcessesRequest { +message ContainersRequest { string namespace = 1; // driver might be default "containerd" or "cri" ContainerDriver driver = 2; } -// The response message containing the requested processes. -message ProcessesReply { repeated Process processes = 1; } +// The response message containing the requested containers. +message ContainersReply { repeated Container containers = 1; } -// The response message containing the requested processes. -message Process { +// The response message containing the requested containers. +message Container { string namespace = 1; string id = 2; string image = 3; @@ -90,8 +90,8 @@ message LogsRequest { // The response message containing the requested logs. message Data { bytes bytes = 1; } -message TopRequest {} +message ProcessesRequest {} -message TopReply { ProcessList process_list = 1; } +message ProcessesReply { ProcessList process_list = 1; } message ProcessList { bytes bytes = 1; } diff --git a/api/security/api.pb.go b/api/security/api.pb.go index 6ee4dbabd..9fddb3937 100644 --- a/api/security/api.pb.go +++ b/api/security/api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: api.proto -package proto +package securityapi import ( context "context" @@ -315,25 +315,25 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4f, 0x4b, 0xc3, 0x40, - 0x10, 0xc5, 0x49, 0xfa, 0x87, 0x66, 0x14, 0xad, 0x53, 0xd0, 0x98, 0x83, 0x94, 0x05, 0x4b, 0x4f, - 0x3d, 0xe8, 0xc1, 0x83, 0x20, 0x58, 0xc5, 0xa3, 0x94, 0x45, 0x10, 0xbc, 0xad, 0x9b, 0x15, 0x17, - 0xac, 0x59, 0x77, 0xa7, 0x9f, 0xd2, 0x2f, 0x25, 0xdd, 0xdd, 0xa4, 0xb5, 0x11, 0x3c, 0xcd, 0x23, - 0xf3, 0x7e, 0x2f, 0x99, 0x47, 0x20, 0x13, 0x46, 0xcf, 0x8c, 0xad, 0xa8, 0xc2, 0x9e, 0x1f, 0x6c, - 0x02, 0x78, 0xa7, 0x2c, 0xe9, 0x37, 0x2d, 0x05, 0x29, 0xae, 0xbe, 0x56, 0xca, 0x11, 0x0e, 0xa1, - 0x23, 0x9d, 0xcd, 0x93, 0x71, 0x32, 0xdd, 0xe7, 0x6b, 0xc9, 0xae, 0x60, 0xf4, 0xcb, 0xe7, 0x4c, - 0xf5, 0xe9, 0x14, 0x1e, 0x40, 0x2a, 0x45, 0xf4, 0xa5, 0x52, 0x78, 0xd0, 0x52, 0x9e, 0x46, 0xd0, - 0x12, 0x3b, 0x87, 0x43, 0xae, 0x44, 0xf9, 0xa0, 0x3f, 0x9a, 0x74, 0x84, 0xae, 0x11, 0xf4, 0xee, - 0xb1, 0x8c, 0x7b, 0xcd, 0x26, 0x30, 0xdc, 0xd8, 0x62, 0x38, 0x42, 0xb7, 0x14, 0x54, 0xc7, 0x7b, - 0xcd, 0x1e, 0x61, 0xf8, 0x6c, 0x35, 0xa9, 0x7f, 0xf2, 0x1a, 0x36, 0xdd, 0xb0, 0xde, 0xa7, 0xec, - 0x32, 0xef, 0x8c, 0x93, 0x69, 0x8f, 0x7b, 0xcd, 0x46, 0x70, 0xb4, 0x95, 0x17, 0x5e, 0x7c, 0xf1, - 0x9d, 0x40, 0xff, 0xc9, 0xae, 0x1c, 0x95, 0x78, 0x0f, 0x7b, 0x5b, 0x77, 0xe3, 0x69, 0x68, 0x6f, - 0xd6, 0xee, 0xac, 0x28, 0xfe, 0x5a, 0xc5, 0x4b, 0xae, 0x61, 0x50, 0x5f, 0x87, 0xc7, 0xd1, 0xb7, - 0xd3, 0x4a, 0x71, 0xd2, 0x7a, 0x1e, 0xe1, 0x1b, 0xc8, 0x9a, 0x4f, 0xc4, 0xda, 0xb5, 0x5b, 0x42, - 0x91, 0xb7, 0x17, 0x81, 0x9f, 0x9f, 0x41, 0x26, 0xab, 0x65, 0x58, 0xcf, 0x07, 0xb7, 0x46, 0x2f, - 0xd6, 0x6a, 0x91, 0xbc, 0x84, 0x5f, 0xe0, 0xb5, 0xef, 0xc7, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x59, 0x5a, 0x3f, 0x46, 0x1d, 0x02, 0x00, 0x00, + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xc1, 0x4b, 0xc3, 0x30, + 0x18, 0xc5, 0x69, 0xb7, 0xc9, 0xf6, 0x55, 0xb4, 0x7e, 0x03, 0xad, 0x3d, 0x8d, 0x80, 0x63, 0xa7, + 0x1e, 0xf4, 0xe0, 0x41, 0x10, 0x9c, 0xe2, 0x51, 0x24, 0x1e, 0x04, 0x6f, 0x31, 0x8b, 0x18, 0x70, + 0x36, 0x26, 0xdf, 0x0e, 0xfe, 0x91, 0xfe, 0x4f, 0x62, 0x9a, 0x74, 0x73, 0x15, 0x3c, 0xf5, 0xd1, + 0xef, 0xfd, 0x5e, 0xfb, 0x1e, 0x8c, 0x84, 0xd1, 0x95, 0xb1, 0x35, 0xd5, 0x38, 0xf0, 0x0f, 0x36, +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, 0x94, 0xc5, 0xa3, 0x30, 0xfa, 0x79, 0xc7, 0x07, + 0x9d, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x13, 0x85, 0x76, 0xb9, 0x2f, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -344,130 +344,130 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// TrustdClient is the client API for Trustd service. +// SecurityClient is the client API for Security service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TrustdClient interface { +type SecurityClient interface { Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) } -type trustdClient struct { +type securityClient struct { cc *grpc.ClientConn } -func NewTrustdClient(cc *grpc.ClientConn) TrustdClient { - return &trustdClient{cc} +func NewSecurityClient(cc *grpc.ClientConn) SecurityClient { + return &securityClient{cc} } -func (c *trustdClient) Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) { +func (c *securityClient) Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) { out := new(CertificateResponse) - err := c.cc.Invoke(ctx, "/proto.Trustd/Certificate", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Security/Certificate", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *trustdClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) { +func (c *securityClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) { out := new(ReadFileResponse) - err := c.cc.Invoke(ctx, "/proto.Trustd/ReadFile", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Security/ReadFile", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *trustdClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) { +func (c *securityClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) { out := new(WriteFileResponse) - err := c.cc.Invoke(ctx, "/proto.Trustd/WriteFile", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Security/WriteFile", in, out, opts...) if err != nil { return nil, err } return out, nil } -// TrustdServer is the server API for Trustd service. -type TrustdServer interface { +// SecurityServer is the server API for Security service. +type SecurityServer interface { Certificate(context.Context, *CertificateRequest) (*CertificateResponse, error) ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) } -func RegisterTrustdServer(s *grpc.Server, srv TrustdServer) { - s.RegisterService(&_Trustd_serviceDesc, srv) +func RegisterSecurityServer(s *grpc.Server, srv SecurityServer) { + s.RegisterService(&_Security_serviceDesc, srv) } -func _Trustd_Certificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Security_Certificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CertificateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TrustdServer).Certificate(ctx, in) + return srv.(SecurityServer).Certificate(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Trustd/Certificate", + FullMethod: "/proto.Security/Certificate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrustdServer).Certificate(ctx, req.(*CertificateRequest)) + return srv.(SecurityServer).Certificate(ctx, req.(*CertificateRequest)) } return interceptor(ctx, in, info, handler) } -func _Trustd_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Security_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ReadFileRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TrustdServer).ReadFile(ctx, in) + return srv.(SecurityServer).ReadFile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Trustd/ReadFile", + FullMethod: "/proto.Security/ReadFile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrustdServer).ReadFile(ctx, req.(*ReadFileRequest)) + return srv.(SecurityServer).ReadFile(ctx, req.(*ReadFileRequest)) } return interceptor(ctx, in, info, handler) } -func _Trustd_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Security_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(WriteFileRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TrustdServer).WriteFile(ctx, in) + return srv.(SecurityServer).WriteFile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Trustd/WriteFile", + FullMethod: "/proto.Security/WriteFile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrustdServer).WriteFile(ctx, req.(*WriteFileRequest)) + return srv.(SecurityServer).WriteFile(ctx, req.(*WriteFileRequest)) } return interceptor(ctx, in, info, handler) } -var _Trustd_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Trustd", - HandlerType: (*TrustdServer)(nil), +var _Security_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Security", + HandlerType: (*SecurityServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Certificate", - Handler: _Trustd_Certificate_Handler, + Handler: _Security_Certificate_Handler, }, { MethodName: "ReadFile", - Handler: _Trustd_ReadFile_Handler, + Handler: _Security_ReadFile_Handler, }, { MethodName: "WriteFile", - Handler: _Trustd_WriteFile_Handler, + Handler: _Security_WriteFile_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/security/api.proto b/api/security/api.proto index 449bb32cf..0ede693a8 100644 --- a/api/security/api.proto +++ b/api/security/api.proto @@ -2,13 +2,13 @@ syntax = "proto3"; package proto; -option go_package = "proto"; +option go_package = "securityapi"; option java_multiple_files = true; -option java_outer_classname = "ApiProto"; -option java_package = "com.proto"; +option java_outer_classname = "SecurityApi"; +option java_package = "com.security.api"; -// The Trustd service definition. -service Trustd { +// The security service definition. +service Security { rpc Certificate(CertificateRequest) returns (CertificateResponse); rpc ReadFile(ReadFileRequest) returns (ReadFileResponse); rpc WriteFile(WriteFileRequest) returns (WriteFileResponse); diff --git a/api/time/api.pb.go b/api/time/api.pb.go index ba8468d8c..ef69e5d25 100644 --- a/api/time/api.pb.go +++ b/api/time/api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: api.proto -package proto +package timeapi import ( context "context" @@ -137,7 +137,7 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 244 bytes of a gzipped FileDescriptorProto + // 247 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x52, 0xd2, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, 0xa9, 0xfa, 0x60, 0x5e, 0x52, 0x69, 0x9a, 0x7e, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, 0x8d, 0x94, @@ -148,12 +148,12 @@ var fileDescriptor_00212fb1f9d3bf1c = []byte{ 0x9c, 0xfc, 0xe4, 0xc4, 0x1c, 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x05, 0x99, 0x01, 0x8c, 0x51, 0xec, 0x20, + 0xc1, 0xc4, 0x82, 0xcc, 0x24, 0x36, 0xb0, 0x26, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x53, + 0xf4, 0x1f, 0x41, 0xac, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -164,97 +164,97 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// NtpdClient is the client API for Ntpd service. +// TimeClient is the client API for Time service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NtpdClient interface { +type TimeClient interface { Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) } -type ntpdClient struct { +type timeClient struct { cc *grpc.ClientConn } -func NewNtpdClient(cc *grpc.ClientConn) NtpdClient { - return &ntpdClient{cc} +func NewTimeClient(cc *grpc.ClientConn) TimeClient { + return &timeClient{cc} } -func (c *ntpdClient) Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) { +func (c *timeClient) Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) { out := new(TimeReply) - err := c.cc.Invoke(ctx, "/proto.Ntpd/Time", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Time/Time", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *ntpdClient) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) { +func (c *timeClient) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) { out := new(TimeReply) - err := c.cc.Invoke(ctx, "/proto.Ntpd/TimeCheck", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.Time/TimeCheck", in, out, opts...) if err != nil { return nil, err } return out, nil } -// NtpdServer is the server API for Ntpd service. -type NtpdServer interface { +// TimeServer is the server API for Time service. +type TimeServer interface { Time(context.Context, *empty.Empty) (*TimeReply, error) TimeCheck(context.Context, *TimeRequest) (*TimeReply, error) } -func RegisterNtpdServer(s *grpc.Server, srv NtpdServer) { - s.RegisterService(&_Ntpd_serviceDesc, srv) +func RegisterTimeServer(s *grpc.Server, srv TimeServer) { + s.RegisterService(&_Time_serviceDesc, srv) } -func _Ntpd_Time_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Time_Time_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NtpdServer).Time(ctx, in) + return srv.(TimeServer).Time(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Ntpd/Time", + FullMethod: "/proto.Time/Time", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NtpdServer).Time(ctx, req.(*empty.Empty)) + return srv.(TimeServer).Time(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -func _Ntpd_TimeCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Time_TimeCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TimeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NtpdServer).TimeCheck(ctx, in) + return srv.(TimeServer).TimeCheck(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Ntpd/TimeCheck", + FullMethod: "/proto.Time/TimeCheck", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NtpdServer).TimeCheck(ctx, req.(*TimeRequest)) + return srv.(TimeServer).TimeCheck(ctx, req.(*TimeRequest)) } return interceptor(ctx, in, info, handler) } -var _Ntpd_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Ntpd", - HandlerType: (*NtpdServer)(nil), +var _Time_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Time", + HandlerType: (*TimeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Time", - Handler: _Ntpd_Time_Handler, + Handler: _Time_Time_Handler, }, { MethodName: "TimeCheck", - Handler: _Ntpd_TimeCheck_Handler, + Handler: _Time_TimeCheck_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/time/api.proto b/api/time/api.proto index 4c405eadf..6aa8877c0 100644 --- a/api/time/api.proto +++ b/api/time/api.proto @@ -2,24 +2,22 @@ syntax = "proto3"; package proto; -option go_package = "proto"; +option go_package = "timeapi"; option java_multiple_files = true; -option java_outer_classname = "ApiProto"; -option java_package = "com.proto"; +option java_outer_classname = "TimeApi"; +option java_package = "com.time.api"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; -// The Init service definition. -service Ntpd { +// The time service definition. +service Time { rpc Time(google.protobuf.Empty) returns (TimeReply); rpc TimeCheck(TimeRequest) returns (TimeReply); } // The response message containing the ntp server -message TimeRequest { - string server = 1; -} +message TimeRequest { string server = 1; } // The response message containing the ntp server, time, and offset message TimeReply { diff --git a/cmd/osctl/cmd/ps.go b/cmd/osctl/cmd/containers.go similarity index 62% rename from cmd/osctl/cmd/ps.go rename to cmd/osctl/cmd/containers.go index 4bf3655db..a521a8e42 100644 --- a/cmd/osctl/cmd/ps.go +++ b/cmd/osctl/cmd/containers.go @@ -15,17 +15,18 @@ import ( criconstants "github.com/containerd/cri/pkg/constants" "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/os" + osapi "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" "github.com/talos-systems/talos/pkg/constants" ) -// psCmd represents the processes command -var psCmd = &cobra.Command{ - Use: "ps", - Short: "List processes", - Long: ``, +// containersCmd represents the processes command +var containersCmd = &cobra.Command{ + Use: "containers", + Aliases: []string{"c"}, + Short: "List containers", + Long: ``, Run: func(cmd *cobra.Command, args []string) { if len(args) != 0 { helpers.Should(cmd.Usage()) @@ -39,29 +40,29 @@ var psCmd = &cobra.Command{ } else { namespace = constants.SystemContainerdNamespace } - driver := proto.ContainerDriver_CONTAINERD + driver := osapi.ContainerDriver_CONTAINERD if useCRI { - driver = proto.ContainerDriver_CRI + driver = osapi.ContainerDriver_CRI } - reply, err := c.Processes(globalCtx, namespace, driver) + reply, err := c.Containers(globalCtx, namespace, driver) if err != nil { helpers.Fatalf("error getting process list: %s", err) } - processesRender(reply) + containerRender(reply) }) }, } -func processesRender(reply *proto.ProcessesReply) { - sort.Slice(reply.Processes, +func containerRender(reply *osapi.ContainersReply) { + sort.Slice(reply.Containers, func(i, j int) bool { - return strings.Compare(reply.Processes[i].Id, reply.Processes[j].Id) < 0 + return strings.Compare(reply.Containers[i].Id, reply.Containers[j].Id) < 0 }) w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0) fmt.Fprintln(w, "NAMESPACE\tID\tIMAGE\tPID\tSTATUS") - for _, p := range reply.Processes { + for _, p := range reply.Containers { display := p.Id if p.Id != p.PodId { // container in a sandbox @@ -73,7 +74,7 @@ func processesRender(reply *proto.ProcessesReply) { } func init() { - psCmd.Flags().BoolVarP(&kubernetes, "kubernetes", "k", false, "use the k8s.io containerd namespace") - psCmd.Flags().BoolVarP(&useCRI, "use-cri", "c", false, "use the CRI driver") - rootCmd.AddCommand(psCmd) + containersCmd.Flags().BoolVarP(&kubernetes, "kubernetes", "k", false, "use the k8s.io containerd namespace") + containersCmd.Flags().BoolVarP(&useCRI, "use-cri", "c", false, "use the CRI driver") + rootCmd.AddCommand(containersCmd) } diff --git a/cmd/osctl/cmd/interfaces.go b/cmd/osctl/cmd/interfaces.go index a7103061c..aedf233d0 100644 --- a/cmd/osctl/cmd/interfaces.go +++ b/cmd/osctl/cmd/interfaces.go @@ -12,7 +12,7 @@ import ( "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/network" + networkapi "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" ) @@ -39,7 +39,7 @@ var interfacesCmd = &cobra.Command{ }, } -func intersRender(reply *proto.InterfacesReply) { +func intersRender(reply *networkapi.InterfacesReply) { w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0) fmt.Fprintln(w, "INDEX\tNAME\tMAC\tMTU\tADDRESS") for _, r := range reply.Interfaces { diff --git a/cmd/osctl/cmd/logs.go b/cmd/osctl/cmd/logs.go index 0b4f55ec3..46909c840 100644 --- a/cmd/osctl/cmd/logs.go +++ b/cmd/osctl/cmd/logs.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - proto "github.com/talos-systems/talos/api/os" + osapi "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" "github.com/talos-systems/talos/pkg/constants" @@ -37,9 +37,9 @@ var logsCmd = &cobra.Command{ } else { namespace = constants.SystemContainerdNamespace } - driver := proto.ContainerDriver_CONTAINERD + driver := osapi.ContainerDriver_CONTAINERD if useCRI { - driver = proto.ContainerDriver_CRI + driver = osapi.ContainerDriver_CRI } stream, err := c.Logs(globalCtx, namespace, driver, args[0]) diff --git a/cmd/osctl/cmd/ls.go b/cmd/osctl/cmd/ls.go index 85ca2e96f..3e2a6ef7c 100644 --- a/cmd/osctl/cmd/ls.go +++ b/cmd/osctl/cmd/ls.go @@ -15,7 +15,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - initproto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" ) @@ -44,7 +44,7 @@ var lsCmd = &cobra.Command{ helpers.Fatalf("failed to parse depth flag: %v", err) } - stream, err := c.LS(globalCtx, initproto.LSRequest{ + stream, err := c.LS(globalCtx, machineapi.LSRequest{ Root: rootDir, Recurse: recurse, RecursionDepth: recursionDepth, diff --git a/cmd/osctl/cmd/df.go b/cmd/osctl/cmd/mounts.go similarity index 75% rename from cmd/osctl/cmd/df.go rename to cmd/osctl/cmd/mounts.go index 5c3c789b7..1dbe01e05 100644 --- a/cmd/osctl/cmd/df.go +++ b/cmd/osctl/cmd/mounts.go @@ -13,16 +13,17 @@ import ( "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" ) -// dfCmd represents the df command. -var dfCmd = &cobra.Command{ - Use: "df", - Short: "List disk usage", - Long: ``, +// mountsCmd represents the mounts command. +var mountsCmd = &cobra.Command{ + Use: "mounts", + Aliases: []string{"m"}, + Short: "List mounts", + Long: ``, Run: func(cmd *cobra.Command, args []string) { if len(args) != 0 { helpers.Should(cmd.Usage()) @@ -30,15 +31,15 @@ var dfCmd = &cobra.Command{ } setupClient(func(c *client.Client) { - dfRender(c.DF(globalCtx)) + mountsRender(c.Mounts(globalCtx)) }) }, } -func dfRender(reply *proto.DFReply, err error) { +func mountsRender(reply *machineapi.MountsReply, err error) { if reply == nil { if err != nil { - helpers.Fatalf("error getting df: %s", err) + helpers.Fatalf("error getting mounts: %s", err) } return } @@ -58,5 +59,5 @@ func dfRender(reply *proto.DFReply, err error) { } func init() { - rootCmd.AddCommand(dfCmd) + rootCmd.AddCommand(mountsCmd) } diff --git a/cmd/osctl/cmd/top.go b/cmd/osctl/cmd/processes.go similarity index 85% rename from cmd/osctl/cmd/top.go rename to cmd/osctl/cmd/processes.go index 6dfd45c80..d6745db70 100644 --- a/cmd/osctl/cmd/top.go +++ b/cmd/osctl/cmd/processes.go @@ -26,11 +26,12 @@ import ( "github.com/talos-systems/talos/pkg/proc" ) -// versionCmd represents the version command -var topCmd = &cobra.Command{ - Use: "top", - Short: "Streams top output", - Long: ``, +// processesCmd represents the processes command +var processesCmd = &cobra.Command{ + Use: "processes", + Aliases: []string{"p"}, + Short: "Streams processes", + Long: ``, Run: func(cmd *cobra.Command, args []string) { if len(args) != 0 { helpers.Should(cmd.Usage()) @@ -42,7 +43,7 @@ var topCmd = &cobra.Command{ if oneTime { var output string - output, err = topOutput(globalCtx, c) + output, err = processesOutput(globalCtx, c) if err != nil { log.Fatal(err) } @@ -57,7 +58,7 @@ var topCmd = &cobra.Command{ } defer ui.Close() - topUI(globalCtx, c) + processesUI(globalCtx, c) }) }, } @@ -66,13 +67,13 @@ var sortMethod string var oneTime bool func init() { - topCmd.Flags().StringVarP(&sortMethod, "sort", "s", "rss", "Column to sort output by. [rss|cpu]") - topCmd.Flags().BoolVarP(&oneTime, "once", "1", false, "Print the current top output ( no gui/auto refresh )") - rootCmd.AddCommand(topCmd) + processesCmd.Flags().StringVarP(&sortMethod, "sort", "s", "rss", "Column to sort output by. [rss|cpu]") + processesCmd.Flags().BoolVarP(&oneTime, "once", "1", false, "Print the current processes output ( no gui/auto refresh )") + rootCmd.AddCommand(processesCmd) } // nolint: gocyclo -func topUI(ctx context.Context, c *client.Client) { +func processesUI(ctx context.Context, c *client.Client) { l := widgets.NewParagraph() l.Border = false l.WrapText = false @@ -92,7 +93,7 @@ func topUI(ctx context.Context, c *client.Client) { // x, y, w, h l.SetRect(0, 0, w, h) - processOutput, err = topOutput(ctx, c) + processOutput, err = processesOutput(ctx, c) if err != nil { log.Println(err) return @@ -173,8 +174,8 @@ var cpu = func(p1, p2 *proc.ProcessList) bool { return p1.CPUTime > p2.CPUTime } -func topOutput(ctx context.Context, c *client.Client) (output string, err error) { - procs, err := c.Top(ctx) +func processesOutput(ctx context.Context, c *client.Client) (output string, err error) { + procs, err := c.Processes(ctx) if err != nil { // TODO: Figure out how to expose errors to client without messing // up display diff --git a/cmd/osctl/cmd/restart.go b/cmd/osctl/cmd/restart.go index 022c0f1ff..7c8657f6d 100644 --- a/cmd/osctl/cmd/restart.go +++ b/cmd/osctl/cmd/restart.go @@ -11,7 +11,7 @@ import ( criconstants "github.com/containerd/cri/pkg/constants" "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/os" + osapi "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" "github.com/talos-systems/talos/pkg/constants" @@ -37,9 +37,9 @@ var restartCmd = &cobra.Command{ } else { namespace = constants.SystemContainerdNamespace } - driver := proto.ContainerDriver_CONTAINERD + driver := osapi.ContainerDriver_CONTAINERD if useCRI { - driver = proto.ContainerDriver_CRI + driver = osapi.ContainerDriver_CRI } if err := c.Restart(globalCtx, namespace, driver, args[0]); err != nil { helpers.Fatalf("error restarting process: %s", err) diff --git a/cmd/osctl/cmd/routes.go b/cmd/osctl/cmd/routes.go index e7fade5d9..2bbb71a7f 100644 --- a/cmd/osctl/cmd/routes.go +++ b/cmd/osctl/cmd/routes.go @@ -12,7 +12,7 @@ import ( "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/network" + networkapi "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" ) @@ -39,7 +39,7 @@ var routesCmd = &cobra.Command{ }, } -func routesRender(reply *proto.RoutesReply) { +func routesRender(reply *networkapi.RoutesReply) { w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0) fmt.Fprintln(w, "INTERFACE\tDESTINATION\tGATEWAY\tMETRIC") for _, r := range reply.Routes { diff --git a/cmd/osctl/cmd/service.go b/cmd/osctl/cmd/service.go index 3f506e1b0..ed9fdf739 100644 --- a/cmd/osctl/cmd/service.go +++ b/cmd/osctl/cmd/service.go @@ -13,7 +13,7 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/spf13/cobra" - initproto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" ) @@ -137,7 +137,7 @@ func serviceRestart(c *client.Client, id string) { } type serviceInfoWrapper struct { - *initproto.ServiceInfo + *machineapi.ServiceInfo } func (svc serviceInfoWrapper) LastUpdated() string { diff --git a/cmd/osctl/cmd/stats.go b/cmd/osctl/cmd/stats.go index 41dd8208c..d3d25d0ef 100644 --- a/cmd/osctl/cmd/stats.go +++ b/cmd/osctl/cmd/stats.go @@ -15,7 +15,7 @@ import ( criconstants "github.com/containerd/cri/pkg/constants" "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/os" + osapi "github.com/talos-systems/talos/api/os" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" "github.com/talos-systems/talos/pkg/constants" @@ -39,9 +39,9 @@ var statsCmd = &cobra.Command{ } else { namespace = constants.SystemContainerdNamespace } - driver := proto.ContainerDriver_CONTAINERD + driver := osapi.ContainerDriver_CONTAINERD if useCRI { - driver = proto.ContainerDriver_CRI + driver = osapi.ContainerDriver_CRI } reply, err := c.Stats(globalCtx, namespace, driver) if err != nil { @@ -53,7 +53,7 @@ var statsCmd = &cobra.Command{ }, } -func statsRender(reply *proto.StatsReply) { +func statsRender(reply *osapi.StatsReply) { sort.Slice(reply.Stats, func(i, j int) bool { return strings.Compare(reply.Stats[i].Id, reply.Stats[j].Id) < 0 diff --git a/cmd/osctl/cmd/time.go b/cmd/osctl/cmd/time.go index 24518899f..d17692b61 100644 --- a/cmd/osctl/cmd/time.go +++ b/cmd/osctl/cmd/time.go @@ -13,7 +13,7 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/spf13/cobra" - proto "github.com/talos-systems/talos/api/time" + timeapi "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/cmd/osctl/pkg/client" "github.com/talos-systems/talos/cmd/osctl/pkg/helpers" ) @@ -30,7 +30,7 @@ var timeCmd = &cobra.Command{ helpers.Fatalf("failed to parse check flag: %v", err) } - var output *proto.TimeReply + var output *timeapi.TimeReply if server == "" { output, err = c.Time(globalCtx) if err != nil { diff --git a/cmd/osctl/pkg/client/client.go b/cmd/osctl/pkg/client/client.go index 9093dbae3..bdfe30a1c 100644 --- a/cmd/osctl/pkg/client/client.go +++ b/cmd/osctl/pkg/client/client.go @@ -21,10 +21,10 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/status" - initproto "github.com/talos-systems/talos/api/machine" - networkdproto "github.com/talos-systems/talos/api/network" - proto "github.com/talos-systems/talos/api/os" - ntpdproto "github.com/talos-systems/talos/api/time" + machineapi "github.com/talos-systems/talos/api/machine" + networkapi "github.com/talos-systems/talos/api/network" + osapi "github.com/talos-systems/talos/api/os" + timeapi "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/cmd/osctl/pkg/client/config" "github.com/talos-systems/talos/pkg/net" "github.com/talos-systems/talos/pkg/proc" @@ -39,14 +39,14 @@ type Credentials struct { key []byte } -// Client implements the proto.OSDClient interface. It serves as the +// Client implements the proto.OSClient interface. It serves as the // concrete type with the required methods. type Client struct { - conn *grpc.ClientConn - client proto.OSDClient - initClient initproto.InitClient - ntpdClient ntpdproto.NtpdClient - networkdClient networkdproto.NetworkdClient + conn *grpc.ClientConn + client osapi.OSClient + MachineClient machineapi.MachineClient + TimeClient timeapi.TimeClient + NetworkClient networkapi.NetworkClient } // NewDefaultClientCredentials initializes ClientCredentials using default paths @@ -117,10 +117,10 @@ func NewClient(port int, clientcreds *Credentials) (c *Client, err error) { return } - c.client = proto.NewOSDClient(c.conn) - c.initClient = initproto.NewInitClient(c.conn) - c.ntpdClient = ntpdproto.NewNtpdClient(c.conn) - c.networkdClient = networkdproto.NewNetworkdClient(c.conn) + c.client = osapi.NewOSClient(c.conn) + c.MachineClient = machineapi.NewMachineClient(c.conn) + c.TimeClient = timeapi.NewTimeClient(c.conn) + c.NetworkClient = networkapi.NewNetworkClient(c.conn) return c, nil } @@ -130,7 +130,7 @@ func (c *Client) Close() error { return c.conn.Close() } -// Kubeconfig implements the proto.OSDClient interface. +// Kubeconfig implements the proto.OSClient interface. func (c *Client) Kubeconfig(ctx context.Context) ([]byte, error) { r, err := c.client.Kubeconfig(ctx, &empty.Empty{}) if err != nil { @@ -139,27 +139,27 @@ func (c *Client) Kubeconfig(ctx context.Context) ([]byte, error) { return r.Bytes, nil } -// Stats implements the proto.OSDClient interface. -func (c *Client) Stats(ctx context.Context, namespace string, driver proto.ContainerDriver) (reply *proto.StatsReply, err error) { - reply, err = c.client.Stats(ctx, &proto.StatsRequest{ +// Stats implements the proto.OSClient interface. +func (c *Client) Stats(ctx context.Context, namespace string, driver osapi.ContainerDriver) (reply *osapi.StatsReply, err error) { + reply, err = c.client.Stats(ctx, &osapi.StatsRequest{ Namespace: namespace, Driver: driver, }) return } -// Processes implements the proto.OSDClient interface. -func (c *Client) Processes(ctx context.Context, namespace string, driver proto.ContainerDriver) (reply *proto.ProcessesReply, err error) { - reply, err = c.client.Processes(ctx, &proto.ProcessesRequest{ +// Containers implements the proto.OSClient interface. +func (c *Client) Containers(ctx context.Context, namespace string, driver osapi.ContainerDriver) (reply *osapi.ContainersReply, err error) { + reply, err = c.client.Containers(ctx, &osapi.ContainersRequest{ Namespace: namespace, Driver: driver, }) return } -// Restart implements the proto.OSDClient interface. -func (c *Client) Restart(ctx context.Context, namespace string, driver proto.ContainerDriver, id string) (err error) { - _, err = c.client.Restart(ctx, &proto.RestartRequest{ +// Restart implements the proto.OSClient interface. +func (c *Client) Restart(ctx context.Context, namespace string, driver osapi.ContainerDriver, id string) (err error) { + _, err = c.client.Restart(ctx, &osapi.RestartRequest{ Id: id, Namespace: namespace, Driver: driver, @@ -167,25 +167,25 @@ func (c *Client) Restart(ctx context.Context, namespace string, driver proto.Con return } -// Reset implements the proto.OSDClient interface. +// Reset implements the proto.OSClient interface. func (c *Client) Reset(ctx context.Context) (err error) { - _, err = c.initClient.Reset(ctx, &empty.Empty{}) + _, err = c.MachineClient.Reset(ctx, &empty.Empty{}) return } -// Reboot implements the proto.OSDClient interface. +// Reboot implements the proto.OSClient interface. func (c *Client) Reboot(ctx context.Context) (err error) { - _, err = c.initClient.Reboot(ctx, &empty.Empty{}) + _, err = c.MachineClient.Reboot(ctx, &empty.Empty{}) return } -// Shutdown implements the proto.OSDClient interface. +// Shutdown implements the proto.OSClient interface. func (c *Client) Shutdown(ctx context.Context) (err error) { - _, err = c.initClient.Shutdown(ctx, &empty.Empty{}) + _, err = c.MachineClient.Shutdown(ctx, &empty.Empty{}) return } -// Dmesg implements the proto.OSDClient interface. +// Dmesg implements the proto.OSClient interface. func (c *Client) Dmesg(ctx context.Context) ([]byte, error) { data, err := c.client.Dmesg(ctx, &empty.Empty{}) if err != nil { @@ -195,9 +195,9 @@ func (c *Client) Dmesg(ctx context.Context) ([]byte, error) { return data.Bytes, nil } -// Logs implements the proto.OSDClient interface. -func (c *Client) Logs(ctx context.Context, namespace string, driver proto.ContainerDriver, id string) (stream proto.OSD_LogsClient, err error) { - stream, err = c.client.Logs(ctx, &proto.LogsRequest{ +// Logs implements the proto.OSClient interface. +func (c *Client) Logs(ctx context.Context, namespace string, driver osapi.ContainerDriver, id string) (stream osapi.OS_LogsClient, err error) { + stream, err = c.client.Logs(ctx, &osapi.LogsRequest{ Namespace: namespace, Driver: driver, Id: id, @@ -205,27 +205,27 @@ func (c *Client) Logs(ctx context.Context, namespace string, driver proto.Contai return } -// Version implements the proto.OSDClient interface. -func (c *Client) Version(ctx context.Context) (*initproto.VersionReply, error) { - return c.initClient.Version(ctx, &empty.Empty{}) +// Version implements the proto.OSClient interface. +func (c *Client) Version(ctx context.Context) (*machineapi.VersionReply, error) { + return c.MachineClient.Version(ctx, &empty.Empty{}) } -// Routes implements the networkdproto.NetworkdClient interface. -func (c *Client) Routes(ctx context.Context) (reply *networkdproto.RoutesReply, err error) { - reply, err = c.networkdClient.Routes(ctx, &empty.Empty{}) +// Routes implements the networkdproto.NetworkClient interface. +func (c *Client) Routes(ctx context.Context) (reply *networkapi.RoutesReply, err error) { + reply, err = c.NetworkClient.Routes(ctx, &empty.Empty{}) return } -// Interfaces implements the proto.OSDClient interface. -func (c *Client) Interfaces(ctx context.Context) (reply *networkdproto.InterfacesReply, err error) { - reply, err = c.networkdClient.Interfaces(ctx, &empty.Empty{}) +// Interfaces implements the proto.OSClient interface. +func (c *Client) Interfaces(ctx context.Context) (reply *networkapi.InterfacesReply, err error) { + reply, err = c.NetworkClient.Interfaces(ctx, &empty.Empty{}) return } -// Top implements the proto.OSDClient interface. -func (c *Client) Top(ctx context.Context) (pl []proc.ProcessList, err error) { - var reply *proto.TopReply - reply, err = c.client.Top(ctx, &empty.Empty{}) +// Processes implements the proto.OSClient interface. +func (c *Client) Processes(ctx context.Context) (pl []proc.ProcessList, err error) { + var reply *osapi.ProcessesReply + reply, err = c.client.Processes(ctx, &empty.Empty{}) if err != nil { return } @@ -236,19 +236,19 @@ func (c *Client) Top(ctx context.Context) (pl []proc.ProcessList, err error) { return } -// DF implements the proto.OSDClient interface. -func (c *Client) DF(ctx context.Context) (*initproto.DFReply, error) { - return c.initClient.DF(ctx, &empty.Empty{}) +// Mounts implements the proto.OSClient interface. +func (c *Client) Mounts(ctx context.Context) (*machineapi.MountsReply, error) { + return c.MachineClient.Mounts(ctx, &empty.Empty{}) } -// LS implements the proto.OSDClient interface. -func (c *Client) LS(ctx context.Context, req initproto.LSRequest) (stream initproto.Init_LSClient, err error) { - return c.initClient.LS(ctx, &req) +// LS implements the proto.OSClient interface. +func (c *Client) LS(ctx context.Context, req machineapi.LSRequest) (stream machineapi.Machine_LSClient, err error) { + return c.MachineClient.LS(ctx, &req) } -// CopyOut implements the proto.OSDClient interface +// CopyOut implements the proto.OSClient interface func (c *Client) CopyOut(ctx context.Context, rootPath string) (io.Reader, <-chan error, error) { - stream, err := c.initClient.CopyOut(ctx, &initproto.CopyOutRequest{ + stream, err := c.MachineClient.CopyOut(ctx, &machineapi.CopyOutRequest{ RootPath: rootPath, }) if err != nil { @@ -292,10 +292,10 @@ func (c *Client) CopyOut(ctx context.Context, rootPath string) (io.Reader, <-cha return pr, errCh, nil } -// Upgrade initiates a Talos upgrade ... and implements the proto.OSDClient +// Upgrade initiates a Talos upgrade ... and implements the proto.OSClient // interface func (c *Client) Upgrade(ctx context.Context, image string) (string, error) { - reply, err := c.initClient.Upgrade(ctx, &initproto.UpgradeRequest{Image: image}) + reply, err := c.MachineClient.Upgrade(ctx, &machineapi.UpgradeRequest{Image: image}) if err != nil { return "", err } @@ -303,16 +303,16 @@ func (c *Client) Upgrade(ctx context.Context, image string) (string, error) { } // ServiceList returns list of services with their state -func (c *Client) ServiceList(ctx context.Context) (*initproto.ServiceListReply, error) { - return c.initClient.ServiceList(ctx, &empty.Empty{}) +func (c *Client) ServiceList(ctx context.Context) (*machineapi.ServiceListReply, error) { + return c.MachineClient.ServiceList(ctx, &empty.Empty{}) } // ServiceInfo returns info about a single service // // This is implemented via service list API, as we don't have many services // If service with given id is not registered, function returns nil -func (c *Client) ServiceInfo(ctx context.Context, id string) (*initproto.ServiceInfo, error) { - reply, err := c.initClient.ServiceList(ctx, &empty.Empty{}) +func (c *Client) ServiceInfo(ctx context.Context, id string) (*machineapi.ServiceInfo, error) { + reply, err := c.MachineClient.ServiceList(ctx, &empty.Empty{}) if err != nil { return nil, err } @@ -328,7 +328,7 @@ func (c *Client) ServiceInfo(ctx context.Context, id string) (*initproto.Service // ServiceStart starts a service. func (c *Client) ServiceStart(ctx context.Context, id string) (string, error) { - r, err := c.initClient.ServiceStart(ctx, &initproto.ServiceStartRequest{Id: id}) + r, err := c.MachineClient.ServiceStart(ctx, &machineapi.ServiceStartRequest{Id: id}) if err != nil { return "", err } @@ -338,7 +338,7 @@ func (c *Client) ServiceStart(ctx context.Context, id string) (string, error) { // ServiceStop stops a service. func (c *Client) ServiceStop(ctx context.Context, id string) (string, error) { - r, err := c.initClient.ServiceStop(ctx, &initproto.ServiceStopRequest{Id: id}) + r, err := c.MachineClient.ServiceStop(ctx, &machineapi.ServiceStopRequest{Id: id}) if err != nil { return "", err } @@ -348,7 +348,7 @@ func (c *Client) ServiceStop(ctx context.Context, id string) (string, error) { // ServiceRestart restarts a service. func (c *Client) ServiceRestart(ctx context.Context, id string) (string, error) { - r, err := c.initClient.ServiceRestart(ctx, &initproto.ServiceRestartRequest{Id: id}) + r, err := c.MachineClient.ServiceRestart(ctx, &machineapi.ServiceRestartRequest{Id: id}) if err != nil { return "", err } @@ -357,8 +357,8 @@ func (c *Client) ServiceRestart(ctx context.Context, id string) (string, error) } // Time returns the time -func (c *Client) Time(ctx context.Context) (*ntpdproto.TimeReply, error) { - r, err := c.ntpdClient.Time(ctx, &empty.Empty{}) +func (c *Client) Time(ctx context.Context) (*timeapi.TimeReply, error) { + r, err := c.TimeClient.Time(ctx, &empty.Empty{}) if err != nil { return nil, err } @@ -367,8 +367,8 @@ func (c *Client) Time(ctx context.Context) (*ntpdproto.TimeReply, error) { } // TimeCheck returns the time compared to the specified ntp server -func (c *Client) TimeCheck(ctx context.Context, server string) (*ntpdproto.TimeReply, error) { - r, err := c.ntpdClient.TimeCheck(ctx, &ntpdproto.TimeRequest{Server: server}) +func (c *Client) TimeCheck(ctx context.Context, server string) (*timeapi.TimeReply, error) { + r, err := c.TimeClient.TimeCheck(ctx, &timeapi.TimeRequest{Server: server}) if err != nil { return nil, err } diff --git a/internal/app/machined/internal/api/reg/reg.go b/internal/app/machined/internal/api/reg/reg.go index 023f290c6..70a41ff1c 100644 --- a/internal/app/machined/internal/api/reg/reg.go +++ b/internal/app/machined/internal/api/reg/reg.go @@ -20,7 +20,7 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/event" "github.com/talos-systems/talos/internal/app/machined/pkg/system" "github.com/talos-systems/talos/pkg/archiver" @@ -34,7 +34,7 @@ import ( const OSPathSeparator = string(os.PathSeparator) // Registrator is the concrete type that implements the factory.Registrator and -// proto.Init interfaces. +// machineapi.Machine interfaces. type Registrator struct { Data *userdata.UserData } @@ -48,12 +48,12 @@ func NewRegistrator(data *userdata.UserData) *Registrator { // Register implements the factory.Registrator interface. func (r *Registrator) Register(s *grpc.Server) { - proto.RegisterInitServer(s, r) + machineapi.RegisterMachineServer(s, r) } -// Reboot implements the proto.InitServer interface. -func (r *Registrator) Reboot(ctx context.Context, in *empty.Empty) (reply *proto.RebootReply, err error) { - reply = &proto.RebootReply{} +// Reboot implements the machineapi.MachineServer interface. +func (r *Registrator) Reboot(ctx context.Context, in *empty.Empty) (reply *machineapi.RebootReply, err error) { + reply = &machineapi.RebootReply{} log.Printf("reboot via API received") event.Bus().Notify(event.Event{Type: event.Reboot}) @@ -61,9 +61,9 @@ func (r *Registrator) Reboot(ctx context.Context, in *empty.Empty) (reply *proto return } -// Shutdown implements the proto.InitServer interface. -func (r *Registrator) Shutdown(ctx context.Context, in *empty.Empty) (reply *proto.ShutdownReply, err error) { - reply = &proto.ShutdownReply{} +// Shutdown implements the machineapi.MachineServer interface. +func (r *Registrator) Shutdown(ctx context.Context, in *empty.Empty) (reply *machineapi.ShutdownReply, err error) { + reply = &machineapi.ShutdownReply{} log.Printf("shutdown via API received") event.Bus().Notify(event.Event{Type: event.Shutdown}) @@ -72,15 +72,15 @@ func (r *Registrator) Shutdown(ctx context.Context, in *empty.Empty) (reply *pro } // Upgrade initiates a Talos upgrade -func (r *Registrator) Upgrade(ctx context.Context, in *proto.UpgradeRequest) (data *proto.UpgradeReply, err error) { +func (r *Registrator) Upgrade(ctx context.Context, in *machineapi.UpgradeRequest) (data *machineapi.UpgradeReply, err error) { event.Bus().Notify(event.Event{Type: event.Upgrade, Data: in}) - data = &proto.UpgradeReply{Ack: "Upgrade request received"} + data = &machineapi.UpgradeReply{Ack: "Upgrade request received"} return data, err } // Reset initiates a Talos upgrade -func (r *Registrator) Reset(ctx context.Context, in *empty.Empty) (data *proto.ResetReply, err error) { +func (r *Registrator) Reset(ctx context.Context, in *empty.Empty) (data *machineapi.ResetReply, err error) { // Stop the kubelet. if err = system.Services(r.Data).Stop(ctx, "kubelet"); err != nil { return data, err @@ -91,15 +91,15 @@ func (r *Registrator) Reset(ctx context.Context, in *empty.Empty) (data *proto.R return nil, err } - return &proto.ResetReply{}, err + return &machineapi.ResetReply{}, err } // ServiceList returns list of the registered services and their status -func (r *Registrator) ServiceList(ctx context.Context, in *empty.Empty) (result *proto.ServiceListReply, err error) { +func (r *Registrator) ServiceList(ctx context.Context, in *empty.Empty) (result *machineapi.ServiceListReply, err error) { services := system.Services(r.Data).List() - result = &proto.ServiceListReply{ - Services: make([]*proto.ServiceInfo, len(services)), + result = &machineapi.ServiceListReply{ + Services: make([]*machineapi.ServiceInfo, len(services)), } for i := range services { @@ -109,24 +109,24 @@ func (r *Registrator) ServiceList(ctx context.Context, in *empty.Empty) (result return result, nil } -// ServiceStart implements the proto.InitServer interface and starts a +// ServiceStart implements the machineapi.MachineServer interface and starts a // service running on Talos. -func (r *Registrator) ServiceStart(ctx context.Context, in *proto.ServiceStartRequest) (reply *proto.ServiceStartReply, err error) { +func (r *Registrator) ServiceStart(ctx context.Context, in *machineapi.ServiceStartRequest) (reply *machineapi.ServiceStartReply, err error) { if err = system.Services(r.Data).APIStart(ctx, in.Id); err != nil { - return &proto.ServiceStartReply{}, err + return &machineapi.ServiceStartReply{}, err } - reply = &proto.ServiceStartReply{Resp: fmt.Sprintf("Service %q started", in.Id)} + reply = &machineapi.ServiceStartReply{Resp: fmt.Sprintf("Service %q started", in.Id)} return reply, err } // Start implements deprecated Start method which forwards to 'ServiceStart'. //nolint: staticcheck -func (r *Registrator) Start(ctx context.Context, in *proto.StartRequest) (reply *proto.StartReply, err error) { - var rep *proto.ServiceStartReply - rep, err = r.ServiceStart(ctx, &proto.ServiceStartRequest{Id: in.Id}) +func (r *Registrator) Start(ctx context.Context, in *machineapi.StartRequest) (reply *machineapi.StartReply, err error) { + var rep *machineapi.ServiceStartReply + rep, err = r.ServiceStart(ctx, &machineapi.ServiceStartRequest{Id: in.Id}) if rep != nil { - reply = &proto.StartReply{ + reply = &machineapi.StartReply{ Resp: rep.Resp, } } @@ -136,11 +136,11 @@ func (r *Registrator) Start(ctx context.Context, in *proto.StartRequest) (reply // Stop implements deprecated Stop method which forwards to 'ServiceStop'. //nolint: staticcheck -func (r *Registrator) Stop(ctx context.Context, in *proto.StopRequest) (reply *proto.StopReply, err error) { - var rep *proto.ServiceStopReply - rep, err = r.ServiceStop(ctx, &proto.ServiceStopRequest{Id: in.Id}) +func (r *Registrator) Stop(ctx context.Context, in *machineapi.StopRequest) (reply *machineapi.StopReply, err error) { + var rep *machineapi.ServiceStopReply + rep, err = r.ServiceStop(ctx, &machineapi.ServiceStopRequest{Id: in.Id}) if rep != nil { - reply = &proto.StopReply{ + reply = &machineapi.StopReply{ Resp: rep.Resp, } } @@ -148,30 +148,30 @@ func (r *Registrator) Stop(ctx context.Context, in *proto.StopRequest) (reply *p return } -// ServiceStop implements the proto.InitServer interface and stops a +// ServiceStop implements the machineapi.MachineServer interface and stops a // service running on Talos. -func (r *Registrator) ServiceStop(ctx context.Context, in *proto.ServiceStopRequest) (reply *proto.ServiceStopReply, err error) { +func (r *Registrator) ServiceStop(ctx context.Context, in *machineapi.ServiceStopRequest) (reply *machineapi.ServiceStopReply, err error) { if err = system.Services(r.Data).APIStop(ctx, in.Id); err != nil { - return &proto.ServiceStopReply{}, err + return &machineapi.ServiceStopReply{}, err } - reply = &proto.ServiceStopReply{Resp: fmt.Sprintf("Service %q stopped", in.Id)} + reply = &machineapi.ServiceStopReply{Resp: fmt.Sprintf("Service %q stopped", in.Id)} return reply, err } -// ServiceRestart implements the proto.InitServer interface and stops a +// ServiceRestart implements the machineapi.MachineServer interface and stops a // service running on Talos. -func (r *Registrator) ServiceRestart(ctx context.Context, in *proto.ServiceRestartRequest) (reply *proto.ServiceRestartReply, err error) { +func (r *Registrator) ServiceRestart(ctx context.Context, in *machineapi.ServiceRestartRequest) (reply *machineapi.ServiceRestartReply, err error) { if err = system.Services(r.Data).APIRestart(ctx, in.Id); err != nil { - return &proto.ServiceRestartReply{}, err + return &machineapi.ServiceRestartReply{}, err } - reply = &proto.ServiceRestartReply{Resp: fmt.Sprintf("Service %q restarted", in.Id)} + reply = &machineapi.ServiceRestartReply{Resp: fmt.Sprintf("Service %q restarted", in.Id)} return reply, err } -// CopyOut implements the proto.InitServer interface and copies data out of Talos node -func (r *Registrator) CopyOut(req *proto.CopyOutRequest, s proto.Init_CopyOutServer) error { +// CopyOut implements the machineapi.MachineServer interface and copies data out of Talos node +func (r *Registrator) CopyOut(req *machineapi.CopyOutRequest, s machineapi.Machine_CopyOutServer) error { path := req.RootPath path = filepath.Clean(path) @@ -196,7 +196,7 @@ func (r *Registrator) CopyOut(req *proto.CopyOutRequest, s proto.Init_CopyOutSer chunkCh := chunker.Read(ctx) for data := range chunkCh { - err := s.SendMsg(&proto.StreamingData{Bytes: data}) + err := s.SendMsg(&machineapi.StreamingData{Bytes: data}) if err != nil { ctxCancel() } @@ -204,16 +204,16 @@ func (r *Registrator) CopyOut(req *proto.CopyOutRequest, s proto.Init_CopyOutSer archiveErr := <-errCh if archiveErr != nil { - return s.SendMsg(&proto.StreamingData{Errors: archiveErr.Error()}) + return s.SendMsg(&machineapi.StreamingData{Errors: archiveErr.Error()}) } return nil } -// LS implements the proto.InitServer interface. -func (r *Registrator) LS(req *proto.LSRequest, s proto.Init_LSServer) error { +// LS implements the machineapi.MachineServer interface. +func (r *Registrator) LS(req *machineapi.LSRequest, s machineapi.Machine_LSServer) error { if req == nil { - req = new(proto.LSRequest) + req = new(machineapi.LSRequest) } if !strings.HasPrefix(req.Root, OSPathSeparator) { // Make sure we use complete paths @@ -240,13 +240,13 @@ func (r *Registrator) LS(req *proto.LSRequest, s proto.Init_LSServer) error { for fi := range files { if fi.Error != nil { - err = s.Send(&proto.FileInfo{ + err = s.Send(&machineapi.FileInfo{ Name: fi.FullPath, RelativeName: fi.RelPath, Error: fi.Error.Error(), }) } else { - err = s.Send(&proto.FileInfo{ + err = s.Send(&machineapi.FileInfo{ Name: fi.FullPath, RelativeName: fi.RelPath, Size: fi.FileInfo.Size(), @@ -264,8 +264,8 @@ func (r *Registrator) LS(req *proto.LSRequest, s proto.Init_LSServer) error { return nil } -// DF implements the proto.OSDServer interface. -func (r *Registrator) DF(ctx context.Context, in *empty.Empty) (reply *proto.DFReply, err error) { +// Mounts implements the machineapi.OSDServer interface. +func (r *Registrator) Mounts(ctx context.Context, in *empty.Empty) (reply *machineapi.MountsReply, err error) { file, err := os.Open("/proc/mounts") if err != nil { return nil, err @@ -278,7 +278,7 @@ func (r *Registrator) DF(ctx context.Context, in *empty.Empty) (reply *proto.DFR multiErr *multierror.Error ) - stats := []*proto.DFStat{} + stats := []*machineapi.MountStat{} scanner := bufio.NewScanner(file) for scanner.Scan() { fields := strings.Fields(scanner.Text()) @@ -308,7 +308,7 @@ func (r *Registrator) DF(ctx context.Context, in *empty.Empty) (reply *proto.DFR totalSize := uint64(stat.Bsize) * stat.Blocks totalAvail := uint64(stat.Bsize) * stat.Bavail - stat := &proto.DFStat{ + stat := &machineapi.MountStat{ Filesystem: filesystem, Size: totalSize, Available: totalAvail, @@ -322,14 +322,14 @@ func (r *Registrator) DF(ctx context.Context, in *empty.Empty) (reply *proto.DFR multiErr = multierror.Append(multiErr, err) } - reply = &proto.DFReply{ + reply = &machineapi.MountsReply{ Stats: stats, } return reply, multiErr.ErrorOrNil() } -// Version implements the proto.InitServer interface. -func (r *Registrator) Version(ctx context.Context, in *empty.Empty) (reply *proto.VersionReply, err error) { +// Version implements the machineapi.MachineServer interface. +func (r *Registrator) Version(ctx context.Context, in *empty.Empty) (reply *machineapi.VersionReply, err error) { return version.NewVersion(), nil } diff --git a/internal/app/machined/internal/phase/upgrade/upgrade.go b/internal/app/machined/internal/phase/upgrade/upgrade.go index 5733d1d30..f30af8c4a 100644 --- a/internal/app/machined/internal/phase/upgrade/upgrade.go +++ b/internal/app/machined/internal/phase/upgrade/upgrade.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/install" "github.com/talos-systems/talos/internal/app/machined/internal/phase" "github.com/talos-systems/talos/internal/app/machined/internal/platform" @@ -27,7 +27,7 @@ type Upgrade struct { } // NewUpgradeTask initializes and returns an Services task. -func NewUpgradeTask(devname string, req *proto.UpgradeRequest) phase.Task { +func NewUpgradeTask(devname string, req *machineapi.UpgradeRequest) phase.Task { return &Upgrade{ devname: devname, ref: req.Image, diff --git a/internal/app/machined/internal/sequencer/sequencer.go b/internal/app/machined/internal/sequencer/sequencer.go index 998d9fd1c..9649cfd3f 100644 --- a/internal/app/machined/internal/sequencer/sequencer.go +++ b/internal/app/machined/internal/sequencer/sequencer.go @@ -5,7 +5,7 @@ package sequencer import ( - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/sequencer/v1alpha1" ) @@ -13,7 +13,7 @@ import ( type Sequencer interface { Boot() error Shutdown() error - Upgrade(*proto.UpgradeRequest) error + Upgrade(*machineapi.UpgradeRequest) error } // Version represents the sequencer version. diff --git a/internal/app/machined/internal/sequencer/v1alpha1/types.go b/internal/app/machined/internal/sequencer/v1alpha1/types.go index eddff0037..08d978ede 100644 --- a/internal/app/machined/internal/sequencer/v1alpha1/types.go +++ b/internal/app/machined/internal/sequencer/v1alpha1/types.go @@ -5,7 +5,7 @@ package v1alpha1 import ( - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/phase" "github.com/talos-systems/talos/internal/app/machined/internal/phase/acpi" "github.com/talos-systems/talos/internal/app/machined/internal/phase/disk" @@ -124,7 +124,7 @@ func (d *Sequencer) Shutdown() error { } // Upgrade implements the Sequencer interface. -func (d *Sequencer) Upgrade(req *proto.UpgradeRequest) error { +func (d *Sequencer) Upgrade(req *machineapi.UpgradeRequest) error { data, err := userdata.Open(constants.UserDataPath) if err != nil { return err diff --git a/internal/app/machined/main.go b/internal/app/machined/main.go index 65544fb51..f4d2894cf 100644 --- a/internal/app/machined/main.go +++ b/internal/app/machined/main.go @@ -12,7 +12,7 @@ import ( "github.com/pkg/errors" "golang.org/x/sys/unix" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/internal/event" "github.com/talos-systems/talos/internal/app/machined/internal/sequencer" "github.com/talos-systems/talos/pkg/constants" @@ -132,10 +132,10 @@ func main() { } case event.Upgrade: var ( - req *proto.UpgradeRequest + req *machineapi.UpgradeRequest ok bool ) - if req, ok = e.Data.(*proto.UpgradeRequest); !ok { + if req, ok = e.Data.(*machineapi.UpgradeRequest); !ok { log.Println("cannot perform upgrade, unexpected data type") continue } diff --git a/internal/app/machined/pkg/system/events/events.go b/internal/app/machined/pkg/system/events/events.go index 04f2a627b..92e8eb38d 100644 --- a/internal/app/machined/pkg/system/events/events.go +++ b/internal/app/machined/pkg/system/events/events.go @@ -9,7 +9,7 @@ import ( "github.com/golang/protobuf/ptypes" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" ) // MaxEventsToKeep is maximum number of events to keep per service before dropping old entries @@ -104,18 +104,18 @@ func (events *ServiceEvents) Get(count int) (result []ServiceEvent) { } // AsProto returns protobuf-ready serialized snapshot -func (events *ServiceEvents) AsProto(count int) *proto.ServiceEvents { +func (events *ServiceEvents) AsProto(count int) *machineapi.ServiceEvents { eventList := events.Get(count) - result := &proto.ServiceEvents{ - Events: make([]*proto.ServiceEvent, len(eventList)), + result := &machineapi.ServiceEvents{ + Events: make([]*machineapi.ServiceEvent, len(eventList)), } for i := range eventList { // nolint: errcheck tspb, _ := ptypes.TimestampProto(eventList[i].Timestamp) - result.Events[i] = &proto.ServiceEvent{ + result.Events[i] = &machineapi.ServiceEvent{ Msg: eventList[i].Message, State: eventList[i].State.String(), Ts: tspb, diff --git a/internal/app/machined/pkg/system/health/status.go b/internal/app/machined/pkg/system/health/status.go index 8d42e468c..b078d2c6c 100644 --- a/internal/app/machined/pkg/system/health/status.go +++ b/internal/app/machined/pkg/system/health/status.go @@ -10,7 +10,7 @@ import ( "github.com/golang/protobuf/ptypes" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" ) // Status of the healthcheck @@ -111,13 +111,13 @@ func (state *State) Get() Status { } // AsProto returns protobuf-ready health state -func (state *State) AsProto() *proto.ServiceHealth { +func (state *State) AsProto() *machineapi.ServiceHealth { status := state.Get() // nolint: errcheck tspb, _ := ptypes.TimestampProto(status.LastChange) - return &proto.ServiceHealth{ + return &machineapi.ServiceHealth{ Unknown: status.Healthy == nil, Healthy: status.Healthy != nil && *status.Healthy, LastMessage: status.LastMessage, diff --git a/internal/app/machined/pkg/system/service_runner.go b/internal/app/machined/pkg/system/service_runner.go index 5e9681454..c6d28d5ac 100644 --- a/internal/app/machined/pkg/system/service_runner.go +++ b/internal/app/machined/pkg/system/service_runner.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" - proto "github.com/talos-systems/talos/api/machine" + machineapi "github.com/talos-systems/talos/api/machine" "github.com/talos-systems/talos/internal/app/machined/pkg/system/conditions" "github.com/talos-systems/talos/internal/app/machined/pkg/system/events" "github.com/talos-systems/talos/internal/app/machined/pkg/system/health" @@ -307,11 +307,11 @@ func (svcrunner *ServiceRunner) Shutdown() { } // AsProto returns protobuf struct with the state of the service runner -func (svcrunner *ServiceRunner) AsProto() *proto.ServiceInfo { +func (svcrunner *ServiceRunner) AsProto() *machineapi.ServiceInfo { svcrunner.mu.Lock() defer svcrunner.mu.Unlock() - return &proto.ServiceInfo{ + return &machineapi.ServiceInfo{ Id: svcrunner.id, State: svcrunner.state.String(), Events: svcrunner.events.AsProto(events.MaxEventsToKeep), diff --git a/internal/app/machined/pkg/system/services/kubeadm.go b/internal/app/machined/pkg/system/services/kubeadm.go index 1a1f00c9e..b05a6fae7 100644 --- a/internal/app/machined/pkg/system/services/kubeadm.go +++ b/internal/app/machined/pkg/system/services/kubeadm.go @@ -19,7 +19,7 @@ import ( specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" - proto "github.com/talos-systems/talos/api/security" + securityapi "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/internal/app/machined/pkg/system/conditions" "github.com/talos-systems/talos/internal/app/machined/pkg/system/runner" "github.com/talos-systems/talos/internal/app/machined/pkg/system/runner/containerd" @@ -78,8 +78,8 @@ func (k *Kubeadm) PreFunc(ctx context.Context, data *userdata.UserData) (err err } // Initialize trustd peer client connection - var trustds []proto.TrustdClient - if trustds, err = kubeadm.CreateTrustdClients(data); err != nil { + var trustds []securityapi.SecurityClient + if trustds, err = kubeadm.CreateSecurityClients(data); err != nil { return err } @@ -93,7 +93,7 @@ func (k *Kubeadm) PreFunc(ctx context.Context, data *userdata.UserData) (err err // Get assets from remote nodes for _, fileRequest := range kubeadm.FileSet(kubeadm.RequiredFiles()) { // Handle all file requests in parallel - go func(ctx context.Context, fileRequest *proto.ReadFileRequest) { + go func(ctx context.Context, fileRequest *securityapi.ReadFileRequest) { defer wg.Done() trustctx, ctxCancel := context.WithCancel(ctx) @@ -105,8 +105,8 @@ func (k *Kubeadm) PreFunc(ctx context.Context, data *userdata.UserData) (err err // kick off a goroutine for each trustd client // to fetch the given file - for _, trustdClient := range trustds { - go kubeadm.Download(trustctx, trustdClient, fileRequest, content) + for _, SecurityClient := range trustds { + go kubeadm.Download(trustctx, SecurityClient, fileRequest, content) } select { diff --git a/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go b/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go index cad344165..fc124c054 100644 --- a/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go +++ b/internal/app/machined/pkg/system/services/kubeadm/kubeadm.go @@ -22,7 +22,7 @@ import ( "google.golang.org/grpc/status" kubeadmv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" - proto "github.com/talos-systems/talos/api/security" + securityapi "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/internal/pkg/cis" "github.com/talos-systems/talos/pkg/cmd" "github.com/talos-systems/talos/pkg/constants" @@ -239,25 +239,25 @@ func RequiredFiles() []string { // FileSet compares the list of required files to the ones // already present on the node and returns the delta -func FileSet(files []string) []*proto.ReadFileRequest { - fileRequests := []*proto.ReadFileRequest{} +func FileSet(files []string) []*securityapi.ReadFileRequest { + fileRequests := []*securityapi.ReadFileRequest{} // Check to see if we already have the file locally for _, file := range files { if _, err := os.Stat(file); os.IsNotExist(err) { - fileRequests = append(fileRequests, &proto.ReadFileRequest{Path: file}) + fileRequests = append(fileRequests, &securityapi.ReadFileRequest{Path: file}) } } return fileRequests } -// CreateTrustdClients handles instantiating a trustd client connection +// CreateSecurityClients handles instantiating a trustd client connection // to each trustd endpoint defined in userdata -func CreateTrustdClients(data *userdata.UserData) ([]proto.TrustdClient, error) { +func CreateSecurityClients(data *userdata.UserData) ([]securityapi.SecurityClient, error) { var creds basic.Credentials var err error - trustds := []proto.TrustdClient{} + trustds := []securityapi.SecurityClient{} creds, err = basic.NewCredentials(data.Services.Trustd) if err != nil { @@ -272,22 +272,22 @@ func CreateTrustdClients(data *userdata.UserData) ([]proto.TrustdClient, error) if err != nil { return trustds, err } - trustds = append(trustds, proto.NewTrustdClient(conn)) + trustds = append(trustds, securityapi.NewSecurityClient(conn)) } return trustds, nil } // Download handles the retrieval of files from a trustd endpoint -func Download(ctx context.Context, client proto.TrustdClient, file *proto.ReadFileRequest, content chan<- []byte) { +func Download(ctx context.Context, client securityapi.SecurityClient, file *securityapi.ReadFileRequest, content chan<- []byte) { select { case <-ctx.Done(): case content <- download(ctx, client, file): } } -func download(ctx context.Context, client proto.TrustdClient, file *proto.ReadFileRequest) []byte { +func download(ctx context.Context, client securityapi.SecurityClient, file *securityapi.ReadFileRequest) []byte { var ( - resp *proto.ReadFileResponse + resp *securityapi.ReadFileResponse err error attempt, snooze float64 ) diff --git a/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go b/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go index 2dd50d03f..204c01c38 100644 --- a/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go +++ b/internal/app/machined/pkg/system/services/kubeadm/kubeadm_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/suite" "gopkg.in/yaml.v2" - proto "github.com/talos-systems/talos/api/security" + securityapi "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/pkg/constants" "github.com/talos-systems/talos/pkg/grpc/middleware/auth/basic" "github.com/talos-systems/talos/pkg/userdata" @@ -100,17 +100,17 @@ func (suite *KubeadmSuite) TestDownload() { cancel() conn, err := basic.NewConnection("localhost", constants.TrustdPort, nil) suite.Assert().NoError(err) - data := download(ctx, proto.NewTrustdClient(conn), &proto.ReadFileRequest{Path: ""}) + data := download(ctx, securityapi.NewSecurityClient(conn), &securityapi.ReadFileRequest{Path: ""}) suite.Assert().Equal(len(data), 0) // suite.Assert().NoError(err) } -func (suite *KubeadmSuite) TestCreateTrustdClients() { +func (suite *KubeadmSuite) TestCreateSecurityClients() { data, err := genUD() suite.Assert().NoError(err) - var clients []proto.TrustdClient - clients, err = CreateTrustdClients(data) + var clients []securityapi.SecurityClient + clients, err = CreateSecurityClients(data) suite.Assert().NoError(err) suite.Assert().Equal(len(clients), 2) } diff --git a/internal/app/networkd/pkg/reg/reg.go b/internal/app/networkd/pkg/reg/reg.go index d972755db..8c8f8f888 100644 --- a/internal/app/networkd/pkg/reg/reg.go +++ b/internal/app/networkd/pkg/reg/reg.go @@ -14,12 +14,12 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/network" + networkapi "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/internal/app/networkd/pkg/networkd" ) // Registrator is the concrete type that implements the factory.Registrator and -// proto.Init interfaces. +// networkapi.NetworkServer interfaces. type Registrator struct { Networkd *networkd.Networkd } @@ -33,17 +33,17 @@ func NewRegistrator(n *networkd.Networkd) *Registrator { // Register implements the factory.Registrator interface. func (r *Registrator) Register(s *grpc.Server) { - proto.RegisterNetworkdServer(s, r) + networkapi.RegisterNetworkServer(s, r) } // Routes returns the hosts routing table. -func (r *Registrator) Routes(ctx context.Context, in *empty.Empty) (reply *proto.RoutesReply, err error) { +func (r *Registrator) Routes(ctx context.Context, in *empty.Empty) (reply *networkapi.RoutesReply, err error) { list, err := r.Networkd.NlConn.Route.List() if err != nil { return nil, errors.Errorf("failed to get route list: %v", err) } - routes := []*proto.Route{} + routes := []*networkapi.Route{} for _, rMesg := range list { @@ -56,26 +56,26 @@ func (r *Registrator) Routes(ctx context.Context, in *empty.Empty) (reply *proto continue } - routes = append(routes, &proto.Route{ + routes = append(routes, &networkapi.Route{ Interface: ifaceData.Name, Destination: toCIDR(rMesg.Family, rMesg.Attributes.Dst, int(rMesg.DstLength)), Gateway: rMesg.Attributes.Gateway.String(), Metric: rMesg.Attributes.Priority, Scope: uint32(rMesg.Scope), Source: toCIDR(rMesg.Family, rMesg.Attributes.Src, int(rMesg.SrcLength)), - Family: proto.AddressFamily(rMesg.Family), - Protocol: proto.RouteProtocol(rMesg.Protocol), + Family: networkapi.AddressFamily(rMesg.Family), + Protocol: networkapi.RouteProtocol(rMesg.Protocol), Flags: rMesg.Flags, }) } - return &proto.RoutesReply{ + return &networkapi.RoutesReply{ Routes: routes, }, nil } // Interfaces returns the hosts network interfaces and addresses. -func (r *Registrator) Interfaces(ctx context.Context, in *empty.Empty) (reply *proto.InterfacesReply, err error) { +func (r *Registrator) Interfaces(ctx context.Context, in *empty.Empty) (reply *networkapi.InterfacesReply, err error) { var ( ifaces []*net.Interface addrs []string @@ -88,7 +88,7 @@ func (r *Registrator) Interfaces(ctx context.Context, in *empty.Empty) (reply *p return reply, err } - reply = &proto.InterfacesReply{} + reply = &networkapi.InterfacesReply{} for _, iface := range ifaces { addrs = []string{} @@ -105,12 +105,12 @@ func (r *Registrator) Interfaces(ctx context.Context, in *empty.Empty) (reply *p } } - ifmsg := &proto.Interface{ + ifmsg := &networkapi.Interface{ Index: uint32(iface.Index), Mtu: uint32(iface.MTU), Name: iface.Name, Hardwareaddr: iface.HardwareAddr.String(), - Flags: proto.InterfaceFlags(iface.Flags), + Flags: networkapi.InterfaceFlags(iface.Flags), Ipaddress: addrs, } diff --git a/internal/app/networkd/pkg/reg/reg_test.go b/internal/app/networkd/pkg/reg/reg_test.go index efad6228d..e83bcf061 100644 --- a/internal/app/networkd/pkg/reg/reg_test.go +++ b/internal/app/networkd/pkg/reg/reg_test.go @@ -17,7 +17,7 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/network" + networkapi "github.com/talos-systems/talos/api/network" "github.com/talos-systems/talos/internal/app/networkd/pkg/networkd" "github.com/talos-systems/talos/pkg/grpc/factory" ) @@ -46,7 +46,7 @@ func (suite *NetworkdSuite) TestRoutes() { conn, err := grpc.Dial(fmt.Sprintf("%s://%s", "unix", listener.Addr().String()), grpc.WithInsecure()) suite.Assert().NoError(err) - nClient := proto.NewNetworkdClient(conn) + nClient := networkapi.NewNetworkClient(conn) resp, err := nClient.Routes(context.Background(), &empty.Empty{}) suite.Assert().NoError(err) @@ -67,7 +67,7 @@ func (suite *NetworkdSuite) TestInterfaces() { conn, err := grpc.Dial(fmt.Sprintf("%s://%s", "unix", listener.Addr().String()), grpc.WithInsecure()) suite.Assert().NoError(err) - nClient := proto.NewNetworkdClient(conn) + nClient := networkapi.NewNetworkClient(conn) resp, err := nClient.Interfaces(context.Background(), &empty.Empty{}) suite.Assert().NoError(err) diff --git a/internal/app/networkd/proto/api.pb.go b/internal/app/networkd/proto/api.pb.go deleted file mode 100644 index e4171f752..000000000 --- a/internal/app/networkd/proto/api.pb.go +++ /dev/null @@ -1,617 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: api.proto - -package proto - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - empty "github.com/golang/protobuf/ptypes/empty" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type AddressFamily int32 - -const ( - AddressFamily_AF_UNSPEC AddressFamily = 0 - AddressFamily_AF_INET AddressFamily = 2 - AddressFamily_IPV4 AddressFamily = 2 - AddressFamily_AF_INET6 AddressFamily = 10 - AddressFamily_IPV6 AddressFamily = 10 -) - -var AddressFamily_name = map[int32]string{ - 0: "AF_UNSPEC", - 2: "AF_INET", - // Duplicate value: 2: "IPV4", - 10: "AF_INET6", - // Duplicate value: 10: "IPV6", -} - -var AddressFamily_value = map[string]int32{ - "AF_UNSPEC": 0, - "AF_INET": 2, - "IPV4": 2, - "AF_INET6": 10, - "IPV6": 10, -} - -func (x AddressFamily) String() string { - return proto.EnumName(AddressFamily_name, int32(x)) -} - -func (AddressFamily) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} - -type RouteProtocol int32 - -const ( - RouteProtocol_RTPROT_UNSPEC RouteProtocol = 0 - RouteProtocol_RTPROT_REDIRECT RouteProtocol = 1 - RouteProtocol_RTPROT_KERNEL RouteProtocol = 2 - RouteProtocol_RTPROT_BOOT RouteProtocol = 3 - RouteProtocol_RTPROT_STATIC RouteProtocol = 4 - RouteProtocol_RTPROT_GATED RouteProtocol = 8 - RouteProtocol_RTPROT_RA RouteProtocol = 9 - RouteProtocol_RTPROT_MRT RouteProtocol = 10 - RouteProtocol_RTPROT_ZEBRA RouteProtocol = 11 - RouteProtocol_RTPROT_BIRD RouteProtocol = 12 - RouteProtocol_RTPROT_DNROUTED RouteProtocol = 13 - RouteProtocol_RTPROT_XORP RouteProtocol = 14 - RouteProtocol_RTPROT_NTK RouteProtocol = 15 - RouteProtocol_RTPROT_DHCP RouteProtocol = 16 - RouteProtocol_RTPROT_MROUTED RouteProtocol = 17 - RouteProtocol_RTPROT_BABEL RouteProtocol = 42 -) - -var RouteProtocol_name = map[int32]string{ - 0: "RTPROT_UNSPEC", - 1: "RTPROT_REDIRECT", - 2: "RTPROT_KERNEL", - 3: "RTPROT_BOOT", - 4: "RTPROT_STATIC", - 8: "RTPROT_GATED", - 9: "RTPROT_RA", - 10: "RTPROT_MRT", - 11: "RTPROT_ZEBRA", - 12: "RTPROT_BIRD", - 13: "RTPROT_DNROUTED", - 14: "RTPROT_XORP", - 15: "RTPROT_NTK", - 16: "RTPROT_DHCP", - 17: "RTPROT_MROUTED", - 42: "RTPROT_BABEL", -} - -var RouteProtocol_value = map[string]int32{ - "RTPROT_UNSPEC": 0, - "RTPROT_REDIRECT": 1, - "RTPROT_KERNEL": 2, - "RTPROT_BOOT": 3, - "RTPROT_STATIC": 4, - "RTPROT_GATED": 8, - "RTPROT_RA": 9, - "RTPROT_MRT": 10, - "RTPROT_ZEBRA": 11, - "RTPROT_BIRD": 12, - "RTPROT_DNROUTED": 13, - "RTPROT_XORP": 14, - "RTPROT_NTK": 15, - "RTPROT_DHCP": 16, - "RTPROT_MROUTED": 17, - "RTPROT_BABEL": 42, -} - -func (x RouteProtocol) String() string { - return proto.EnumName(RouteProtocol_name, int32(x)) -} - -func (RouteProtocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} - -type InterfaceFlags int32 - -const ( - InterfaceFlags_FLAG_UNKNOWN InterfaceFlags = 0 - InterfaceFlags_FLAG_UP InterfaceFlags = 1 - InterfaceFlags_FLAG_BROADCAST InterfaceFlags = 2 - InterfaceFlags_FLAG_LOOPBACK InterfaceFlags = 3 - InterfaceFlags_FLAG_POINT_TO_POINT InterfaceFlags = 4 - InterfaceFlags_FLAG_MULTICAST InterfaceFlags = 5 -) - -var InterfaceFlags_name = map[int32]string{ - 0: "FLAG_UNKNOWN", - 1: "FLAG_UP", - 2: "FLAG_BROADCAST", - 3: "FLAG_LOOPBACK", - 4: "FLAG_POINT_TO_POINT", - 5: "FLAG_MULTICAST", -} - -var InterfaceFlags_value = map[string]int32{ - "FLAG_UNKNOWN": 0, - "FLAG_UP": 1, - "FLAG_BROADCAST": 2, - "FLAG_LOOPBACK": 3, - "FLAG_POINT_TO_POINT": 4, - "FLAG_MULTICAST": 5, -} - -func (x InterfaceFlags) String() string { - return proto.EnumName(InterfaceFlags_name, int32(x)) -} - -func (InterfaceFlags) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} -} - -// The response message containing the routes. -type RoutesReply struct { - Routes []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RoutesReply) Reset() { *m = RoutesReply{} } -func (m *RoutesReply) String() string { return proto.CompactTextString(m) } -func (*RoutesReply) ProtoMessage() {} -func (*RoutesReply) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} - -func (m *RoutesReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RoutesReply.Unmarshal(m, b) -} - -func (m *RoutesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RoutesReply.Marshal(b, m, deterministic) -} - -func (m *RoutesReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoutesReply.Merge(m, src) -} - -func (m *RoutesReply) XXX_Size() int { - return xxx_messageInfo_RoutesReply.Size(m) -} - -func (m *RoutesReply) XXX_DiscardUnknown() { - xxx_messageInfo_RoutesReply.DiscardUnknown(m) -} - -var xxx_messageInfo_RoutesReply proto.InternalMessageInfo - -func (m *RoutesReply) GetRoutes() []*Route { - if m != nil { - return m.Routes - } - return nil -} - -// The response message containing a route. -type Route struct { - // Interface is the interface over which traffic to this destination should be sent - Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` - // Destination is the network prefix CIDR which this route provides - Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` - // Gateway is the gateway address to which traffic to this destination should be sent - Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` - // Metric is the priority of the route, where lower metrics have higher priorities - Metric uint32 `protobuf:"varint,4,opt,name=metric,proto3" json:"metric,omitempty"` - // Scope desribes the scope of this route - Scope uint32 `protobuf:"varint,5,opt,name=scope,proto3" json:"scope,omitempty"` - // Source is the source prefix CIDR for the route, if one is defined - Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"` - // Family is the address family of the route. Currently, the only options are AF_INET (IPV4) and AF_INET6 (IPV6). - Family AddressFamily `protobuf:"varint,7,opt,name=family,proto3,enum=proto.AddressFamily" json:"family,omitempty"` - // Protocol is the protocol by which this route came to be in place - Protocol RouteProtocol `protobuf:"varint,8,opt,name=protocol,proto3,enum=proto.RouteProtocol" json:"protocol,omitempty"` - // Flags indicate any special flags on the route - Flags uint32 `protobuf:"varint,9,opt,name=flags,proto3" json:"flags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Route) Reset() { *m = Route{} } -func (m *Route) String() string { return proto.CompactTextString(m) } -func (*Route) ProtoMessage() {} -func (*Route) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} - -func (m *Route) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Route.Unmarshal(m, b) -} - -func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Route.Marshal(b, m, deterministic) -} - -func (m *Route) XXX_Merge(src proto.Message) { - xxx_messageInfo_Route.Merge(m, src) -} - -func (m *Route) XXX_Size() int { - return xxx_messageInfo_Route.Size(m) -} - -func (m *Route) XXX_DiscardUnknown() { - xxx_messageInfo_Route.DiscardUnknown(m) -} - -var xxx_messageInfo_Route proto.InternalMessageInfo - -func (m *Route) GetInterface() string { - if m != nil { - return m.Interface - } - return "" -} - -func (m *Route) GetDestination() string { - if m != nil { - return m.Destination - } - return "" -} - -func (m *Route) GetGateway() string { - if m != nil { - return m.Gateway - } - return "" -} - -func (m *Route) GetMetric() uint32 { - if m != nil { - return m.Metric - } - return 0 -} - -func (m *Route) GetScope() uint32 { - if m != nil { - return m.Scope - } - return 0 -} - -func (m *Route) GetSource() string { - if m != nil { - return m.Source - } - return "" -} - -func (m *Route) GetFamily() AddressFamily { - if m != nil { - return m.Family - } - return AddressFamily_AF_UNSPEC -} - -func (m *Route) GetProtocol() RouteProtocol { - if m != nil { - return m.Protocol - } - return RouteProtocol_RTPROT_UNSPEC -} - -func (m *Route) GetFlags() uint32 { - if m != nil { - return m.Flags - } - return 0 -} - -type InterfacesReply struct { - Interfaces []*Interface `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InterfacesReply) Reset() { *m = InterfacesReply{} } -func (m *InterfacesReply) String() string { return proto.CompactTextString(m) } -func (*InterfacesReply) ProtoMessage() {} -func (*InterfacesReply) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} -} - -func (m *InterfacesReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InterfacesReply.Unmarshal(m, b) -} - -func (m *InterfacesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InterfacesReply.Marshal(b, m, deterministic) -} - -func (m *InterfacesReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfacesReply.Merge(m, src) -} - -func (m *InterfacesReply) XXX_Size() int { - return xxx_messageInfo_InterfacesReply.Size(m) -} - -func (m *InterfacesReply) XXX_DiscardUnknown() { - xxx_messageInfo_InterfacesReply.DiscardUnknown(m) -} - -var xxx_messageInfo_InterfacesReply proto.InternalMessageInfo - -func (m *InterfacesReply) GetInterfaces() []*Interface { - if m != nil { - return m.Interfaces - } - return nil -} - -// Interface represents a net.Interface -type Interface struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Mtu uint32 `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Hardwareaddr string `protobuf:"bytes,4,opt,name=hardwareaddr,proto3" json:"hardwareaddr,omitempty"` - Flags InterfaceFlags `protobuf:"varint,5,opt,name=flags,proto3,enum=proto.InterfaceFlags" json:"flags,omitempty"` - Ipaddress []string `protobuf:"bytes,6,rep,name=ipaddress,proto3" json:"ipaddress,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Interface) Reset() { *m = Interface{} } -func (m *Interface) String() string { return proto.CompactTextString(m) } -func (*Interface) ProtoMessage() {} -func (*Interface) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} -} - -func (m *Interface) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Interface.Unmarshal(m, b) -} - -func (m *Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Interface.Marshal(b, m, deterministic) -} - -func (m *Interface) XXX_Merge(src proto.Message) { - xxx_messageInfo_Interface.Merge(m, src) -} - -func (m *Interface) XXX_Size() int { - return xxx_messageInfo_Interface.Size(m) -} - -func (m *Interface) XXX_DiscardUnknown() { - xxx_messageInfo_Interface.DiscardUnknown(m) -} - -var xxx_messageInfo_Interface proto.InternalMessageInfo - -func (m *Interface) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *Interface) GetMtu() uint32 { - if m != nil { - return m.Mtu - } - return 0 -} - -func (m *Interface) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Interface) GetHardwareaddr() string { - if m != nil { - return m.Hardwareaddr - } - return "" -} - -func (m *Interface) GetFlags() InterfaceFlags { - if m != nil { - return m.Flags - } - return InterfaceFlags_FLAG_UNKNOWN -} - -func (m *Interface) GetIpaddress() []string { - if m != nil { - return m.Ipaddress - } - return nil -} - -func init() { - proto.RegisterEnum("proto.AddressFamily", AddressFamily_name, AddressFamily_value) - proto.RegisterEnum("proto.RouteProtocol", RouteProtocol_name, RouteProtocol_value) - proto.RegisterEnum("proto.InterfaceFlags", InterfaceFlags_name, InterfaceFlags_value) - proto.RegisterType((*RoutesReply)(nil), "proto.RoutesReply") - proto.RegisterType((*Route)(nil), "proto.Route") - proto.RegisterType((*InterfacesReply)(nil), "proto.InterfacesReply") - proto.RegisterType((*Interface)(nil), "proto.Interface") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4f, 0x6f, 0xda, 0x4e, - 0x10, 0xfd, 0x99, 0x7f, 0xc1, 0x03, 0x86, 0xcd, 0x26, 0xbf, 0xd4, 0x4a, 0xab, 0x0a, 0xa1, 0x1e, - 0x10, 0xad, 0x48, 0x94, 0x44, 0x39, 0xf5, 0x62, 0x83, 0x49, 0x2d, 0x88, 0xed, 0x6e, 0x4c, 0x5b, - 0xe5, 0x82, 0x1c, 0xbc, 0x50, 0xab, 0x80, 0x91, 0x31, 0x4a, 0xb9, 0xf4, 0xd2, 0xcf, 0xd1, 0xcf, - 0xd0, 0x5b, 0x3f, 0x5f, 0xe5, 0xdd, 0x35, 0x31, 0x91, 0x7a, 0xf2, 0xbe, 0x37, 0x6f, 0x67, 0x77, - 0xde, 0x78, 0x07, 0x64, 0x6f, 0x15, 0x74, 0x56, 0x51, 0x18, 0x87, 0xb8, 0xc8, 0x3e, 0xa7, 0x2f, - 0x67, 0x61, 0x38, 0x9b, 0xd3, 0x33, 0x86, 0x1e, 0x36, 0xd3, 0x33, 0xba, 0x58, 0xc5, 0x5b, 0xae, - 0x69, 0x5e, 0x42, 0x85, 0x84, 0x9b, 0x98, 0xae, 0x09, 0x5d, 0xcd, 0xb7, 0xf8, 0x0d, 0x94, 0x22, - 0x06, 0x55, 0xa9, 0x91, 0x6f, 0x55, 0x2e, 0xaa, 0x5c, 0xd6, 0x61, 0x1a, 0x22, 0x62, 0xcd, 0x5f, - 0x39, 0x28, 0x32, 0x06, 0xbf, 0x02, 0x39, 0x58, 0xc6, 0x34, 0x9a, 0x7a, 0x13, 0xaa, 0x4a, 0x0d, - 0xa9, 0x25, 0x93, 0x27, 0x02, 0x37, 0xa0, 0xe2, 0xd3, 0x75, 0x1c, 0x2c, 0xbd, 0x38, 0x08, 0x97, - 0x6a, 0x8e, 0xc5, 0xb3, 0x14, 0x56, 0xe1, 0x60, 0xe6, 0xc5, 0xf4, 0xd1, 0xdb, 0xaa, 0x79, 0x16, - 0x4d, 0x21, 0x3e, 0x81, 0xd2, 0x82, 0xc6, 0x51, 0x30, 0x51, 0x0b, 0x0d, 0xa9, 0xa5, 0x10, 0x81, - 0xf0, 0x31, 0x14, 0xd7, 0x93, 0x70, 0x45, 0xd5, 0x22, 0xa3, 0x39, 0x48, 0xd4, 0xeb, 0x70, 0x13, - 0x4d, 0xa8, 0x5a, 0x62, 0x69, 0x04, 0x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xab, 0xdd, 0x25, 0xdd, 0x39, 0x04, 0x85, 0x71, 0x43, 0xdb, 0x76, 0x74, - 0xad, 0x3b, 0x40, 0x79, 0xfc, 0x02, 0x8e, 0x18, 0xe5, 0xd8, 0xa6, 0xe5, 0x8e, 0x5d, 0x9b, 0x2f, - 0x50, 0x61, 0xb7, 0xff, 0x76, 0x34, 0x74, 0x4d, 0xb6, 0xbf, 0x78, 0xf1, 0x03, 0xca, 0x16, 0x8d, - 0x1f, 0xc3, 0xe8, 0x9b, 0x8f, 0xaf, 0xa0, 0xc4, 0x27, 0x0d, 0x3e, 0xe9, 0xf0, 0x89, 0xd4, 0x49, - 0x27, 0x52, 0xc7, 0x48, 0x26, 0xd2, 0x29, 0xce, 0x3e, 0x36, 0xf1, 0x6e, 0xde, 0x03, 0x3c, 0x3d, - 0xa5, 0x7f, 0xee, 0x3c, 0x79, 0xfe, 0xbb, 0xf2, 0xdd, 0xfa, 0x6b, 0x90, 0x27, 0xe1, 0x82, 0x07, - 0xf5, 0xb2, 0xb6, 0x0a, 0xd8, 0xff, 0xe3, 0x48, 0xf7, 0x7c, 0x34, 0x3e, 0x94, 0xd8, 0xe7, 0xf2, - 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xb7, 0x4b, 0x85, 0x35, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// NetworkdClient is the client API for Networkd service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NetworkdClient interface { - Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) - Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) -} - -type networkdClient struct { - cc *grpc.ClientConn -} - -func NewNetworkdClient(cc *grpc.ClientConn) NetworkdClient { - return &networkdClient{cc} -} - -func (c *networkdClient) Routes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RoutesReply, error) { - out := new(RoutesReply) - err := c.cc.Invoke(ctx, "/proto.Networkd/Routes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *networkdClient) Interfaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*InterfacesReply, error) { - out := new(InterfacesReply) - err := c.cc.Invoke(ctx, "/proto.Networkd/Interfaces", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NetworkdServer is the server API for Networkd service. -type NetworkdServer interface { - Routes(context.Context, *empty.Empty) (*RoutesReply, error) - Interfaces(context.Context, *empty.Empty) (*InterfacesReply, error) -} - -func RegisterNetworkdServer(s *grpc.Server, srv NetworkdServer) { - s.RegisterService(&_Networkd_serviceDesc, srv) -} - -func _Networkd_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NetworkdServer).Routes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Networkd/Routes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NetworkdServer).Routes(ctx, req.(*empty.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _Networkd_Interfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NetworkdServer).Interfaces(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Networkd/Interfaces", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NetworkdServer).Interfaces(ctx, req.(*empty.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -var _Networkd_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Networkd", - HandlerType: (*NetworkdServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Routes", - Handler: _Networkd_Routes_Handler, - }, - { - MethodName: "Interfaces", - Handler: _Networkd_Interfaces_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", -} diff --git a/internal/app/ntpd/pkg/reg/reg.go b/internal/app/ntpd/pkg/reg/reg.go index 718c16f4e..cd34d2089 100644 --- a/internal/app/ntpd/pkg/reg/reg.go +++ b/internal/app/ntpd/pkg/reg/reg.go @@ -12,12 +12,12 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/time" + timeapi "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/internal/app/ntpd/pkg/ntp" ) // Registrator is the concrete type that implements the factory.Registrator and -// proto.Init interfaces. +// timeapi.Init interfaces. type Registrator struct { Ntpd *ntp.NTP } @@ -31,12 +31,12 @@ func NewRegistrator(n *ntp.NTP) *Registrator { // Register implements the factory.Registrator interface. func (r *Registrator) Register(s *grpc.Server) { - proto.RegisterNtpdServer(s, r) + timeapi.RegisterTimeServer(s, r) } // Time issues a query to the configured ntp server and displays the results -func (r *Registrator) Time(ctx context.Context, in *empty.Empty) (reply *proto.TimeReply, err error) { - reply = &proto.TimeReply{} +func (r *Registrator) Time(ctx context.Context, in *empty.Empty) (reply *timeapi.TimeReply, err error) { + reply = &timeapi.TimeReply{} rt, err := r.Ntpd.Query() if err != nil { return reply, err @@ -46,8 +46,8 @@ func (r *Registrator) Time(ctx context.Context, in *empty.Empty) (reply *proto.T } // TimeCheck issues a query to the specified ntp server and displays the results -func (r *Registrator) TimeCheck(ctx context.Context, in *proto.TimeRequest) (reply *proto.TimeReply, err error) { - reply = &proto.TimeReply{} +func (r *Registrator) TimeCheck(ctx context.Context, in *timeapi.TimeRequest) (reply *timeapi.TimeReply, err error) { + reply = &timeapi.TimeReply{} tc, err := ntp.NewNTPClient(ntp.WithServer(in.Server)) if err != nil { return reply, err @@ -61,8 +61,8 @@ func (r *Registrator) TimeCheck(ctx context.Context, in *proto.TimeRequest) (rep return genProtobufTimeReply(tc.GetTime(), rt.Time, in.Server) } -func genProtobufTimeReply(local, remote time.Time, server string) (*proto.TimeReply, error) { - reply := &proto.TimeReply{} +func genProtobufTimeReply(local, remote time.Time, server string) (*timeapi.TimeReply, error) { + reply := &timeapi.TimeReply{} localpbts, err := ptypes.TimestampProto(local) if err != nil { @@ -74,7 +74,7 @@ func genProtobufTimeReply(local, remote time.Time, server string) (*proto.TimeRe return reply, err } - reply = &proto.TimeReply{ + reply = &timeapi.TimeReply{ Server: server, Localtime: localpbts, Remotetime: remotepbts, diff --git a/internal/app/ntpd/pkg/reg/reg_test.go b/internal/app/ntpd/pkg/reg/reg_test.go index f171ed06a..1399e496f 100644 --- a/internal/app/ntpd/pkg/reg/reg_test.go +++ b/internal/app/ntpd/pkg/reg/reg_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/time" + timeapi "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/internal/app/ntpd/pkg/ntp" "github.com/talos-systems/talos/pkg/grpc/factory" ) @@ -53,7 +53,7 @@ func (suite *NtpdSuite) TestTime() { conn, err := grpc.Dial(fmt.Sprintf("%s://%s", "unix", listener.Addr().String()), grpc.WithInsecure()) suite.Assert().NoError(err) - nClient := proto.NewNtpdClient(conn) + nClient := timeapi.NewTimeClient(conn) resp, err := nClient.Time(context.Background(), &empty.Empty{}) suite.Assert().NoError(err) @@ -84,9 +84,9 @@ func (suite *NtpdSuite) TestTimeCheck() { conn, err := grpc.Dial(fmt.Sprintf("%s://%s", "unix", listener.Addr().String()), grpc.WithInsecure()) suite.Assert().NoError(err) - nClient := proto.NewNtpdClient(conn) + nClient := timeapi.NewTimeClient(conn) - resp, err := nClient.TimeCheck(context.Background(), &proto.TimeRequest{Server: testServer}) + resp, err := nClient.TimeCheck(context.Background(), &timeapi.TimeRequest{Server: testServer}) suite.Assert().NoError(err) suite.Assert().Equal(resp.Server, testServer) } diff --git a/internal/app/ntpd/proto/api.pb.go b/internal/app/ntpd/proto/api.pb.go deleted file mode 100644 index ba8468d8c..000000000 --- a/internal/app/ntpd/proto/api.pb.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: api.proto - -package proto - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - empty "github.com/golang/protobuf/ptypes/empty" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// The response message containing the ntp server -type TimeRequest struct { - Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TimeRequest) Reset() { *m = TimeRequest{} } -func (m *TimeRequest) String() string { return proto.CompactTextString(m) } -func (*TimeRequest) ProtoMessage() {} -func (*TimeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} - -func (m *TimeRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TimeRequest.Unmarshal(m, b) -} - -func (m *TimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TimeRequest.Marshal(b, m, deterministic) -} - -func (m *TimeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeRequest.Merge(m, src) -} - -func (m *TimeRequest) XXX_Size() int { - return xxx_messageInfo_TimeRequest.Size(m) -} - -func (m *TimeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TimeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeRequest proto.InternalMessageInfo - -func (m *TimeRequest) GetServer() string { - if m != nil { - return m.Server - } - return "" -} - -// The response message containing the ntp server, time, and offset -type TimeReply struct { - Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Localtime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=localtime,proto3" json:"localtime,omitempty"` - Remotetime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=remotetime,proto3" json:"remotetime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TimeReply) Reset() { *m = TimeReply{} } -func (m *TimeReply) String() string { return proto.CompactTextString(m) } -func (*TimeReply) ProtoMessage() {} -func (*TimeReply) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} - -func (m *TimeReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TimeReply.Unmarshal(m, b) -} - -func (m *TimeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TimeReply.Marshal(b, m, deterministic) -} - -func (m *TimeReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeReply.Merge(m, src) -} - -func (m *TimeReply) XXX_Size() int { - return xxx_messageInfo_TimeReply.Size(m) -} - -func (m *TimeReply) XXX_DiscardUnknown() { - xxx_messageInfo_TimeReply.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeReply proto.InternalMessageInfo - -func (m *TimeReply) GetServer() string { - if m != nil { - return m.Server - } - return "" -} - -func (m *TimeReply) GetLocaltime() *timestamp.Timestamp { - if m != nil { - return m.Localtime - } - return nil -} - -func (m *TimeReply) GetRemotetime() *timestamp.Timestamp { - if m != nil { - return m.Remotetime - } - return nil -} - -func init() { - proto.RegisterType((*TimeRequest)(nil), "proto.TimeRequest") - proto.RegisterType((*TimeReply)(nil), "proto.TimeReply") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x52, 0xd2, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, - 0xa9, 0xfa, 0x60, 0x5e, 0x52, 0x69, 0x9a, 0x7e, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, 0x8d, 0x94, - 0x3c, 0xba, 0x64, 0x49, 0x66, 0x6e, 0x6a, 0x71, 0x49, 0x62, 0x6e, 0x01, 0x44, 0x81, 0x92, 0x2a, - 0x17, 0x77, 0x48, 0x66, 0x6e, 0x6a, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x90, 0x18, 0x17, - 0x5b, 0x71, 0x6a, 0x51, 0x59, 0x6a, 0x91, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x94, 0xa7, - 0x34, 0x93, 0x91, 0x8b, 0x13, 0xa2, 0xae, 0x20, 0xa7, 0x12, 0x97, 0x2a, 0x21, 0x0b, 0x2e, 0xce, - 0x9c, 0xfc, 0xe4, 0xc4, 0x1c, 0x90, 0x25, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x52, 0x7a, - 0x10, 0x17, 0xe8, 0xc1, 0x5c, 0xa0, 0x17, 0x02, 0x73, 0x41, 0x10, 0x42, 0xb1, 0x90, 0x15, 0x17, - 0x57, 0x51, 0x6a, 0x6e, 0x7e, 0x49, 0x2a, 0x58, 0x2b, 0x33, 0x41, 0xad, 0x48, 0xaa, 0x8d, 0xb2, - 0xb9, 0x58, 0xfc, 0x4a, 0x0a, 0x52, 0x84, 0x0c, 0xb8, 0x58, 0x40, 0x0a, 0x84, 0xc4, 0x30, 0xf4, - 0xb9, 0x82, 0x42, 0x44, 0x4a, 0x00, 0x22, 0xa0, 0x87, 0xf0, 0x87, 0x21, 0xc4, 0x53, 0xce, 0x19, - 0xa9, 0xc9, 0xd9, 0x42, 0x42, 0x28, 0xd2, 0xe0, 0xe0, 0xc0, 0xd4, 0xe2, 0x24, 0xc7, 0xc5, 0x99, - 0x9c, 0x9f, 0x0b, 0x11, 0x76, 0xe2, 0x70, 0x2c, 0xc8, 0x0c, 0x00, 0xb1, 0x02, 0x18, 0xa3, 0x20, - 0xb1, 0x91, 0xc4, 0x06, 0xa6, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0xd1, 0xa5, 0x14, - 0xa8, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// NtpdClient is the client API for Ntpd service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NtpdClient interface { - Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) - TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) -} - -type ntpdClient struct { - cc *grpc.ClientConn -} - -func NewNtpdClient(cc *grpc.ClientConn) NtpdClient { - return &ntpdClient{cc} -} - -func (c *ntpdClient) Time(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*TimeReply, error) { - out := new(TimeReply) - err := c.cc.Invoke(ctx, "/proto.Ntpd/Time", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ntpdClient) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeReply, error) { - out := new(TimeReply) - err := c.cc.Invoke(ctx, "/proto.Ntpd/TimeCheck", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NtpdServer is the server API for Ntpd service. -type NtpdServer interface { - Time(context.Context, *empty.Empty) (*TimeReply, error) - TimeCheck(context.Context, *TimeRequest) (*TimeReply, error) -} - -func RegisterNtpdServer(s *grpc.Server, srv NtpdServer) { - s.RegisterService(&_Ntpd_serviceDesc, srv) -} - -func _Ntpd_Time_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NtpdServer).Time(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Ntpd/Time", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NtpdServer).Time(ctx, req.(*empty.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _Ntpd_TimeCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TimeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NtpdServer).TimeCheck(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Ntpd/TimeCheck", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NtpdServer).TimeCheck(ctx, req.(*TimeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Ntpd_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Ntpd", - HandlerType: (*NtpdServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Time", - Handler: _Ntpd_Time_Handler, - }, - { - MethodName: "TimeCheck", - Handler: _Ntpd_TimeCheck_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", -} diff --git a/internal/app/osd/internal/reg/init_client.go b/internal/app/osd/internal/reg/init_client.go deleted file mode 100644 index 8e0fd33ab..000000000 --- a/internal/app/osd/internal/reg/init_client.go +++ /dev/null @@ -1,134 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package reg - -import ( - "context" - "io" - - "github.com/golang/protobuf/ptypes/empty" - "google.golang.org/grpc" - - proto "github.com/talos-systems/talos/api/machine" - "github.com/talos-systems/talos/pkg/constants" -) - -// InitServiceClient is a gRPC client for init service API -type InitServiceClient struct { - proto.InitClient -} - -// NewInitServiceClient initializes new client and connects to init -func NewInitServiceClient() (*InitServiceClient, error) { - conn, err := grpc.Dial("unix:"+constants.InitSocketPath, - grpc.WithInsecure(), - ) - if err != nil { - return nil, err - } - - return &InitServiceClient{ - InitClient: proto.NewInitClient(conn), - }, nil -} - -// Reboot executes init Reboot() API -func (c *InitServiceClient) Reboot(ctx context.Context, in *empty.Empty) (*proto.RebootReply, error) { - return c.InitClient.Reboot(ctx, in) -} - -// Shutdown executes init Shutdown() API. -func (c *InitServiceClient) Shutdown(ctx context.Context, in *empty.Empty) (*proto.ShutdownReply, error) { - return c.InitClient.Shutdown(ctx, in) -} - -// Upgrade executes the init Upgrade() API. -func (c *InitServiceClient) Upgrade(ctx context.Context, in *proto.UpgradeRequest) (data *proto.UpgradeReply, err error) { - return c.InitClient.Upgrade(ctx, in) -} - -// Reset executes the init Reset() API. -func (c *InitServiceClient) Reset(ctx context.Context, in *empty.Empty) (data *proto.ResetReply, err error) { - return c.InitClient.Reset(ctx, in) -} - -// ServiceStart executes the init ServiceStart() API. -func (c *InitServiceClient) ServiceStart(ctx context.Context, in *proto.ServiceStartRequest) (data *proto.ServiceStartReply, err error) { - return c.InitClient.ServiceStart(ctx, in) -} - -// ServiceStop executes the init ServiceStop() API. -func (c *InitServiceClient) ServiceStop(ctx context.Context, in *proto.ServiceStopRequest) (data *proto.ServiceStopReply, err error) { - return c.InitClient.ServiceStop(ctx, in) -} - -// ServiceRestart executes the init ServiceRestart() API. -func (c *InitServiceClient) ServiceRestart(ctx context.Context, in *proto.ServiceRestartRequest) (data *proto.ServiceRestartReply, err error) { - return c.InitClient.ServiceRestart(ctx, in) -} - -// Start executes the init Start() API (deprecated). -//nolint: staticcheck -func (c *InitServiceClient) Start(ctx context.Context, in *proto.StartRequest) (data *proto.StartReply, err error) { - return c.InitClient.Start(ctx, in) -} - -// Stop executes the init Stop() API (deprecated). -//nolint: staticcheck -func (c *InitServiceClient) Stop(ctx context.Context, in *proto.StopRequest) (data *proto.StopReply, err error) { - return c.InitClient.Stop(ctx, in) -} - -// ServiceList executes the init ServiceList() API. -func (c *InitServiceClient) ServiceList(ctx context.Context, in *empty.Empty) (data *proto.ServiceListReply, err error) { - return c.InitClient.ServiceList(ctx, in) -} - -func copyClientServer(msg interface{}, client grpc.ClientStream, srv grpc.ServerStream) error { - for { - err := client.RecvMsg(msg) - if err == io.EOF { - break - } - if err != nil { - return err - } - err = srv.SendMsg(msg) - if err != nil { - return err - } - } - - return nil -} - -// CopyOut executes the init CopyOut() API. -func (c *InitServiceClient) CopyOut(req *proto.CopyOutRequest, srv proto.Init_CopyOutServer) error { - client, err := c.InitClient.CopyOut(srv.Context(), req) - if err != nil { - return err - } - - var msg proto.StreamingData - - return copyClientServer(&msg, client, srv) -} - -// LS executes the init LS() API. -func (c *InitServiceClient) LS(req *proto.LSRequest, srv proto.Init_LSServer) error { - client, err := c.InitClient.LS(srv.Context(), req) - if err != nil { - return err - } - - var msg proto.FileInfo - - return copyClientServer(&msg, client, srv) -} - -// DF implements the proto.OSDServer interface. -func (c *InitServiceClient) DF(ctx context.Context, in *empty.Empty) (reply *proto.DFReply, err error) { - return c.InitClient.DF(ctx, in) -} diff --git a/internal/app/osd/internal/reg/machine_client.go b/internal/app/osd/internal/reg/machine_client.go new file mode 100644 index 000000000..8d8106d0b --- /dev/null +++ b/internal/app/osd/internal/reg/machine_client.go @@ -0,0 +1,134 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package reg + +import ( + "context" + "io" + + "github.com/golang/protobuf/ptypes/empty" + "google.golang.org/grpc" + + machineapi "github.com/talos-systems/talos/api/machine" + "github.com/talos-systems/talos/pkg/constants" +) + +// MachineClient is a gRPC client for init service API +type MachineClient struct { + machineapi.MachineClient +} + +// NewMachineClient initializes new client and connects to init +func NewMachineClient() (*MachineClient, error) { + conn, err := grpc.Dial("unix:"+constants.InitSocketPath, + grpc.WithInsecure(), + ) + if err != nil { + return nil, err + } + + return &MachineClient{ + MachineClient: machineapi.NewMachineClient(conn), + }, nil +} + +// Reboot executes init Reboot() API +func (c *MachineClient) Reboot(ctx context.Context, in *empty.Empty) (*machineapi.RebootReply, error) { + return c.MachineClient.Reboot(ctx, in) +} + +// Shutdown executes init Shutdown() API. +func (c *MachineClient) Shutdown(ctx context.Context, in *empty.Empty) (*machineapi.ShutdownReply, error) { + return c.MachineClient.Shutdown(ctx, in) +} + +// Upgrade executes the init Upgrade() API. +func (c *MachineClient) Upgrade(ctx context.Context, in *machineapi.UpgradeRequest) (data *machineapi.UpgradeReply, err error) { + return c.MachineClient.Upgrade(ctx, in) +} + +// Reset executes the init Reset() API. +func (c *MachineClient) Reset(ctx context.Context, in *empty.Empty) (data *machineapi.ResetReply, err error) { + return c.MachineClient.Reset(ctx, in) +} + +// ServiceStart executes the init ServiceStart() API. +func (c *MachineClient) ServiceStart(ctx context.Context, in *machineapi.ServiceStartRequest) (data *machineapi.ServiceStartReply, err error) { + return c.MachineClient.ServiceStart(ctx, in) +} + +// ServiceStop executes the init ServiceStop() API. +func (c *MachineClient) ServiceStop(ctx context.Context, in *machineapi.ServiceStopRequest) (data *machineapi.ServiceStopReply, err error) { + return c.MachineClient.ServiceStop(ctx, in) +} + +// ServiceRestart executes the init ServiceRestart() API. +func (c *MachineClient) ServiceRestart(ctx context.Context, in *machineapi.ServiceRestartRequest) (data *machineapi.ServiceRestartReply, err error) { + return c.MachineClient.ServiceRestart(ctx, in) +} + +// Start executes the init Start() API (deprecated). +//nolint: staticcheck +func (c *MachineClient) Start(ctx context.Context, in *machineapi.StartRequest) (data *machineapi.StartReply, err error) { + return c.MachineClient.Start(ctx, in) +} + +// Stop executes the init Stop() API (deprecated). +//nolint: staticcheck +func (c *MachineClient) Stop(ctx context.Context, in *machineapi.StopRequest) (data *machineapi.StopReply, err error) { + return c.MachineClient.Stop(ctx, in) +} + +// ServiceList executes the init ServiceList() API. +func (c *MachineClient) ServiceList(ctx context.Context, in *empty.Empty) (data *machineapi.ServiceListReply, err error) { + return c.MachineClient.ServiceList(ctx, in) +} + +func copyClientServer(msg interface{}, client grpc.ClientStream, srv grpc.ServerStream) error { + for { + err := client.RecvMsg(msg) + if err == io.EOF { + break + } + if err != nil { + return err + } + err = srv.SendMsg(msg) + if err != nil { + return err + } + } + + return nil +} + +// CopyOut executes the init CopyOut() API. +func (c *MachineClient) CopyOut(req *machineapi.CopyOutRequest, srv machineapi.Machine_CopyOutServer) error { + client, err := c.MachineClient.CopyOut(srv.Context(), req) + if err != nil { + return err + } + + var msg machineapi.StreamingData + + return copyClientServer(&msg, client, srv) +} + +// LS executes the init LS() API. +func (c *MachineClient) LS(req *machineapi.LSRequest, srv machineapi.Machine_LSServer) error { + client, err := c.MachineClient.LS(srv.Context(), req) + if err != nil { + return err + } + + var msg machineapi.FileInfo + + return copyClientServer(&msg, client, srv) +} + +// Mounts implements the machineapi.OSDServer interface. +func (c *MachineClient) Mounts(ctx context.Context, in *empty.Empty) (reply *machineapi.MountsReply, err error) { + return c.MachineClient.Mounts(ctx, in) +} diff --git a/internal/app/osd/internal/reg/network_client.go b/internal/app/osd/internal/reg/network_client.go new file mode 100644 index 000000000..23cc895fe --- /dev/null +++ b/internal/app/osd/internal/reg/network_client.go @@ -0,0 +1,44 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package reg // nolint: dupl + +import ( + "context" + + "github.com/golang/protobuf/ptypes/empty" + "google.golang.org/grpc" + + networkapi "github.com/talos-systems/talos/api/network" + "github.com/talos-systems/talos/pkg/constants" +) + +// NetworkClient is a gRPC client for init service API +type NetworkClient struct { + networkapi.NetworkClient +} + +// NewNetworkClient initializes new client and connects to networkd +func NewNetworkClient() (*NetworkClient, error) { + conn, err := grpc.Dial("unix:"+constants.NetworkdSocketPath, + grpc.WithInsecure(), + ) + if err != nil { + return nil, err + } + + return &NetworkClient{ + NetworkClient: networkapi.NewNetworkClient(conn), + }, nil +} + +// Routes returns the hosts routing table. +func (c *NetworkClient) Routes(ctx context.Context, in *empty.Empty) (*networkapi.RoutesReply, error) { + return c.NetworkClient.Routes(ctx, in) +} + +// Interfaces returns the hosts network interfaces and addresses. +func (c *NetworkClient) Interfaces(ctx context.Context, in *empty.Empty) (*networkapi.InterfacesReply, error) { + return c.NetworkClient.Interfaces(ctx, in) +} diff --git a/internal/app/osd/internal/reg/networkd_client.go b/internal/app/osd/internal/reg/networkd_client.go deleted file mode 100644 index f1552584b..000000000 --- a/internal/app/osd/internal/reg/networkd_client.go +++ /dev/null @@ -1,44 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package reg // nolint: dupl - -import ( - "context" - - "github.com/golang/protobuf/ptypes/empty" - "google.golang.org/grpc" - - proto "github.com/talos-systems/talos/api/network" - "github.com/talos-systems/talos/pkg/constants" -) - -// NetworkdClient is a gRPC client for init service API -type NetworkdClient struct { - proto.NetworkdClient -} - -// NewNetworkdClient initializes new client and connects to networkd -func NewNetworkdClient() (*NetworkdClient, error) { - conn, err := grpc.Dial("unix:"+constants.NetworkdSocketPath, - grpc.WithInsecure(), - ) - if err != nil { - return nil, err - } - - return &NetworkdClient{ - NetworkdClient: proto.NewNetworkdClient(conn), - }, nil -} - -// Routes returns the hosts routing table. -func (c *NetworkdClient) Routes(ctx context.Context, in *empty.Empty) (*proto.RoutesReply, error) { - return c.NetworkdClient.Routes(ctx, in) -} - -// Interfaces returns the hosts network interfaces and addresses. -func (c *NetworkdClient) Interfaces(ctx context.Context, in *empty.Empty) (*proto.InterfacesReply, error) { - return c.NetworkdClient.Interfaces(ctx, in) -} diff --git a/internal/app/osd/internal/reg/reg.go b/internal/app/osd/internal/reg/reg.go index 5540d4681..6547ad66d 100644 --- a/internal/app/osd/internal/reg/reg.go +++ b/internal/app/osd/internal/reg/reg.go @@ -40,19 +40,19 @@ import ( // osapi.OSDServer interfaces. type Registrator struct { // every Init service API is proxied via OSD - *InitServiceClient - *NtpdClient - *NetworkdClient + *MachineClient + *TimeClient + *NetworkClient Data *userdata.UserData } // Register implements the factory.Registrator interface. func (r *Registrator) Register(s *grpc.Server) { - osapi.RegisterOSDServer(s, r) - machineapi.RegisterInitServer(s, r) - timeapi.RegisterNtpdServer(s, r) - networkapi.RegisterNetworkdServer(s, r) + osapi.RegisterOSServer(s, r) + machineapi.RegisterMachineServer(s, r) + timeapi.RegisterTimeServer(s, r) + networkapi.RegisterNetworkServer(s, r) } // Kubeconfig implements the osapi.OSDServer interface. The admin kubeconfig is @@ -70,8 +70,8 @@ func (r *Registrator) Kubeconfig(ctx context.Context, in *empty.Empty) (data *os return data, err } -// Processes implements the osapi.OSDServer interface. -func (r *Registrator) Processes(ctx context.Context, in *osapi.ProcessesRequest) (reply *osapi.ProcessesReply, err error) { +// Containers implements the osapi.OSDServer interface. +func (r *Registrator) Containers(ctx context.Context, in *osapi.ContainersRequest) (reply *osapi.ContainersReply, err error) { inspector, err := getContainerInspector(ctx, in.Namespace, in.Driver) if err != nil { return nil, err @@ -89,11 +89,11 @@ func (r *Registrator) Processes(ctx context.Context, in *osapi.ProcessesRequest) log.Println(err.Error()) } - processes := []*osapi.Process{} + containers := []*osapi.Container{} for _, pod := range pods { for _, container := range pod.Containers { - process := &osapi.Process{ + container := &osapi.Container{ Namespace: in.Namespace, Id: container.Display, PodId: pod.Name, @@ -102,11 +102,11 @@ func (r *Registrator) Processes(ctx context.Context, in *osapi.ProcessesRequest) Pid: container.Pid, Status: container.Status, } - processes = append(processes, process) + containers = append(containers, container) } } - return &osapi.ProcessesReply{Processes: processes}, nil + return &osapi.ContainersReply{Containers: containers}, nil } // Stats implements the osapi.OSDServer interface. @@ -206,7 +206,7 @@ func (r *Registrator) Dmesg(ctx context.Context, in *empty.Empty) (data *osapi.D // Logs implements the osapi.OSDServer interface. Service or container logs can // be requested and the contents of the log file are streamed in chunks. // nolint: gocyclo -func (r *Registrator) Logs(req *osapi.LogsRequest, l osapi.OSD_LogsServer) (err error) { +func (r *Registrator) Logs(req *osapi.LogsRequest, l osapi.OS_LogsServer) (err error) { var chunk chunker.Chunker switch { @@ -241,11 +241,11 @@ func (r *Registrator) Logs(req *osapi.LogsRequest, l osapi.OSD_LogsServer) (err // Version implements the osapi.OSDServer interface. func (r *Registrator) Version(ctx context.Context, in *empty.Empty) (reply *machineapi.VersionReply, err error) { - return r.InitClient.Version(ctx, in) + return r.MachineClient.Version(ctx, in) } -// Top implements the osapi.OSDServer interface -func (r *Registrator) Top(ctx context.Context, in *empty.Empty) (reply *osapi.TopReply, err error) { +// Processes implements the osapi.OSDServer interface +func (r *Registrator) Processes(ctx context.Context, in *empty.Empty) (reply *osapi.ProcessesReply, err error) { var procs []proc.ProcessList procs, err = proc.List() if err != nil { @@ -260,7 +260,7 @@ func (r *Registrator) Top(ctx context.Context, in *empty.Empty) (reply *osapi.To } p := &osapi.ProcessList{Bytes: plist.Bytes()} - reply = &osapi.TopReply{ProcessList: p} + reply = &osapi.ProcessesReply{ProcessList: p} return } diff --git a/internal/app/osd/internal/reg/ntp_client.go b/internal/app/osd/internal/reg/time_client.go similarity index 53% rename from internal/app/osd/internal/reg/ntp_client.go rename to internal/app/osd/internal/reg/time_client.go index 79cea0bbc..970058c24 100644 --- a/internal/app/osd/internal/reg/ntp_client.go +++ b/internal/app/osd/internal/reg/time_client.go @@ -10,17 +10,17 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/time" + timeapi "github.com/talos-systems/talos/api/time" "github.com/talos-systems/talos/pkg/constants" ) -// NtpdClient is a gRPC client for init service API -type NtpdClient struct { - proto.NtpdClient +// TimeClient is a gRPC client for init service API +type TimeClient struct { + timeapi.TimeClient } -// NewNtpdClient initializes new client and connects to ntpd -func NewNtpdClient() (*NtpdClient, error) { +// NewTimeClient initializes new client and connects to ntpd +func NewTimeClient() (*TimeClient, error) { conn, err := grpc.Dial("unix:"+constants.NtpdSocketPath, grpc.WithInsecure(), ) @@ -28,17 +28,17 @@ func NewNtpdClient() (*NtpdClient, error) { return nil, err } - return &NtpdClient{ - NtpdClient: proto.NewNtpdClient(conn), + return &TimeClient{ + TimeClient: timeapi.NewTimeClient(conn), }, nil } // Time issues a query to the configured ntp server and displays the results -func (c *NtpdClient) Time(ctx context.Context, in *empty.Empty) (*proto.TimeReply, error) { - return c.NtpdClient.Time(ctx, in) +func (c *TimeClient) Time(ctx context.Context, in *empty.Empty) (*timeapi.TimeReply, error) { + return c.TimeClient.Time(ctx, in) } // TimeCheck issues a query to the specified ntp server and displays the results -func (c *NtpdClient) TimeCheck(ctx context.Context, in *proto.TimeRequest) (*proto.TimeReply, error) { - return c.NtpdClient.TimeCheck(ctx, in) +func (c *TimeClient) TimeCheck(ctx context.Context, in *timeapi.TimeRequest) (*timeapi.TimeReply, error) { + return c.TimeClient.TimeCheck(ctx, in) } diff --git a/internal/app/osd/main.go b/internal/app/osd/main.go index 0a3d7893a..acae59581 100644 --- a/internal/app/osd/main.go +++ b/internal/app/osd/main.go @@ -50,17 +50,17 @@ func main() { log.Fatalf("failed to create OS-level TLS configuration: %v", err) } - initClient, err := reg.NewInitServiceClient() + MachineClient, err := reg.NewMachineClient() if err != nil { log.Fatalf("init client: %v", err) } - ntpdClient, err := reg.NewNtpdClient() + TimeClient, err := reg.NewTimeClient() if err != nil { log.Fatalf("ntp client: %v", err) } - networkdClient, err := reg.NewNetworkdClient() + NetworkClient, err := reg.NewNetworkClient() if err != nil { log.Fatalf("networkd client: %v", err) } @@ -68,10 +68,10 @@ func main() { log.Println("Starting osd") err = factory.ListenAndServe( ®.Registrator{ - Data: data, - InitServiceClient: initClient, - NtpdClient: ntpdClient, - NetworkdClient: networkdClient, + Data: data, + MachineClient: MachineClient, + TimeClient: TimeClient, + NetworkClient: NetworkClient, }, factory.Port(constants.OsdPort), factory.ServerOptions( diff --git a/internal/app/proxyd/internal/reg/reg.go b/internal/app/proxyd/internal/reg/reg.go index 1031fa4b6..f797906a1 100644 --- a/internal/app/proxyd/internal/reg/reg.go +++ b/internal/app/proxyd/internal/reg/reg.go @@ -15,7 +15,7 @@ import ( ) // Registrator is the concrete type that implements the factory.Registrator and -// proto.Init interfaces. +// proto.ProxydServer interfaces. type Registrator struct { Proxyd *frontend.ReverseProxy } diff --git a/internal/app/trustd/internal/reg/reg.go b/internal/app/trustd/internal/reg/reg.go index b7fba9827..1f261c0ff 100644 --- a/internal/app/trustd/internal/reg/reg.go +++ b/internal/app/trustd/internal/reg/reg.go @@ -13,24 +13,24 @@ import ( "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/security" + securityapi "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/pkg/crypto/x509" "github.com/talos-systems/talos/pkg/userdata" ) // Registrator is the concrete type that implements the factory.Registrator and -// proto.TrustdServer interfaces. +// securityapi.SecurityServer interfaces. type Registrator struct { Data *userdata.OSSecurity } // Register implements the factory.Registrator interface. func (r *Registrator) Register(s *grpc.Server) { - proto.RegisterTrustdServer(s, r) + securityapi.RegisterSecurityServer(s, r) } -// Certificate implements the proto.TrustdServer interface. -func (r *Registrator) Certificate(ctx context.Context, in *proto.CertificateRequest) (resp *proto.CertificateResponse, err error) { +// Certificate implements the securityapi.SecurityServer interface. +func (r *Registrator) Certificate(ctx context.Context, in *securityapi.CertificateRequest) (resp *securityapi.CertificateResponse, err error) { // TODO: Verify that the request is coming from the IP addresss declared in // the CSR. signed, err := x509.NewCertificateFromCSRBytes(r.Data.CA.Crt, r.Data.CA.Key, in.Csr) @@ -38,7 +38,7 @@ func (r *Registrator) Certificate(ctx context.Context, in *proto.CertificateRequ return } - resp = &proto.CertificateResponse{ + resp = &securityapi.CertificateResponse{ Ca: r.Data.CA.Crt, Crt: signed.X509CertificatePEM, } @@ -46,21 +46,21 @@ func (r *Registrator) Certificate(ctx context.Context, in *proto.CertificateRequ return resp, nil } -// ReadFile implements the proto.TrustdServer interface. -func (r *Registrator) ReadFile(ctx context.Context, in *proto.ReadFileRequest) (resp *proto.ReadFileResponse, err error) { +// ReadFile implements the securityapi.SecurityServer interface. +func (r *Registrator) ReadFile(ctx context.Context, in *securityapi.ReadFileRequest) (resp *securityapi.ReadFileResponse, err error) { var b []byte if b, err = ioutil.ReadFile(in.Path); err != nil { return nil, err } log.Printf("read file on disk: %s", in.Path) - resp = &proto.ReadFileResponse{Data: b} + resp = &securityapi.ReadFileResponse{Data: b} return resp, nil } -// WriteFile implements the proto.TrustdServer interface. -func (r *Registrator) WriteFile(ctx context.Context, in *proto.WriteFileRequest) (resp *proto.WriteFileResponse, err error) { +// WriteFile implements the securityapi.SecurityServer interface. +func (r *Registrator) WriteFile(ctx context.Context, in *securityapi.WriteFileRequest) (resp *securityapi.WriteFileResponse, err error) { if err = os.MkdirAll(path.Dir(in.Path), os.ModeDir); err != nil { return } @@ -69,7 +69,7 @@ func (r *Registrator) WriteFile(ctx context.Context, in *proto.WriteFileRequest) } log.Printf("wrote file to disk: %s", in.Path) - resp = &proto.WriteFileResponse{} + resp = &securityapi.WriteFileResponse{} return resp, nil } diff --git a/internal/app/trustd/proto/api.pb.go b/internal/app/trustd/proto/api.pb.go deleted file mode 100644 index 6ee4dbabd..000000000 --- a/internal/app/trustd/proto/api.pb.go +++ /dev/null @@ -1,475 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: api.proto - -package proto - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// The request message containing the process name. -type CertificateRequest struct { - Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CertificateRequest) Reset() { *m = CertificateRequest{} } -func (m *CertificateRequest) String() string { return proto.CompactTextString(m) } -func (*CertificateRequest) ProtoMessage() {} -func (*CertificateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} - -func (m *CertificateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CertificateRequest.Unmarshal(m, b) -} - -func (m *CertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CertificateRequest.Marshal(b, m, deterministic) -} - -func (m *CertificateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CertificateRequest.Merge(m, src) -} - -func (m *CertificateRequest) XXX_Size() int { - return xxx_messageInfo_CertificateRequest.Size(m) -} - -func (m *CertificateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CertificateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CertificateRequest proto.InternalMessageInfo - -func (m *CertificateRequest) GetCsr() []byte { - if m != nil { - return m.Csr - } - return nil -} - -// The response message containing the requested logs. -type CertificateResponse struct { - Ca []byte `protobuf:"bytes,1,opt,name=ca,proto3" json:"ca,omitempty"` - Crt []byte `protobuf:"bytes,2,opt,name=crt,proto3" json:"crt,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CertificateResponse) Reset() { *m = CertificateResponse{} } -func (m *CertificateResponse) String() string { return proto.CompactTextString(m) } -func (*CertificateResponse) ProtoMessage() {} -func (*CertificateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} - -func (m *CertificateResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CertificateResponse.Unmarshal(m, b) -} - -func (m *CertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CertificateResponse.Marshal(b, m, deterministic) -} - -func (m *CertificateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CertificateResponse.Merge(m, src) -} - -func (m *CertificateResponse) XXX_Size() int { - return xxx_messageInfo_CertificateResponse.Size(m) -} - -func (m *CertificateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CertificateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CertificateResponse proto.InternalMessageInfo - -func (m *CertificateResponse) GetCa() []byte { - if m != nil { - return m.Ca - } - return nil -} - -func (m *CertificateResponse) GetCrt() []byte { - if m != nil { - return m.Crt - } - return nil -} - -// The request message for reading a file on disk. -type ReadFileRequest struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReadFileRequest) Reset() { *m = ReadFileRequest{} } -func (m *ReadFileRequest) String() string { return proto.CompactTextString(m) } -func (*ReadFileRequest) ProtoMessage() {} -func (*ReadFileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} -} - -func (m *ReadFileRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadFileRequest.Unmarshal(m, b) -} - -func (m *ReadFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadFileRequest.Marshal(b, m, deterministic) -} - -func (m *ReadFileRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadFileRequest.Merge(m, src) -} - -func (m *ReadFileRequest) XXX_Size() int { - return xxx_messageInfo_ReadFileRequest.Size(m) -} - -func (m *ReadFileRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadFileRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadFileRequest proto.InternalMessageInfo - -func (m *ReadFileRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -// The response message for reading a file on disk. -type ReadFileResponse struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReadFileResponse) Reset() { *m = ReadFileResponse{} } -func (m *ReadFileResponse) String() string { return proto.CompactTextString(m) } -func (*ReadFileResponse) ProtoMessage() {} -func (*ReadFileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} -} - -func (m *ReadFileResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadFileResponse.Unmarshal(m, b) -} - -func (m *ReadFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadFileResponse.Marshal(b, m, deterministic) -} - -func (m *ReadFileResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadFileResponse.Merge(m, src) -} - -func (m *ReadFileResponse) XXX_Size() int { - return xxx_messageInfo_ReadFileResponse.Size(m) -} - -func (m *ReadFileResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReadFileResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadFileResponse proto.InternalMessageInfo - -func (m *ReadFileResponse) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// The request message containing the process name. -type WriteFileRequest struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Perm int32 `protobuf:"varint,3,opt,name=perm,proto3" json:"perm,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteFileRequest) Reset() { *m = WriteFileRequest{} } -func (m *WriteFileRequest) String() string { return proto.CompactTextString(m) } -func (*WriteFileRequest) ProtoMessage() {} -func (*WriteFileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} -} - -func (m *WriteFileRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteFileRequest.Unmarshal(m, b) -} - -func (m *WriteFileRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteFileRequest.Marshal(b, m, deterministic) -} - -func (m *WriteFileRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteFileRequest.Merge(m, src) -} - -func (m *WriteFileRequest) XXX_Size() int { - return xxx_messageInfo_WriteFileRequest.Size(m) -} - -func (m *WriteFileRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteFileRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteFileRequest proto.InternalMessageInfo - -func (m *WriteFileRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *WriteFileRequest) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *WriteFileRequest) GetPerm() int32 { - if m != nil { - return m.Perm - } - return 0 -} - -// The response message containing the requested logs. -type WriteFileResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteFileResponse) Reset() { *m = WriteFileResponse{} } -func (m *WriteFileResponse) String() string { return proto.CompactTextString(m) } -func (*WriteFileResponse) ProtoMessage() {} -func (*WriteFileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} -} - -func (m *WriteFileResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteFileResponse.Unmarshal(m, b) -} - -func (m *WriteFileResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteFileResponse.Marshal(b, m, deterministic) -} - -func (m *WriteFileResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteFileResponse.Merge(m, src) -} - -func (m *WriteFileResponse) XXX_Size() int { - return xxx_messageInfo_WriteFileResponse.Size(m) -} - -func (m *WriteFileResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WriteFileResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteFileResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*CertificateRequest)(nil), "proto.CertificateRequest") - proto.RegisterType((*CertificateResponse)(nil), "proto.CertificateResponse") - proto.RegisterType((*ReadFileRequest)(nil), "proto.ReadFileRequest") - proto.RegisterType((*ReadFileResponse)(nil), "proto.ReadFileResponse") - proto.RegisterType((*WriteFileRequest)(nil), "proto.WriteFileRequest") - proto.RegisterType((*WriteFileResponse)(nil), "proto.WriteFileResponse") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4f, 0x4b, 0xc3, 0x40, - 0x10, 0xc5, 0x49, 0xfa, 0x87, 0x66, 0x14, 0xad, 0x53, 0xd0, 0x98, 0x83, 0x94, 0x05, 0x4b, 0x4f, - 0x3d, 0xe8, 0xc1, 0x83, 0x20, 0x58, 0xc5, 0xa3, 0x94, 0x45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xd3, 0x4a, 0x71, 0xd2, 0x7a, 0x1e, 0xe1, 0x1b, 0xc8, 0x9a, 0x4f, 0xc4, 0xda, 0xb5, 0x5b, 0x42, - 0x91, 0xb7, 0x17, 0x81, 0x9f, 0x9f, 0x41, 0x26, 0xab, 0x65, 0x58, 0xcf, 0x07, 0xb7, 0x46, 0x2f, - 0xd6, 0x6a, 0x91, 0xbc, 0x84, 0x5f, 0xe0, 0xb5, 0xef, 0xc7, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x59, 0x5a, 0x3f, 0x46, 0x1d, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// TrustdClient is the client API for Trustd service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TrustdClient interface { - Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) - ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) - WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) -} - -type trustdClient struct { - cc *grpc.ClientConn -} - -func NewTrustdClient(cc *grpc.ClientConn) TrustdClient { - return &trustdClient{cc} -} - -func (c *trustdClient) Certificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) { - out := new(CertificateResponse) - err := c.cc.Invoke(ctx, "/proto.Trustd/Certificate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trustdClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) { - out := new(ReadFileResponse) - err := c.cc.Invoke(ctx, "/proto.Trustd/ReadFile", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trustdClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) { - out := new(WriteFileResponse) - err := c.cc.Invoke(ctx, "/proto.Trustd/WriteFile", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TrustdServer is the server API for Trustd service. -type TrustdServer interface { - Certificate(context.Context, *CertificateRequest) (*CertificateResponse, error) - ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) - WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) -} - -func RegisterTrustdServer(s *grpc.Server, srv TrustdServer) { - s.RegisterService(&_Trustd_serviceDesc, srv) -} - -func _Trustd_Certificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CertificateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrustdServer).Certificate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Trustd/Certificate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrustdServer).Certificate(ctx, req.(*CertificateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Trustd_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReadFileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrustdServer).ReadFile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Trustd/ReadFile", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrustdServer).ReadFile(ctx, req.(*ReadFileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Trustd_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WriteFileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrustdServer).WriteFile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/proto.Trustd/WriteFile", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrustdServer).WriteFile(ctx, req.(*WriteFileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Trustd_serviceDesc = grpc.ServiceDesc{ - ServiceName: "proto.Trustd", - HandlerType: (*TrustdServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Certificate", - Handler: _Trustd_Certificate_Handler, - }, - { - MethodName: "ReadFile", - Handler: _Trustd_ReadFile_Handler, - }, - { - MethodName: "WriteFile", - Handler: _Trustd_WriteFile_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", -} diff --git a/pkg/grpc/gen/gen.go b/pkg/grpc/gen/gen.go index 09da6c3a3..beb9887fe 100644 --- a/pkg/grpc/gen/gen.go +++ b/pkg/grpc/gen/gen.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/go-multierror" "google.golang.org/grpc" - proto "github.com/talos-systems/talos/api/security" + securityapi "github.com/talos-systems/talos/api/security" "github.com/talos-systems/talos/pkg/crypto/x509" "github.com/talos-systems/talos/pkg/grpc/middleware/auth/basic" "github.com/talos-systems/talos/pkg/userdata" @@ -21,7 +21,7 @@ import ( // Generator represents the OS identity generator. type Generator struct { - client proto.TrustdClient + client securityapi.SecurityClient } // NewGenerator initializes a Generator with a preconfigured grpc.ClientConn. @@ -45,7 +45,7 @@ func NewGenerator(data *userdata.UserData, port int) (g *Generator, err error) { // Unable to connect, bail and attempt to contact next endpoint continue } - client := proto.NewTrustdClient(conn) + client := securityapi.NewSecurityClient(conn) return &Generator{client: client}, nil } @@ -54,8 +54,8 @@ func NewGenerator(data *userdata.UserData, port int) (g *Generator, err error) { return nil, multiError.ErrorOrNil() } -// Certificate implements the proto.TrustdClient interface. -func (g *Generator) Certificate(in *proto.CertificateRequest) (resp *proto.CertificateResponse, err error) { +// Certificate implements the securityapi.SecurityClient interface. +func (g *Generator) Certificate(in *securityapi.CertificateRequest) (resp *securityapi.CertificateResponse, err error) { ctx := context.Background() resp, err = g.client.Certificate(ctx, in) if err != nil { @@ -76,14 +76,14 @@ func (g *Generator) Identity(data *userdata.UserData) (err error) { if csr, err = data.NewIdentityCSR(); err != nil { return err } - req := &proto.CertificateRequest{ + req := &securityapi.CertificateRequest{ Csr: csr.X509CertificateRequestPEM, } return poll(g, req, data.Security.OS) } -func poll(g *Generator, in *proto.CertificateRequest, data *userdata.OSSecurity) (err error) { +func poll(g *Generator, in *securityapi.CertificateRequest, data *userdata.OSSecurity) (err error) { timeout := time.NewTimer(time.Minute * 5) defer timeout.Stop() tick := time.NewTicker(time.Second * 5)