diff --git a/api/services/containers/v1/containers.pb.go b/api/services/containers/v1/containers.pb.go index 888c5c302..366c7e895 100644 --- a/api/services/containers/v1/containers.pb.go +++ b/api/services/containers/v1/containers.pb.go @@ -101,7 +101,7 @@ type Container_Runtime struct { // Name is the name of the runtime. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Options specify additional runtime initialization options. - Options map[string]string `protobuf:"bytes,2,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Options *google_protobuf1.Any `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` } func (m *Container_Runtime) Reset() { *m = Container_Runtime{} } @@ -523,22 +523,15 @@ func (m *Container_Runtime) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContainers(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } - if len(m.Options) > 0 { - for k, _ := range m.Options { - dAtA[i] = 0x12 - i++ - v := m.Options[k] - mapSize := 1 + len(k) + sovContainers(uint64(len(k))) + 1 + len(v) + sovContainers(uint64(len(v))) - i = encodeVarintContainers(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintContainers(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintContainers(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.Options != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintContainers(dAtA, i, uint64(m.Options.Size())) + n5, err := m.Options.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n5 } return i, nil } @@ -585,11 +578,11 @@ func (m *GetContainerResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size())) - n5, err := m.Container.MarshalTo(dAtA[i:]) + n6, err := m.Container.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n6 return i, nil } @@ -665,11 +658,11 @@ func (m *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size())) - n6, err := m.Container.MarshalTo(dAtA[i:]) + n7, err := m.Container.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n7 return i, nil } @@ -691,11 +684,11 @@ func (m *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size())) - n7, err := m.Container.MarshalTo(dAtA[i:]) + n8, err := m.Container.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n7 + i += n8 return i, nil } @@ -717,20 +710,20 @@ func (m *UpdateContainerRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size())) - n8, err := m.Container.MarshalTo(dAtA[i:]) + n9, err := m.Container.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n9 if m.UpdateMask != nil { dAtA[i] = 0x12 i++ i = encodeVarintContainers(dAtA, i, uint64(m.UpdateMask.Size())) - n9, err := m.UpdateMask.MarshalTo(dAtA[i:]) + n10, err := m.UpdateMask.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n10 } return i, nil } @@ -753,11 +746,11 @@ func (m *UpdateContainerResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size())) - n10, err := m.Container.MarshalTo(dAtA[i:]) + n11, err := m.Container.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n11 return i, nil } @@ -857,13 +850,9 @@ func (m *Container_Runtime) Size() (n int) { if l > 0 { n += 1 + l + sovContainers(uint64(l)) } - if len(m.Options) > 0 { - for k, v := range m.Options { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovContainers(uint64(len(k))) + 1 + len(v) + sovContainers(uint64(len(v))) - n += mapEntrySize + 1 + sovContainers(uint64(mapEntrySize)) - } + if m.Options != nil { + l = m.Options.Size() + n += 1 + l + sovContainers(uint64(l)) } return n } @@ -998,19 +987,9 @@ func (this *Container_Runtime) String() string { if this == nil { return "nil" } - keysForOptions := make([]string, 0, len(this.Options)) - for k, _ := range this.Options { - keysForOptions = append(keysForOptions, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForOptions) - mapStringForOptions := "map[string]string{" - for _, k := range keysForOptions { - mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k]) - } - mapStringForOptions += "}" s := strings.Join([]string{`&Container_Runtime{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Options:` + mapStringForOptions + `,`, + `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf1.Any", 1) + `,`, `}`, }, "") return s @@ -1577,94 +1556,11 @@ func (m *Container_Runtime) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthContainers - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey if m.Options == nil { - m.Options = make(map[string]string) + m.Options = &google_protobuf1.Any{} } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthContainers - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - m.Options[mapkey] = mapvalue - } else { - var mapvalue string - m.Options[mapkey] = mapvalue + if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: @@ -2549,53 +2445,52 @@ func init() { } var fileDescriptorContainers = []byte{ - // 756 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x72, 0x12, 0x4b, - 0x14, 0xce, 0x00, 0x19, 0xc2, 0xe1, 0x2e, 0x6e, 0xf5, 0xe5, 0x72, 0xe7, 0x8e, 0x55, 0x80, 0xac, - 0x58, 0xe8, 0x8c, 0x41, 0x4b, 0xf3, 0xb3, 0x82, 0xfc, 0x95, 0x55, 0x51, 0x53, 0xad, 0x6e, 0xcc, - 0x22, 0x0e, 0xd0, 0x90, 0x91, 0x61, 0x7a, 0x9c, 0x6e, 0xa8, 0xa2, 0x5c, 0xe8, 0x23, 0xf8, 0x16, - 0x79, 0x03, 0x9f, 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 0x72, 0xc3, 0xaa, 0x54, 0x2f, 0x53, 0x00, 0xf1, 0x30, - 0xa2, 0x01, 0x24, 0x0f, 0x08, 0x47, 0x8f, 0xe7, 0x28, 0x63, 0xc6, 0x42, 0xea, 0x4f, 0x16, 0xc6, - 0x49, 0x29, 0x3e, 0x40, 0x2a, 0x58, 0x0b, 0x34, 0xcf, 0x9f, 0xcb, 0xcc, 0x85, 0xd3, 0x37, 0x97, - 0x40, 0xca, 0xe4, 0x1f, 0x41, 0x0d, 0x27, 0x17, 0xcd, 0x43, 0x32, 0x7b, 0xa1, 0xf4, 0xad, 0x65, - 0xa0, 0x71, 0x01, 0xe1, 0x8c, 0xcc, 0x55, 0xc0, 0xec, 0xb9, 0x9f, 0xab, 0x80, 0x9b, 0x26, 0xf1, - 0x18, 0xd4, 0x70, 0x6e, 0xe6, 0x2a, 0x60, 0xf6, 0x88, 0xe9, 0xf9, 0xa9, 0x8d, 0xd8, 0x0b, 0x1e, - 0x3b, 0xf5, 0xb7, 0xe7, 0x57, 0x85, 0x95, 0x6f, 0x57, 0x85, 0x95, 0x4f, 0xa3, 0x82, 0x72, 0x3e, - 0x2a, 0x28, 0x5f, 0x47, 0x05, 0xe5, 0x72, 0x54, 0x50, 0xde, 0xec, 0xff, 0xc6, 0xfb, 0x6d, 0x3b, - 0xb6, 0x1a, 0xaa, 0xc8, 0xf8, 0xf0, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0x4e, 0xa7, 0x59, - 0x10, 0x0a, 0x00, 0x00, + // 738 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x4a, + 0x14, 0xae, 0x93, 0xd4, 0x69, 0x4e, 0x36, 0x57, 0x73, 0x73, 0x73, 0x8d, 0x91, 0x92, 0x90, 0x55, + 0x16, 0x60, 0xd3, 0x80, 0xa0, 0x3f, 0xab, 0xa6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78, 0x6f, 0x38, 0x58, 0x06, 0xf2, 0x0e, 0x2d, 0x67, 0x40, + 0xb4, 0x54, 0x28, 0xaf, 0x08, 0xb6, 0x52, 0x1b, 0x8a, 0x7e, 0x0c, 0x59, 0x29, 0x13, 0x42, 0x90, + 0x71, 0xad, 0x3e, 0x91, 0x38, 0xb1, 0x46, 0x06, 0x64, 0xa9, 0xc7, 0x6d, 0xea, 0x32, 0x01, 0x5d, + 0x24, 0x5a, 0x94, 0x54, 0x7d, 0x00, 0xff, 0x1e, 0x12, 0x7e, 0x7d, 0x05, 0x98, 0xbc, 0x1f, 0x10, + 0xc6, 0x17, 0x19, 0xa9, 0x7a, 0x06, 0x85, 0x5f, 0xd3, 0x99, 0x47, 0x5d, 0x46, 0xd0, 0x09, 0xe4, + 0xae, 0x2f, 0x55, 0xc0, 0xf2, 0xf5, 0xfb, 0xcb, 0x5c, 0x7d, 0x23, 0x13, 0xc8, 0x84, 0x63, 0x92, + 0xaa, 0x09, 0xff, 0x1d, 0xd9, 0x2c, 0x2e, 0xc5, 0xe2, 0xd6, 0xd4, 0x8e, 0xed, 0x70, 0x59, 0x27, + 0x87, 0x65, 0x54, 0x75, 0xa0, 0x38, 0x0d, 0x90, 0xcd, 0x61, 0x80, 0xb8, 0xac, 0xa6, 0x88, 0x09, + 0xb8, 0x49, 0x77, 0x13, 0x2c, 0xd5, 0x77, 0x50, 0xdc, 0x15, 0x9e, 0x98, 0x91, 0xee, 0xef, 0x4b, + 0xd1, 0x83, 0xff, 0x67, 0x6a, 0xdd, 0x9a, 0xee, 0x5f, 0x14, 0x28, 0xbe, 0x12, 0x46, 0xbd, 0xfd, + 0x93, 0xa1, 0x6d, 0xc8, 0x87, 0x43, 0x21, 0x1e, 0x4c, 0xe9, 0xd8, 0xd9, 0x69, 0x3a, 0x08, 0xde, + 0xd4, 0x63, 0x8b, 0xf5, 0xb0, 0x9c, 0xbd, 0x60, 0x1d, 0xc8, 0x32, 0xd3, 0xe8, 0xad, 0xc9, 0xf2, + 0x10, 0x8a, 0x7b, 0xc4, 0x21, 0x73, 0x54, 0x59, 0x30, 0x2a, 0xf5, 0xcb, 0x0c, 0x40, 0x6c, 0x46, + 0x34, 0x84, 0xf4, 0x21, 0xe1, 0xe8, 0x49, 0x82, 0x36, 0xe6, 0x0c, 0xa4, 0xfe, 0x74, 0x69, 0x9c, + 0x94, 0xe2, 0x03, 0x64, 0x82, 0xb1, 0x40, 0x49, 0x9e, 0xfc, 0xb9, 0x03, 0xa7, 0x6f, 0xde, 0x00, + 0x29, 0x8b, 0x7f, 0x04, 0x35, 0x74, 0x2e, 0x4a, 0x42, 0x32, 0x7f, 0xa0, 0xf4, 0xad, 0x9b, 0x40, + 0xe3, 0x06, 0x42, 0x8f, 0x24, 0x6a, 0x60, 0xbe, 0xef, 0x13, 0x35, 0xb0, 0xc8, 0x89, 0x6f, 0x40, + 0x0d, 0x7d, 0x93, 0xa8, 0x81, 0xf9, 0x16, 0xd3, 0x8b, 0x33, 0x13, 0xb1, 0x1f, 0xfc, 0x82, 0x34, + 0xde, 0x9e, 0x5f, 0x95, 0x56, 0xbe, 0x5f, 0x95, 0x56, 0x3e, 0x8d, 0x4b, 0xca, 0xf9, 0xb8, 0xa4, + 0x7c, 0x1b, 0x97, 0x94, 0xcb, 0x71, 0x49, 0x79, 0x7d, 0xf0, 0x07, 0x7f, 0x55, 0xdb, 0x71, 0xd4, + 0x54, 0x45, 0xc5, 0x47, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x07, 0x2d, 0x75, 0x3c, 0xa6, 0x09, + 0x00, 0x00, } diff --git a/api/services/containers/v1/containers.proto b/api/services/containers/v1/containers.proto index f153d29cf..3fe0cae87 100644 --- a/api/services/containers/v1/containers.proto +++ b/api/services/containers/v1/containers.proto @@ -57,7 +57,7 @@ message Container { // Name is the name of the runtime. string name = 1; // Options specify additional runtime initialization options. - map options = 2; + google.protobuf.Any options = 2; } // Runtime specifies which runtime to use for executing this container. Runtime runtime = 4; diff --git a/api/services/events/v1/container.pb.go b/api/services/events/v1/container.pb.go index 5dee38d13..6a45cb1b5 100644 --- a/api/services/events/v1/container.pb.go +++ b/api/services/events/v1/container.pb.go @@ -45,6 +45,7 @@ import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import _ "github.com/gogo/protobuf/gogoproto" +import google_protobuf1 "github.com/gogo/protobuf/types" import strings "strings" import reflect "reflect" @@ -74,8 +75,8 @@ func (*ContainerCreate) ProtoMessage() {} func (*ContainerCreate) Descriptor() ([]byte, []int) { return fileDescriptorContainer, []int{0} } type ContainerCreate_Runtime struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Options map[string]string `protobuf:"bytes,2,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Options *google_protobuf1.Any `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` } func (m *ContainerCreate_Runtime) Reset() { *m = ContainerCreate_Runtime{} } @@ -170,22 +171,15 @@ func (m *ContainerCreate_Runtime) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContainer(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } - if len(m.Options) > 0 { - for k, _ := range m.Options { - dAtA[i] = 0x12 - i++ - v := m.Options[k] - mapSize := 1 + len(k) + sovContainer(uint64(len(k))) + 1 + len(v) + sovContainer(uint64(len(v))) - i = encodeVarintContainer(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintContainer(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintContainer(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.Options != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintContainer(dAtA, i, uint64(m.Options.Size())) + n2, err := m.Options.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n2 } return i, nil } @@ -319,13 +313,9 @@ func (m *ContainerCreate_Runtime) Size() (n int) { if l > 0 { n += 1 + l + sovContainer(uint64(l)) } - if len(m.Options) > 0 { - for k, v := range m.Options { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovContainer(uint64(len(k))) + 1 + len(v) + sovContainer(uint64(len(v))) - n += mapEntrySize + 1 + sovContainer(uint64(mapEntrySize)) - } + if m.Options != nil { + l = m.Options.Size() + n += 1 + l + sovContainer(uint64(l)) } return n } @@ -395,19 +385,9 @@ func (this *ContainerCreate_Runtime) String() string { if this == nil { return "nil" } - keysForOptions := make([]string, 0, len(this.Options)) - for k, _ := range this.Options { - keysForOptions = append(keysForOptions, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForOptions) - mapStringForOptions := "map[string]string{" - for _, k := range keysForOptions { - mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k]) - } - mapStringForOptions += "}" s := strings.Join([]string{`&ContainerCreate_Runtime{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Options:` + mapStringForOptions + `,`, + `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf1.Any", 1) + `,`, `}`, }, "") return s @@ -678,94 +658,11 @@ func (m *ContainerCreate_Runtime) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthContainer - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey if m.Options == nil { - m.Options = make(map[string]string) + m.Options = &google_protobuf1.Any{} } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContainer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthContainer - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - m.Options[mapkey] = mapvalue - } else { - var mapvalue string - m.Options[mapkey] = mapvalue + if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: @@ -1231,31 +1128,31 @@ func init() { } var fileDescriptorContainer = []byte{ - // 406 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0xaa, 0xd3, 0x40, - 0x18, 0xed, 0x24, 0x35, 0xc5, 0x49, 0xa1, 0x32, 0x74, 0x11, 0x02, 0xa6, 0xa5, 0xab, 0xae, 0x26, - 0xb4, 0x82, 0x68, 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54, 0x93, 0xca, 0xc6, 0xfc, 0x03, 0x60, - 0xa7, 0xfc, 0x88, 0x10, 0x6c, 0x87, 0x4e, 0x40, 0x65, 0x3e, 0x52, 0x60, 0xf4, 0x15, 0x76, 0x78, - 0x24, 0x18, 0x0f, 0x13, 0x43, 0x19, 0xaa, 0x63, 0x7d, 0xba, 0xb8, 0xec, 0x8f, 0xf8, 0xbd, 0x74, - 0x59, 0x85, 0x22, 0xde, 0x93, 0xca, 0xd3, 0x9c, 0xc1, 0x6e, 0x73, 0x80, 0x9e, 0x40, 0xf5, 0x27, - 0xdd, 0x97, 0x09, 0x72, 0x98, 0x17, 0x91, 0x3a, 0xfe, 0xae, 0x2e, 0xa2, 0x78, 0xcc, 0x94, 0x17, - 0x60, 0xf4, 0xbb, 0x59, 0xf5, 0xa7, 0xc8, 0x7d, 0xd8, 0xaa, 0x09, 0xd4, 0x7c, 0x67, 0x43, 0xfd, - 0xc4, 0x50, 0x8b, 0xbd, 0x67, 0x77, 0xdd, 0x5b, 0x26, 0xc1, 0xef, 0x0a, 0xb1, 0x5c, 0xb7, 0x74, - 0x42, 0x23, 0xa8, 0xc5, 0x9c, 0x8b, 0xef, 0x89, 0xd1, 0x2e, 0x72, 0xc1, 0xec, 0x38, 0xd0, 0x08, - 0xe7, 0xe2, 0xcd, 0x47, 0x52, 0x4e, 0xcc, 0x97, 0x50, 0x6f, 0x48, 0xef, 0x55, 0xc8, 0xaa, 0xd1, - 0xc7, 0x92, 0xfa, 0xf4, 0xb2, 0x3e, 0xe6, 0x9f, 0x0f, 0x27, 0xab, 0xf5, 0xef, 0x64, 0xb5, 0x7e, - 0x65, 0x16, 0x38, 0x64, 0x16, 0xf8, 0x9b, 0x59, 0xe0, 0x7f, 0x66, 0x81, 0x2f, 0xaf, 0x2f, 0x3c, - 0xad, 0x57, 0x12, 0x6d, 0xb4, 0xe2, 0x46, 0x9e, 0x5d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x66, 0x84, - 0x14, 0x0e, 0xa3, 0x03, 0x00, 0x00, + // 413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x4d, 0x8b, 0xd5, 0x30, + 0x14, 0x9d, 0xbc, 0x8e, 0x7d, 0x98, 0x0a, 0x23, 0xe1, 0x2d, 0x6a, 0xc1, 0xce, 0xa3, 0xab, 0xb7, + 0x4a, 0x99, 0x0a, 0xa2, 0x23, 0x08, 0xce, 0x87, 0x32, 0xa0, 0x20, 0x11, 0x41, 0xdc, 0x48, 0xfa, + 0x9a, 0xa9, 0xc1, 0x36, 0x29, 0x6d, 0x5a, 0xe8, 0xce, 0x5f, 0xe0, 0xef, 0x9a, 0xa5, 0x4b, 0x57, + 0x83, 0xd3, 0xdf, 0xe1, 0x42, 0x9a, 0xb4, 0x9d, 0xe2, 0x42, 0xe4, 0xe1, 0xee, 0xdc, 0xdc, 0x73, + 0x6e, 0xce, 0xb9, 0x21, 0xf0, 0x55, 0xca, 0xd5, 0xe7, 0x3a, 0xc6, 0x5b, 0x99, 0x87, 0x5b, 0x29, + 0x14, 0xe5, 0x82, 0x95, 0xc9, 0x1c, 0xd2, 0x82, 0x87, 0x15, 0x2b, 0x1b, 0xbe, 0x65, 0x55, 0xc8, + 0x1a, 0x26, 0x54, 0x15, 0x36, 0x47, 0xb7, 0x0c, 0x5c, 0x94, 0x52, 0x49, 0xf4, 0xf0, 0x56, 0x82, + 0x47, 0x3a, 0x36, 0x74, 0xdc, 0x1c, 0x79, 0xab, 0x54, 0xa6, 0x52, 0x33, 0xc3, 0x1e, 0x19, 0x91, + 0xf7, 0x20, 0x95, 0x32, 0xcd, 0x58, 0xa8, 0xab, 0xb8, 0xbe, 0x0c, 0xa9, 0x68, 0x4d, 0x2b, 0xf8, + 0x05, 0xe0, 0xc1, 0xe9, 0x38, 0xf2, 0xb4, 0x64, 0x54, 0x31, 0x14, 0xc1, 0x7b, 0xd3, 0x2d, 0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xe7, 0xb3, 0x7d, 0x9c, 0xb1, 0x8c, 0xed, 0xb6, 0x8f, 0x93, 0x0f, 0x57, 0x37, + 0xfe, 0xde, 0x8f, 0x1b, 0x7f, 0xef, 0x6b, 0xe7, 0x83, 0xab, 0xce, 0x07, 0xdf, 0x3b, 0x1f, 0xfc, + 0xec, 0x7c, 0xf0, 0xf1, 0xf9, 0x8e, 0x3f, 0xe1, 0x99, 0x41, 0xb1, 0xad, 0x1f, 0xf2, 0xd1, 0xef, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x0b, 0xcd, 0x09, 0x52, 0x03, 0x00, 0x00, } diff --git a/api/services/events/v1/container.proto b/api/services/events/v1/container.proto index 882e213d2..d211665b3 100644 --- a/api/services/events/v1/container.proto +++ b/api/services/events/v1/container.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package containerd.services.events.v1; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; option go_package = "github.com/containerd/containerd/api/services/events/v1;events"; @@ -11,7 +12,7 @@ message ContainerCreate { string image = 2; message Runtime { string name = 1; - map options = 2; + google.protobuf.Any options = 2; } Runtime runtime = 3; } diff --git a/api/services/events/v1/events.pb.go b/api/services/events/v1/events.pb.go index 3dfeb765e..2e7c8508b 100644 --- a/api/services/events/v1/events.pb.go +++ b/api/services/events/v1/events.pb.go @@ -9,7 +9,7 @@ import fmt "fmt" import math "math" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/protobuf/types" -import google_protobuf2 "github.com/gogo/protobuf/types" +import google_protobuf1 "github.com/gogo/protobuf/types" import time "time" @@ -41,7 +41,7 @@ func (*StreamEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptor type Envelope struct { Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,stdtime" json:"timestamp"` Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"` - Event *google_protobuf2.Any `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"` + Event *google_protobuf1.Any `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"` } func (m *Envelope) Reset() { *m = Envelope{} } @@ -288,9 +288,9 @@ func (this *Envelope) String() string { return "nil" } s := strings.Join([]string{`&Envelope{`, - `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`, + `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`, `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, - `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "google_protobuf2.Any", 1) + `,`, + `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "google_protobuf1.Any", 1) + `,`, `}`, }, "") return s @@ -468,7 +468,7 @@ func (m *Envelope) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Event == nil { - m.Event = &google_protobuf2.Any{} + m.Event = &google_protobuf1.Any{} } if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/api/services/events/v1/runtime.pb.go b/api/services/events/v1/runtime.pb.go index 49349ceea..88e639463 100644 --- a/api/services/events/v1/runtime.pb.go +++ b/api/services/events/v1/runtime.pb.go @@ -571,8 +571,8 @@ func (this *RuntimeEvent) String() string { `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, - `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`, - `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`, + `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`, + `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -585,7 +585,7 @@ func (this *RuntimeDelete) String() string { `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, - `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`, + `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`, `}`, }, "") return s diff --git a/client.go b/client.go index 11ef3b92c..45d078a70 100644 --- a/client.go +++ b/client.go @@ -197,11 +197,10 @@ func WithNewReadonlyRootFS(id string, i Image) NewContainerOpts { // WithRuntime allows a user to specify the runtime name and additional options that should // be used to create tasks for the container -func WithRuntime(name string, options map[string]string) NewContainerOpts { +func WithRuntime(name string) NewContainerOpts { return func(ctx context.Context, client *Client, c *containers.Container) error { c.Runtime = &containers.Container_Runtime{ - Name: name, - Options: options, + Name: name, } return nil } diff --git a/containers/containers.go b/containers/containers.go index 36cba1b4c..06ba37dd8 100644 --- a/containers/containers.go +++ b/containers/containers.go @@ -3,6 +3,8 @@ package containers import ( "context" "time" + + "github.com/gogo/protobuf/types" ) // Container represents the set of data pinned by a container. Unless otherwise @@ -22,7 +24,7 @@ type Container struct { type RuntimeInfo struct { Name string - Options map[string]string + Options *types.Any } type Store interface { diff --git a/metadata/containers.go b/metadata/containers.go index 6989c3c83..90257cdfd 100644 --- a/metadata/containers.go +++ b/metadata/containers.go @@ -9,6 +9,8 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/namespaces" + "github.com/gogo/protobuf/proto" + "github.com/gogo/protobuf/types" "github.com/pkg/errors" ) @@ -166,16 +168,16 @@ func readContainer(container *containers.Container, bkt *bolt.Bucket) error { container.Runtime.Name = string(n) } - obkt := rbkt.Bucket(bucketKeyOptions) + obkt := rbkt.Get(bucketKeyOptions) if obkt == nil { return nil } - container.Runtime.Options = map[string]string{} - return obkt.ForEach(func(k, v []byte) error { - container.Runtime.Options[string(k)] = string(v) - return nil - }) + var any types.Any + if err := proto.Unmarshal(obkt, &any); err != nil { + return err + } + container.Runtime.Options = &any case string(bucketKeySpec): container.Spec = make([]byte, len(v)) copy(container.Spec, v) @@ -249,8 +251,13 @@ func writeContainer(container *containers.Container, bkt *bolt.Bucket) error { return err } - for k, v := range container.Runtime.Options { - if err := obkt.Put([]byte(k), []byte(v)); err != nil { + if container.Runtime.Options != nil { + data, err := proto.Marshal(container.Runtime.Options) + if err != nil { + return err + } + + if err := obkt.Put(bucketKeyOptions, data); err != nil { return err } } diff --git a/windows/container.go b/windows/container.go index 4da13c6d4..4652e4500 100644 --- a/windows/container.go +++ b/windows/container.go @@ -13,6 +13,7 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/windows/hcs" + "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" winsys "golang.org/x/sys/windows" @@ -139,7 +140,7 @@ func (c *container) Exec(ctx context.Context, opts runtime.ExecOpts) (runtime.Pr } var procSpec specs.Process - if err := json.Unmarshal(opts.Spec, &procSpec); err != nil { + if err := json.Unmarshal(opts.Spec.Value, &procSpec); err != nil { return nil, errors.Wrap(err, "failed to unmarshal oci spec") } @@ -187,7 +188,7 @@ func (c *container) Pids(ctx context.Context) ([]uint32, error) { return pids, nil } -func (c *container) Checkpoint(ctx context.Context, _ string, _ []byte) error { +func (c *container) Checkpoint(ctx context.Context, _ string, _ *types.Any) error { return fmt.Errorf("Windows containers do not support checkpoint") } @@ -213,7 +214,7 @@ func (c *container) DeleteProcess(ctx context.Context, pid uint32) (*runtime.Exi }, nil } -func (c *container) Update(ctx context.Context, spec []byte) error { +func (c *container) Update(ctx context.Context, spec *types.Any) error { return fmt.Errorf("Windows containers do not support update") }