Svc metadata (#972)

* Added service metadata

* Added metadata to runtime service

* Add Annotations metadata to service metadata

* Add micro/micro as default service owners

* Update runtime/kubernetes/client/kubernetes.go

Change comment

Co-Authored-By: Jake Sanders <i@am.so-aweso.me>
This commit is contained in:
Milos Gajdos
2019-11-22 17:10:00 +00:00
committed by Asim Aslam
parent 8dc3fb964e
commit 38e29c5101
10 changed files with 209 additions and 124 deletions

View File

@@ -30,10 +30,12 @@ type Service struct {
// local path of the source
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
// command to execute
Exec []string `protobuf:"bytes,5,rep,name=exec,proto3" json:"exec,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Exec []string `protobuf:"bytes,5,rep,name=exec,proto3" json:"exec,omitempty"`
// service metadata
Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Service) Reset() { *m = Service{} }
@@ -96,6 +98,13 @@ func (m *Service) GetExec() []string {
return nil
}
func (m *Service) GetMetadata() map[string]string {
if m != nil {
return m.Metadata
}
return nil
}
type CreateOptions struct {
// command to pass in
Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"`
@@ -570,6 +579,7 @@ func (m *ListResponse) GetServices() []*Service {
func init() {
proto.RegisterType((*Service)(nil), "go.micro.runtime.Service")
proto.RegisterMapType((map[string]string)(nil), "go.micro.runtime.Service.MetadataEntry")
proto.RegisterType((*CreateOptions)(nil), "go.micro.runtime.CreateOptions")
proto.RegisterType((*CreateRequest)(nil), "go.micro.runtime.CreateRequest")
proto.RegisterType((*CreateResponse)(nil), "go.micro.runtime.CreateResponse")
@@ -587,32 +597,36 @@ func init() {
func init() { proto.RegisterFile("runtime.proto", fileDescriptor_86e2dd377c869464) }
var fileDescriptor_86e2dd377c869464 = []byte{
// 425 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xc9, 0xcb, 0xd3, 0x40,
0x14, 0xff, 0xda, 0xd4, 0x44, 0x5f, 0x8c, 0x94, 0x39, 0xc8, 0x58, 0x5c, 0xca, 0x1c, 0xc4, 0x53,
0x0e, 0x2d, 0x0a, 0x9e, 0x8d, 0xf4, 0x62, 0x11, 0x52, 0x04, 0xaf, 0x31, 0x7d, 0x68, 0xc0, 0x64,
0x62, 0x66, 0x52, 0xbd, 0x79, 0xf2, 0xff, 0x96, 0xd9, 0xba, 0xa4, 0x93, 0xef, 0xd2, 0xdb, 0xbc,
0xa5, 0xbf, 0xf7, 0x5b, 0x4a, 0x20, 0xe9, 0xfa, 0x46, 0x56, 0x35, 0xa6, 0x6d, 0xc7, 0x25, 0x27,
0xf3, 0xef, 0x3c, 0xad, 0xab, 0xb2, 0xe3, 0xa9, 0xed, 0xb3, 0xdf, 0x10, 0xed, 0xb0, 0x3b, 0x54,
0x25, 0x12, 0x02, 0xb3, 0xa6, 0xa8, 0x91, 0x4e, 0x96, 0x93, 0x37, 0x8f, 0x72, 0xfd, 0x26, 0x14,
0xa2, 0x03, 0x76, 0xa2, 0xe2, 0x0d, 0x9d, 0xea, 0xb6, 0x2b, 0xc9, 0x53, 0x08, 0x05, 0xef, 0xbb,
0x12, 0x69, 0xa0, 0x07, 0xb6, 0x52, 0x28, 0x6d, 0x21, 0x7f, 0xd0, 0x99, 0x41, 0x51, 0x6f, 0xd5,
0xc3, 0x3f, 0x58, 0xd2, 0x07, 0xcb, 0x40, 0xf5, 0xd4, 0x9b, 0xed, 0x20, 0xf9, 0xd0, 0x61, 0x21,
0xf1, 0x73, 0x2b, 0x2b, 0xde, 0x08, 0x75, 0xaa, 0xe4, 0x75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, 0x08, 0x36, 0x28, 0x89, 0x3f, 0x54, 0x07, 0xf4, 0x62, 0x64, 0x7a, 0x44, 0xd9, 0x42, 0x68,
0x0c, 0xf6, 0x91, 0xba, 0x08, 0xd0, 0x47, 0x6a, 0x90, 0x8d, 0x86, 0x33, 0xbe, 0xfa, 0xe0, 0x2e,
0x72, 0xf3, 0xc1, 0x0d, 0x22, 0xb9, 0x23, 0x1b, 0x98, 0xa9, 0x14, 0x88, 0x47, 0xc6, 0x59, 0x58,
0x8b, 0x97, 0x63, 0x63, 0x07, 0xf4, 0x2d, 0xd4, 0xdf, 0xb3, 0xf5, 0xff, 0x00, 0x00, 0x00, 0xff,
0xff, 0x2f, 0x63, 0x84, 0x1c, 0xe0, 0x04, 0x00, 0x00,
// 485 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcb, 0x6f, 0x94, 0x40,
0x18, 0x2f, 0xcb, 0x16, 0xea, 0x87, 0x98, 0xcd, 0xc4, 0x98, 0x71, 0xe3, 0x63, 0xc3, 0x41, 0x7b,
0xe2, 0xb0, 0x8d, 0xc6, 0xc7, 0xb1, 0x34, 0x7b, 0x71, 0x63, 0x42, 0x63, 0xe2, 0x75, 0x64, 0xbf,
0x28, 0xb1, 0x30, 0xc8, 0x0c, 0x1b, 0x7b, 0xf2, 0xe4, 0x1f, 0xed, 0xcd, 0xcc, 0x6b, 0xdb, 0xa5,
0xd0, 0xcb, 0xde, 0xbe, 0x17, 0x3f, 0x7e, 0x0f, 0x02, 0xc4, 0x6d, 0x57, 0xcb, 0xb2, 0xc2, 0xb4,
0x69, 0xb9, 0xe4, 0x64, 0xf6, 0x9d, 0xa7, 0x55, 0x59, 0xb4, 0x3c, 0xb5, 0xf3, 0xe4, 0x9f, 0x07,
0xe1, 0x25, 0xb6, 0xdb, 0xb2, 0x40, 0x42, 0x60, 0x5a, 0xb3, 0x0a, 0xa9, 0xb7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, 0xce, 0x6e,
0x31, 0x63, 0x05, 0x00, 0x00,
}

View File

@@ -21,6 +21,8 @@ message Service {
string path = 4;
// command to execute
repeated string exec = 5;
// service metadata
map<string,string> metadata = 6;
}
message CreateOptions {