From d0ba15c41c2944f63dd423e5140168b5a52a28db Mon Sep 17 00:00:00 2001 From: ilij4 Date: Thu, 3 Oct 2024 13:52:24 +0200 Subject: [PATCH] Private docker image support --- docs/proto/provider.md | 20 + go/manifest/v2beta2/service.pb.go | 504 ++++++++++++++++-- .../akash/manifest/v2beta2/service.proto | 25 + 3 files changed, 499 insertions(+), 50 deletions(-) diff --git a/docs/proto/provider.md b/docs/proto/provider.md index d4ccd4d7..f35127a3 100644 --- a/docs/proto/provider.md +++ b/docs/proto/provider.md @@ -29,6 +29,7 @@ - [akash/manifest/v2beta2/service.proto](#akash/manifest/v2beta2/service.proto) - [Service](#akash.manifest.v2beta2.Service) + - [ServiceImageCredentials](#akash.manifest.v2beta2.ServiceImageCredentials) - [ServiceParams](#akash.manifest.v2beta2.ServiceParams) - [StorageParams](#akash.manifest.v2beta2.StorageParams) @@ -393,6 +394,25 @@ | `count` | [uint32](#uint32) | | | | `expose` | [ServiceExpose](#akash.manifest.v2beta2.ServiceExpose) | repeated | | | `params` | [ServiceParams](#akash.manifest.v2beta2.ServiceParams) | | | + | `credentials` | [ServiceImageCredentials](#akash.manifest.v2beta2.ServiceImageCredentials) | | | + + + + + + + + + ### ServiceImageCredentials + Credentials to fetch image from registry + + + | Field | Type | Label | Description | + | ----- | ---- | ----- | ----------- | + | `host` | [string](#string) | | | + | `email` | [string](#string) | | | + | `username` | [string](#string) | | | + | `password` | [string](#string) | | | diff --git a/go/manifest/v2beta2/service.pb.go b/go/manifest/v2beta2/service.pb.go index 0f49aafb..5bc8fa40 100644 --- a/go/manifest/v2beta2/service.pb.go +++ b/go/manifest/v2beta2/service.pb.go @@ -86,6 +86,74 @@ func (m *StorageParams) GetReadOnly() bool { return false } +// Credentials to fetch image from registry +type ServiceImageCredentials struct { + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host" yaml:"host"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email" yaml:"email"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username" yaml:"username"` + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password" yaml:"password"` +} + +func (m *ServiceImageCredentials) Reset() { *m = ServiceImageCredentials{} } +func (*ServiceImageCredentials) ProtoMessage() {} +func (*ServiceImageCredentials) Descriptor() ([]byte, []int) { + return fileDescriptor_de124a4cb11edaa1, []int{1} +} +func (m *ServiceImageCredentials) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceImageCredentials) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceImageCredentials.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServiceImageCredentials) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceImageCredentials.Merge(m, src) +} +func (m *ServiceImageCredentials) XXX_Size() int { + return m.Size() +} +func (m *ServiceImageCredentials) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceImageCredentials.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceImageCredentials proto.InternalMessageInfo + +func (m *ServiceImageCredentials) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *ServiceImageCredentials) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *ServiceImageCredentials) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *ServiceImageCredentials) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + // ServiceParams type ServiceParams struct { Storage []StorageParams `protobuf:"bytes,1,rep,name=storage,proto3" json:"storage" yaml:"storage"` @@ -94,7 +162,7 @@ type ServiceParams struct { func (m *ServiceParams) Reset() { *m = ServiceParams{} } func (*ServiceParams) ProtoMessage() {} func (*ServiceParams) Descriptor() ([]byte, []int) { - return fileDescriptor_de124a4cb11edaa1, []int{1} + return fileDescriptor_de124a4cb11edaa1, []int{2} } func (m *ServiceParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,21 +200,22 @@ func (m *ServiceParams) GetStorage() []StorageParams { // Service stores name, image, args, env, unit, count and expose list of service type Service struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" yaml:"name"` - Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image" yaml:"image"` - Command []string `protobuf:"bytes,3,rep,name=command,proto3" json:"command" yaml:"command"` - Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args" yaml:"args"` - Env []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env" yaml:"env"` - Resources v1beta3.Resources `protobuf:"bytes,6,opt,name=resources,proto3" json:"resources" yaml:"resources"` - Count uint32 `protobuf:"varint,7,opt,name=count,proto3" json:"count" yaml:"count"` - Expose ServiceExposes `protobuf:"bytes,8,rep,name=expose,proto3,castrepeated=ServiceExposes" json:"expose" yaml:"expose"` - Params *ServiceParams `protobuf:"bytes,9,opt,name=params,proto3" json:"params" yaml:"params"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" yaml:"name"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image" yaml:"image"` + Command []string `protobuf:"bytes,3,rep,name=command,proto3" json:"command" yaml:"command"` + Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args" yaml:"args"` + Env []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env" yaml:"env"` + Resources v1beta3.Resources `protobuf:"bytes,6,opt,name=resources,proto3" json:"resources" yaml:"resources"` + Count uint32 `protobuf:"varint,7,opt,name=count,proto3" json:"count" yaml:"count"` + Expose ServiceExposes `protobuf:"bytes,8,rep,name=expose,proto3,castrepeated=ServiceExposes" json:"expose" yaml:"expose"` + Params *ServiceParams `protobuf:"bytes,9,opt,name=params,proto3" json:"params" yaml:"params"` + Credentials *ServiceImageCredentials `protobuf:"bytes,10,opt,name=credentials,proto3" json:"credentials" yaml:"credentials"` } func (m *Service) Reset() { *m = Service{} } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_de124a4cb11edaa1, []int{2} + return fileDescriptor_de124a4cb11edaa1, []int{3} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,8 +307,16 @@ func (m *Service) GetParams() *ServiceParams { return nil } +func (m *Service) GetCredentials() *ServiceImageCredentials { + if m != nil { + return m.Credentials + } + return nil +} + func init() { proto.RegisterType((*StorageParams)(nil), "akash.manifest.v2beta2.StorageParams") + proto.RegisterType((*ServiceImageCredentials)(nil), "akash.manifest.v2beta2.ServiceImageCredentials") proto.RegisterType((*ServiceParams)(nil), "akash.manifest.v2beta2.ServiceParams") proto.RegisterType((*Service)(nil), "akash.manifest.v2beta2.Service") } @@ -249,45 +326,52 @@ func init() { } var fileDescriptor_de124a4cb11edaa1 = []byte{ - // 594 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x4f, 0xd4, 0x40, - 0x1c, 0xdd, 0x71, 0x61, 0x97, 0x1d, 0x5c, 0x34, 0x8d, 0xd1, 0x42, 0x42, 0xa7, 0x4e, 0x24, 0x69, - 0x24, 0xb4, 0x61, 0x39, 0x68, 0x8c, 0xa7, 0x26, 0x7a, 0xd5, 0x0c, 0x37, 0x0e, 0x9a, 0x69, 0x19, - 0xca, 0x06, 0xda, 0x69, 0x3a, 0x65, 0x23, 0x37, 0x3f, 0x82, 0x9f, 0x43, 0xbf, 0x08, 0x47, 0x8e, - 0x9c, 0x46, 0x59, 0x6e, 0x7b, 0xec, 0x27, 0x30, 0xf3, 0xa7, 0x56, 0xa2, 0x91, 0x78, 0xda, 0xfd, - 0xbd, 0xdf, 0xfb, 0xcd, 0xbc, 0x79, 0xbf, 0xb7, 0x0b, 0x9f, 0xd1, 0x13, 0x2a, 0x8e, 0xa3, 0x9c, - 0x16, 0xd3, 0x23, 0x26, 0xea, 0x68, 0x36, 0x49, 0x58, 0x4d, 0x27, 0x91, 0x60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xa2, 0xb1, 0x7d, 0xae, 0xae, 0xf1, 0xd7, 0xef, - 0x68, 0xed, 0xd6, 0x84, 0x20, 0x96, 0xea, 0x7c, 0x80, 0x83, 0x52, 0x27, 0xc7, 0x1d, 0x69, 0x0f, - 0xee, 0xba, 0xd1, 0xc6, 0x0c, 0x59, 0x77, 0xed, 0x70, 0x77, 0xa3, 0xa9, 0x31, 0xb1, 0x8d, 0xf8, - 0xe0, 0xea, 0xda, 0xeb, 0x7d, 0x9e, 0x7b, 0xe0, 0x62, 0xee, 0x81, 0xcb, 0xb9, 0x07, 0x7e, 0xcc, - 0x3d, 0xf0, 0xe5, 0xc6, 0xeb, 0x5d, 0xde, 0x78, 0xbd, 0xab, 0x1b, 0xaf, 0x77, 0xf0, 0x32, 0x9b, - 0xd6, 0xc7, 0x67, 0x49, 0x98, 0xf2, 0x3c, 0x12, 0xe5, 0x31, 0xab, 0x78, 0xf1, 0xf6, 0xb0, 0x88, - 0xb4, 0x8c, 0x1d, 0x5a, 0x4e, 0x77, 0x8e, 0x78, 0x75, 0x12, 0x65, 0xfc, 0x8f, 0xbf, 0x86, 0x64, - 0xa0, 0x7f, 0xe9, 0x7b, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x86, 0x39, 0x6d, 0xf9, 0x8f, 0x04, - 0x00, 0x00, + // 717 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0xbf, 0xb4, 0xf9, 0x99, 0x7c, 0x29, 0xc8, 0x42, 0xd4, 0xad, 0x54, 0x4f, 0x18, 0x51, + 0x29, 0x50, 0xd5, 0x56, 0xd3, 0x05, 0x08, 0x58, 0x19, 0x81, 0xc4, 0x0a, 0x34, 0xdd, 0x75, 0x01, + 0x9a, 0x38, 0xd3, 0x24, 0x6a, 0xec, 0xb1, 0x3c, 0x4e, 0xa0, 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0xd7, 0x01, 0xaa, 0x88, 0x7f, 0x43, 0x91, 0x5f, 0xcf, 0x3e, 0x78, 0x60, 0xca, 0x2d, 0x3f, 0x2b, + 0x17, 0xd0, 0x36, 0x3d, 0x2c, 0x41, 0x84, 0x97, 0x29, 0xc1, 0xe1, 0xf9, 0x77, 0xb7, 0xf2, 0x69, + 0xee, 0x5a, 0xa7, 0x73, 0xd7, 0x3a, 0x9b, 0xbb, 0xd6, 0xb7, 0xb9, 0x6b, 0x7d, 0xbe, 0x74, 0x2b, + 0x67, 0x97, 0x6e, 0xe5, 0xfc, 0xd2, 0xad, 0x1c, 0x3e, 0x1e, 0x8e, 0xb3, 0xd1, 0xb4, 0xef, 0x85, + 0x2c, 0xf2, 0x79, 0x32, 0xa2, 0x29, 0x8b, 0x5f, 0x0e, 0x62, 0x5f, 0xf9, 0xdb, 0x25, 0xc9, 0x78, + 0xf7, 0x88, 0xa5, 0xc7, 0xfe, 0x90, 0xfd, 0xf6, 0x31, 0xee, 0xd7, 0xd4, 0xb7, 0x75, 0xff, 0x67, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xbf, 0xdd, 0xab, 0x01, 0x06, 0x00, 0x00, } func (m *StorageParams) Marshal() (dAtA []byte, err error) { @@ -337,6 +421,57 @@ func (m *StorageParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ServiceImageCredentials) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceImageCredentials) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceImageCredentials) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Password) > 0 { + i -= len(m.Password) + copy(dAtA[i:], m.Password) + i = encodeVarintService(dAtA, i, uint64(len(m.Password))) + i-- + dAtA[i] = 0x22 + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintService(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x1a + } + if len(m.Email) > 0 { + i -= len(m.Email) + copy(dAtA[i:], m.Email) + i = encodeVarintService(dAtA, i, uint64(len(m.Email))) + i-- + dAtA[i] = 0x12 + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintService(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ServiceParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -394,6 +529,18 @@ func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Credentials != nil { + { + size, err := m.Credentials.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } if m.Params != nil { { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) @@ -510,6 +657,31 @@ func (m *StorageParams) Size() (n int) { return n } +func (m *ServiceImageCredentials) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Host) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Email) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Password) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + func (m *ServiceParams) Size() (n int) { if m == nil { return 0 @@ -572,6 +744,10 @@ func (m *Service) Size() (n int) { l = m.Params.Size() n += 1 + l + sovService(uint64(l)) } + if m.Credentials != nil { + l = m.Credentials.Size() + n += 1 + l + sovService(uint64(l)) + } return n } @@ -593,6 +769,19 @@ func (this *StorageParams) String() string { }, "") return s } +func (this *ServiceImageCredentials) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ServiceImageCredentials{`, + `Host:` + fmt.Sprintf("%v", this.Host) + `,`, + `Email:` + fmt.Sprintf("%v", this.Email) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `Password:` + fmt.Sprintf("%v", this.Password) + `,`, + `}`, + }, "") + return s +} func (this *ServiceParams) String() string { if this == nil { return "nil" @@ -627,6 +816,7 @@ func (this *Service) String() string { `Count:` + fmt.Sprintf("%v", this.Count) + `,`, `Expose:` + repeatedStringForExpose + `,`, `Params:` + strings.Replace(this.Params.String(), "ServiceParams", "ServiceParams", 1) + `,`, + `Credentials:` + strings.Replace(this.Credentials.String(), "ServiceImageCredentials", "ServiceImageCredentials", 1) + `,`, `}`, }, "") return s @@ -773,6 +963,184 @@ func (m *StorageParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *ServiceImageCredentials) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceImageCredentials: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceImageCredentials: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Email", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Email = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Password = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ServiceParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1168,6 +1536,42 @@ func (m *Service) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Credentials == nil { + m.Credentials = &ServiceImageCredentials{} + } + if err := m.Credentials.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) diff --git a/proto/provider/akash/manifest/v2beta2/service.proto b/proto/provider/akash/manifest/v2beta2/service.proto index 6e289af1..ff036255 100644 --- a/proto/provider/akash/manifest/v2beta2/service.proto +++ b/proto/provider/akash/manifest/v2beta2/service.proto @@ -26,6 +26,26 @@ message StorageParams { ]; } +// Credentials to fetch image from registry +message ServiceImageCredentials { + string host = 1 [ + (gogoproto.jsontag) = "host", + (gogoproto.moretags) = "yaml:\"host\"" + ]; + string email = 2 [ + (gogoproto.jsontag) = "email", + (gogoproto.moretags) = "yaml:\"email\"" + ]; + string username = 3 [ + (gogoproto.jsontag) = "username", + (gogoproto.moretags) = "yaml:\"username\"" + ]; + string password = 4 [ + (gogoproto.jsontag) = "password", + (gogoproto.moretags) = "yaml:\"password\"" + ]; +} + // ServiceParams message ServiceParams { repeated StorageParams storage = 1 [ @@ -78,4 +98,9 @@ message Service { (gogoproto.jsontag) = "params", (gogoproto.moretags) = "yaml:\"params\"" ]; + ServiceImageCredentials credentials = 10 [ + (gogoproto.nullable) = true, + (gogoproto.jsontag) = "credentials", + (gogoproto.moretags) = "yaml:\"credentials\"" + ]; }