From 6c96fdf670db26e54bdc5be146dee1a663aba254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Wed, 23 Nov 2022 14:19:55 +0100 Subject: [PATCH 1/5] Add container image protocol buffer definitions --- Rakefile | 3 + contimage/contimage.pb.go | 1154 +++++++++++++++++++++++++++++++ proto/contimage/contimage.go | 2 + proto/contimage/contimage.proto | 53 ++ 4 files changed, 1212 insertions(+) create mode 100644 contimage/contimage.pb.go create mode 100644 proto/contimage/contimage.go create mode 100644 proto/contimage/contimage.proto diff --git a/Rakefile b/Rakefile index ada6b567..83d62043 100644 --- a/Rakefile +++ b/Rakefile @@ -71,6 +71,9 @@ BASH echo "Generating contlcycle proto" PATH=/tmp/gogo-bin-v1.0.0 #{protoc_binary} --proto_path=$GOPATH/src:#{gogo_dir}/src:. --gogofast_out=$GOPATH/src proto/contlcycle/contlcycle.proto + echo "Generating contimage proto" + PATH=/tmp/gogo-bin-v1.0.0 #{protoc_binary} --proto_path=$GOPATH/src:#{gogo_dir}/src:. --gogofast_out=$GOPATH/src proto/contimage/contimage.proto + cp -r v5/* . rm -rf v5 BASH diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go new file mode 100644 index 00000000..2cf340e1 --- /dev/null +++ b/contimage/contimage.pb.go @@ -0,0 +1,1154 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proto/contimage/contimage.proto + +/* + Package contimage is a generated protocol buffer package. + + It is generated from these files: + proto/contimage/contimage.proto + + It has these top-level messages: + ContainerImagePayload + ContainerImage +*/ +package contimage + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +import io "io" + +// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// ContainerImagePayload represents the main container image payload +type ContainerImagePayload struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` + Images []*ContainerImage `protobuf:"bytes,3,rep,name=images" json:"images,omitempty"` +} + +func (m *ContainerImagePayload) Reset() { *m = ContainerImagePayload{} } +func (m *ContainerImagePayload) String() string { return proto.CompactTextString(m) } +func (*ContainerImagePayload) ProtoMessage() {} +func (*ContainerImagePayload) Descriptor() ([]byte, []int) { return fileDescriptorContimage, []int{0} } + +func (m *ContainerImagePayload) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *ContainerImagePayload) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *ContainerImagePayload) GetImages() []*ContainerImage { + if m != nil { + return m.Images + } + return nil +} + +// ContainerImage contains the details of a container image +type ContainerImage struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Registry string `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` + Size_ int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` + RepoDigest string `protobuf:"bytes,7,opt,name=repo_digest,json=repoDigest,proto3" json:"repo_digest,omitempty"` + Layers []*ContainerImage_ContainerImageLayer `protobuf:"bytes,9,rep,name=layers" json:"layers,omitempty"` +} + +func (m *ContainerImage) Reset() { *m = ContainerImage{} } +func (m *ContainerImage) String() string { return proto.CompactTextString(m) } +func (*ContainerImage) ProtoMessage() {} +func (*ContainerImage) Descriptor() ([]byte, []int) { return fileDescriptorContimage, []int{1} } + +func (m *ContainerImage) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ContainerImage) GetRegistry() string { + if m != nil { + return m.Registry + } + return "" +} + +func (m *ContainerImage) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ContainerImage) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +func (m *ContainerImage) GetDigest() string { + if m != nil { + return m.Digest + } + return "" +} + +func (m *ContainerImage) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func (m *ContainerImage) GetRepoDigest() string { + if m != nil { + return m.RepoDigest + } + return "" +} + +func (m *ContainerImage) GetLayers() []*ContainerImage_ContainerImageLayer { + if m != nil { + return m.Layers + } + return nil +} + +type ContainerImage_ContainerImageLayer struct { + Urls string `protobuf:"bytes,1,opt,name=urls,proto3" json:"urls,omitempty"` + MediaType string `protobuf:"bytes,2,opt,name=mediaType,proto3" json:"mediaType,omitempty"` + Digest string `protobuf:"bytes,3,opt,name=digest,proto3" json:"digest,omitempty"` + Size_ int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` +} + +func (m *ContainerImage_ContainerImageLayer) Reset() { *m = ContainerImage_ContainerImageLayer{} } +func (m *ContainerImage_ContainerImageLayer) String() string { return proto.CompactTextString(m) } +func (*ContainerImage_ContainerImageLayer) ProtoMessage() {} +func (*ContainerImage_ContainerImageLayer) Descriptor() ([]byte, []int) { + return fileDescriptorContimage, []int{1, 0} +} + +func (m *ContainerImage_ContainerImageLayer) GetUrls() string { + if m != nil { + return m.Urls + } + return "" +} + +func (m *ContainerImage_ContainerImageLayer) GetMediaType() string { + if m != nil { + return m.MediaType + } + return "" +} + +func (m *ContainerImage_ContainerImageLayer) GetDigest() string { + if m != nil { + return m.Digest + } + return "" +} + +func (m *ContainerImage_ContainerImageLayer) GetSize_() int64 { + if m != nil { + return m.Size_ + } + return 0 +} + +func init() { + proto.RegisterType((*ContainerImagePayload)(nil), "datadog.contimage.ContainerImagePayload") + proto.RegisterType((*ContainerImage)(nil), "datadog.contimage.ContainerImage") + proto.RegisterType((*ContainerImage_ContainerImageLayer)(nil), "datadog.contimage.ContainerImage.ContainerImageLayer") +} +func (m *ContainerImagePayload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerImagePayload) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Version) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Version))) + i += copy(dAtA[i:], m.Version) + } + if len(m.Host) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Host))) + i += copy(dAtA[i:], m.Host) + } + if len(m.Images) > 0 { + for _, msg := range m.Images { + dAtA[i] = 0x1a + i++ + i = encodeVarintContimage(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *ContainerImage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Id) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Id))) + i += copy(dAtA[i:], m.Id) + } + if len(m.Registry) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Registry))) + i += copy(dAtA[i:], m.Registry) + } + if len(m.Name) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + dAtA[i] = 0x22 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if len(m.Digest) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Digest))) + i += copy(dAtA[i:], m.Digest) + } + if m.Size_ != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintContimage(dAtA, i, uint64(m.Size_)) + } + if len(m.RepoDigest) > 0 { + dAtA[i] = 0x3a + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.RepoDigest))) + i += copy(dAtA[i:], m.RepoDigest) + } + if len(m.Layers) > 0 { + for _, msg := range m.Layers { + dAtA[i] = 0x4a + i++ + i = encodeVarintContimage(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *ContainerImage_ContainerImageLayer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerImage_ContainerImageLayer) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Urls) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Urls))) + i += copy(dAtA[i:], m.Urls) + } + if len(m.MediaType) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.MediaType))) + i += copy(dAtA[i:], m.MediaType) + } + if len(m.Digest) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Digest))) + i += copy(dAtA[i:], m.Digest) + } + if m.Size_ != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintContimage(dAtA, i, uint64(m.Size_)) + } + return i, nil +} + +func encodeVarintContimage(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *ContainerImagePayload) Size() (n int) { + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.Host) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + if len(m.Images) > 0 { + for _, e := range m.Images { + l = e.Size() + n += 1 + l + sovContimage(uint64(l)) + } + } + return n +} + +func (m *ContainerImage) Size() (n int) { + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.Registry) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + if len(m.Tags) > 0 { + for _, s := range m.Tags { + l = len(s) + n += 1 + l + sovContimage(uint64(l)) + } + } + l = len(m.Digest) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + if m.Size_ != 0 { + n += 1 + sovContimage(uint64(m.Size_)) + } + l = len(m.RepoDigest) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + if len(m.Layers) > 0 { + for _, e := range m.Layers { + l = e.Size() + n += 1 + l + sovContimage(uint64(l)) + } + } + return n +} + +func (m *ContainerImage_ContainerImageLayer) Size() (n int) { + var l int + _ = l + l = len(m.Urls) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.MediaType) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.Digest) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + if m.Size_ != 0 { + n += 1 + sovContimage(uint64(m.Size_)) + } + return n +} + +func sovContimage(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozContimage(x uint64) (n int) { + return sovContimage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ContainerImagePayload) 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 ErrIntOverflowContimage + } + 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: ContainerImagePayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerImagePayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Images", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthContimage + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Images = append(m.Images, &ContainerImage{}) + if err := m.Images[len(m.Images)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipContimage(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthContimage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerImage) 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 ErrIntOverflowContimage + } + 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: ContainerImage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerImage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Registry", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Registry = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Digest = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + } + m.Size_ = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepoDigest", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepoDigest = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Layers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthContimage + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Layers = append(m.Layers, &ContainerImage_ContainerImageLayer{}) + if err := m.Layers[len(m.Layers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipContimage(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthContimage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerImage_ContainerImageLayer) 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 ErrIntOverflowContimage + } + 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: ContainerImageLayer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerImageLayer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Urls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Urls = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MediaType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Digest = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + } + m.Size_ = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size_ |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipContimage(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthContimage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipContimage(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowContimage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowContimage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowContimage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthContimage + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowContimage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipContimage(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthContimage = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowContimage = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("proto/contimage/contimage.proto", fileDescriptorContimage) } + +var fileDescriptorContimage = []byte{ + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x4b, 0x33, 0x31, + 0x10, 0x65, 0x77, 0xfb, 0x6d, 0xbf, 0x4e, 0xa1, 0x60, 0x44, 0x09, 0x45, 0xda, 0xb5, 0xa7, 0x5e, + 0xba, 0x0b, 0x4a, 0x0f, 0xe2, 0x4d, 0x7b, 0x11, 0x14, 0x64, 0xf1, 0xe4, 0x45, 0xd2, 0x6e, 0x48, + 0x03, 0xdd, 0xcd, 0x92, 0xa4, 0x85, 0xf5, 0xe4, 0xcf, 0xf3, 0xe8, 0x4f, 0x90, 0xfe, 0x07, 0xef, + 0x92, 0x34, 0x76, 0xad, 0x16, 0xbc, 0xbd, 0x79, 0x93, 0x97, 0x37, 0x6f, 0x18, 0xe8, 0x97, 0x52, + 0x68, 0x91, 0xcc, 0x44, 0xa1, 0x79, 0x4e, 0x18, 0xad, 0x51, 0x6c, 0x3b, 0xe8, 0x20, 0x23, 0x9a, + 0x64, 0x82, 0xc5, 0xdb, 0xc6, 0xe0, 0xc5, 0x83, 0xa3, 0x6b, 0x51, 0x68, 0xc2, 0x0b, 0x2a, 0x6f, + 0x0c, 0x75, 0x4f, 0xaa, 0x85, 0x20, 0x19, 0xc2, 0xd0, 0x5c, 0x51, 0xa9, 0xb8, 0x28, 0xb0, 0x17, + 0x79, 0xc3, 0x56, 0xfa, 0x55, 0x22, 0x04, 0x8d, 0xb9, 0x50, 0x1a, 0xfb, 0x96, 0xb6, 0x18, 0x5d, + 0x40, 0x68, 0x3f, 0x54, 0x38, 0x88, 0x82, 0x61, 0xfb, 0xec, 0x34, 0xfe, 0xe5, 0x15, 0xef, 0xfa, + 0xa4, 0x4e, 0x30, 0xf8, 0xf0, 0xa1, 0xb3, 0xdb, 0x42, 0x1d, 0xf0, 0x79, 0xe6, 0x6c, 0x7d, 0x9e, + 0xa1, 0x2e, 0xfc, 0x97, 0x94, 0x71, 0xa5, 0x65, 0xe5, 0x5c, 0xb7, 0xb5, 0x99, 0xa6, 0x20, 0x39, + 0xc5, 0xc1, 0x66, 0x1a, 0x83, 0x0d, 0xa7, 0x09, 0x53, 0xb8, 0x11, 0x05, 0x86, 0x33, 0x18, 0x1d, + 0x43, 0x98, 0x71, 0x46, 0x95, 0xc6, 0xff, 0xec, 0x4b, 0x57, 0x99, 0xb7, 0x8a, 0x3f, 0x53, 0x1c, + 0x46, 0xde, 0x30, 0x48, 0x2d, 0x46, 0x7d, 0x68, 0x4b, 0x5a, 0x8a, 0x27, 0x27, 0x68, 0x5a, 0x01, + 0x18, 0x6a, 0xb2, 0x11, 0xdd, 0x41, 0xb8, 0x20, 0x15, 0x95, 0x0a, 0xb7, 0x6c, 0xdc, 0xf1, 0x9f, + 0x71, 0x7f, 0x94, 0xb7, 0x46, 0x9d, 0xba, 0x4f, 0xba, 0x0a, 0x0e, 0xf7, 0xb4, 0xcd, 0x68, 0x4b, + 0xb9, 0x50, 0x6e, 0x11, 0x16, 0xa3, 0x13, 0x68, 0xe5, 0x34, 0xe3, 0xe4, 0xa1, 0x2a, 0xa9, 0xdb, + 0x45, 0x4d, 0x7c, 0x0b, 0x19, 0xec, 0x0d, 0xd9, 0xa8, 0x43, 0x5e, 0x5d, 0xbe, 0xae, 0x7b, 0xde, + 0xdb, 0xba, 0xe7, 0xbd, 0xaf, 0x7b, 0xde, 0xe3, 0x88, 0x71, 0x3d, 0x5f, 0x4e, 0xe3, 0x99, 0xc8, + 0x93, 0x09, 0xd1, 0x64, 0x22, 0x58, 0x42, 0x18, 0x2d, 0xf4, 0xa8, 0xdc, 0x1c, 0x44, 0xb2, 0x1a, + 0xd7, 0x07, 0x35, 0x0d, 0xed, 0x45, 0x9d, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x56, 0xbd, 0x76, + 0x6a, 0x74, 0x02, 0x00, 0x00, +} diff --git a/proto/contimage/contimage.go b/proto/contimage/contimage.go new file mode 100644 index 00000000..1105bf72 --- /dev/null +++ b/proto/contimage/contimage.go @@ -0,0 +1,2 @@ +// package contimage contains the container images proto definitions +package contimage diff --git a/proto/contimage/contimage.proto b/proto/contimage/contimage.proto new file mode 100644 index 00000000..ad1022fe --- /dev/null +++ b/proto/contimage/contimage.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +option go_package = "github.com/DataDog/agent-payload/v5/contimage"; + +package datadog.contimage; + +// ContainerImagePayload represents the main container image payload +message ContainerImagePayload { + string version = 1; // version represents the ContainerImagePayload message version + string host = 2; // host contains the hostname + repeated ContainerImage images = 3; // Images metadata + // repeated VulneratibilityReport reports = 4; // vulneratibility reports +} + +// ContainerImage contains the details of a container image +message ContainerImage { + string id = 1; + string registry = 2; + string name = 3; + repeated string tags = 4; + string digest = 5; + int64 size = 6; + string repo_digest = 7; + + // # platform info + // message OperatingSystem { + // string name = 1; + // string version = 2; + // string architecture = 3; + // } + // optional OperatingSystem os = 8 + + message ContainerImageLayer { + string urls = 1; + string mediaType = 2; + string digest = 3; + int64 size = 4; + } + repeated ContainerImageLayer layers = 9; + + // optional ImageSBOM sbom = 10; + + // optional VulneratibilityReport vulns = 10; +} + +// // VulneratibilityReport container a +// message VulneratibilityReport { +// // TODO +// } + +// message ImageSBOM { +// // TODO +// } From 1e642885f7f4dfb80c59d4e0d186af794b848b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Thu, 24 Nov 2022 16:15:07 +0100 Subject: [PATCH 2/5] Uncomment the operating system info part --- contimage/contimage.pb.go | 336 +++++++++++++++++++++++++++++--- proto/contimage/contimage.proto | 42 ++-- 2 files changed, 332 insertions(+), 46 deletions(-) diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go index 2cf340e1..a860be7b 100644 --- a/contimage/contimage.pb.go +++ b/contimage/contimage.pb.go @@ -72,6 +72,7 @@ type ContainerImage struct { Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` Size_ int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` RepoDigest string `protobuf:"bytes,7,opt,name=repo_digest,json=repoDigest,proto3" json:"repo_digest,omitempty"` + Os *ContainerImage_OperatingSystem `protobuf:"bytes,8,opt,name=os" json:"os,omitempty"` Layers []*ContainerImage_ContainerImageLayer `protobuf:"bytes,9,rep,name=layers" json:"layers,omitempty"` } @@ -129,6 +130,13 @@ func (m *ContainerImage) GetRepoDigest() string { return "" } +func (m *ContainerImage) GetOs() *ContainerImage_OperatingSystem { + if m != nil { + return m.Os + } + return nil +} + func (m *ContainerImage) GetLayers() []*ContainerImage_ContainerImageLayer { if m != nil { return m.Layers @@ -136,6 +144,41 @@ func (m *ContainerImage) GetLayers() []*ContainerImage_ContainerImageLayer { return nil } +// platform info +type ContainerImage_OperatingSystem struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Architecture string `protobuf:"bytes,3,opt,name=architecture,proto3" json:"architecture,omitempty"` +} + +func (m *ContainerImage_OperatingSystem) Reset() { *m = ContainerImage_OperatingSystem{} } +func (m *ContainerImage_OperatingSystem) String() string { return proto.CompactTextString(m) } +func (*ContainerImage_OperatingSystem) ProtoMessage() {} +func (*ContainerImage_OperatingSystem) Descriptor() ([]byte, []int) { + return fileDescriptorContimage, []int{1, 0} +} + +func (m *ContainerImage_OperatingSystem) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ContainerImage_OperatingSystem) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *ContainerImage_OperatingSystem) GetArchitecture() string { + if m != nil { + return m.Architecture + } + return "" +} + type ContainerImage_ContainerImageLayer struct { Urls string `protobuf:"bytes,1,opt,name=urls,proto3" json:"urls,omitempty"` MediaType string `protobuf:"bytes,2,opt,name=mediaType,proto3" json:"mediaType,omitempty"` @@ -147,7 +190,7 @@ func (m *ContainerImage_ContainerImageLayer) Reset() { *m = ContainerIma func (m *ContainerImage_ContainerImageLayer) String() string { return proto.CompactTextString(m) } func (*ContainerImage_ContainerImageLayer) ProtoMessage() {} func (*ContainerImage_ContainerImageLayer) Descriptor() ([]byte, []int) { - return fileDescriptorContimage, []int{1, 0} + return fileDescriptorContimage, []int{1, 1} } func (m *ContainerImage_ContainerImageLayer) GetUrls() string { @@ -181,6 +224,7 @@ func (m *ContainerImage_ContainerImageLayer) GetSize_() int64 { func init() { proto.RegisterType((*ContainerImagePayload)(nil), "datadog.contimage.ContainerImagePayload") proto.RegisterType((*ContainerImage)(nil), "datadog.contimage.ContainerImage") + proto.RegisterType((*ContainerImage_OperatingSystem)(nil), "datadog.contimage.ContainerImage.OperatingSystem") proto.RegisterType((*ContainerImage_ContainerImageLayer)(nil), "datadog.contimage.ContainerImage.ContainerImageLayer") } func (m *ContainerImagePayload) Marshal() (dAtA []byte, err error) { @@ -290,6 +334,16 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContimage(dAtA, i, uint64(len(m.RepoDigest))) i += copy(dAtA[i:], m.RepoDigest) } + if m.Os != nil { + dAtA[i] = 0x42 + i++ + i = encodeVarintContimage(dAtA, i, uint64(m.Os.Size())) + n1, err := m.Os.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } if len(m.Layers) > 0 { for _, msg := range m.Layers { dAtA[i] = 0x4a @@ -305,6 +359,42 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ContainerImage_OperatingSystem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerImage_OperatingSystem) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Name) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Version) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Version))) + i += copy(dAtA[i:], m.Version) + } + if len(m.Architecture) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Architecture))) + i += copy(dAtA[i:], m.Architecture) + } + return i, nil +} + func (m *ContainerImage_ContainerImageLayer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -407,6 +497,10 @@ func (m *ContainerImage) Size() (n int) { if l > 0 { n += 1 + l + sovContimage(uint64(l)) } + if m.Os != nil { + l = m.Os.Size() + n += 1 + l + sovContimage(uint64(l)) + } if len(m.Layers) > 0 { for _, e := range m.Layers { l = e.Size() @@ -416,6 +510,24 @@ func (m *ContainerImage) Size() (n int) { return n } +func (m *ContainerImage_OperatingSystem) Size() (n int) { + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + l = len(m.Architecture) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } + return n +} + func (m *ContainerImage_ContainerImageLayer) Size() (n int) { var l int _ = l @@ -811,6 +923,39 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } m.RepoDigest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Os", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthContimage + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Os == nil { + m.Os = &ContainerImage_OperatingSystem{} + } + if err := m.Os.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Layers", wireType) @@ -863,6 +1008,143 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } return nil } +func (m *ContainerImage_OperatingSystem) 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 ErrIntOverflowContimage + } + 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: OperatingSystem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OperatingSystem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Architecture", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Architecture = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipContimage(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthContimage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ContainerImage_ContainerImageLayer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1127,28 +1409,32 @@ var ( func init() { proto.RegisterFile("proto/contimage/contimage.proto", fileDescriptorContimage) } var fileDescriptorContimage = []byte{ - // 357 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x4b, 0x33, 0x31, - 0x10, 0x65, 0x77, 0xfb, 0x6d, 0xbf, 0x4e, 0xa1, 0x60, 0x44, 0x09, 0x45, 0xda, 0xb5, 0xa7, 0x5e, - 0xba, 0x0b, 0x4a, 0x0f, 0xe2, 0x4d, 0x7b, 0x11, 0x14, 0x64, 0xf1, 0xe4, 0x45, 0xd2, 0x6e, 0x48, - 0x03, 0xdd, 0xcd, 0x92, 0xa4, 0x85, 0xf5, 0xe4, 0xcf, 0xf3, 0xe8, 0x4f, 0x90, 0xfe, 0x07, 0xef, - 0x92, 0x34, 0x76, 0xad, 0x16, 0xbc, 0xbd, 0x79, 0x93, 0x97, 0x37, 0x6f, 0x18, 0xe8, 0x97, 0x52, - 0x68, 0x91, 0xcc, 0x44, 0xa1, 0x79, 0x4e, 0x18, 0xad, 0x51, 0x6c, 0x3b, 0xe8, 0x20, 0x23, 0x9a, - 0x64, 0x82, 0xc5, 0xdb, 0xc6, 0xe0, 0xc5, 0x83, 0xa3, 0x6b, 0x51, 0x68, 0xc2, 0x0b, 0x2a, 0x6f, - 0x0c, 0x75, 0x4f, 0xaa, 0x85, 0x20, 0x19, 0xc2, 0xd0, 0x5c, 0x51, 0xa9, 0xb8, 0x28, 0xb0, 0x17, - 0x79, 0xc3, 0x56, 0xfa, 0x55, 0x22, 0x04, 0x8d, 0xb9, 0x50, 0x1a, 0xfb, 0x96, 0xb6, 0x18, 0x5d, - 0x40, 0x68, 0x3f, 0x54, 0x38, 0x88, 0x82, 0x61, 0xfb, 0xec, 0x34, 0xfe, 0xe5, 0x15, 0xef, 0xfa, - 0xa4, 0x4e, 0x30, 0xf8, 0xf0, 0xa1, 0xb3, 0xdb, 0x42, 0x1d, 0xf0, 0x79, 0xe6, 0x6c, 0x7d, 0x9e, - 0xa1, 0x2e, 0xfc, 0x97, 0x94, 0x71, 0xa5, 0x65, 0xe5, 0x5c, 0xb7, 0xb5, 0x99, 0xa6, 0x20, 0x39, - 0xc5, 0xc1, 0x66, 0x1a, 0x83, 0x0d, 0xa7, 0x09, 0x53, 0xb8, 0x11, 0x05, 0x86, 0x33, 0x18, 0x1d, - 0x43, 0x98, 0x71, 0x46, 0x95, 0xc6, 0xff, 0xec, 0x4b, 0x57, 0x99, 0xb7, 0x8a, 0x3f, 0x53, 0x1c, - 0x46, 0xde, 0x30, 0x48, 0x2d, 0x46, 0x7d, 0x68, 0x4b, 0x5a, 0x8a, 0x27, 0x27, 0x68, 0x5a, 0x01, - 0x18, 0x6a, 0xb2, 0x11, 0xdd, 0x41, 0xb8, 0x20, 0x15, 0x95, 0x0a, 0xb7, 0x6c, 0xdc, 0xf1, 0x9f, - 0x71, 0x7f, 0x94, 0xb7, 0x46, 0x9d, 0xba, 0x4f, 0xba, 0x0a, 0x0e, 0xf7, 0xb4, 0xcd, 0x68, 0x4b, - 0xb9, 0x50, 0x6e, 0x11, 0x16, 0xa3, 0x13, 0x68, 0xe5, 0x34, 0xe3, 0xe4, 0xa1, 0x2a, 0xa9, 0xdb, - 0x45, 0x4d, 0x7c, 0x0b, 0x19, 0xec, 0x0d, 0xd9, 0xa8, 0x43, 0x5e, 0x5d, 0xbe, 0xae, 0x7b, 0xde, - 0xdb, 0xba, 0xe7, 0xbd, 0xaf, 0x7b, 0xde, 0xe3, 0x88, 0x71, 0x3d, 0x5f, 0x4e, 0xe3, 0x99, 0xc8, - 0x93, 0x09, 0xd1, 0x64, 0x22, 0x58, 0x42, 0x18, 0x2d, 0xf4, 0xa8, 0xdc, 0x1c, 0x44, 0xb2, 0x1a, - 0xd7, 0x07, 0x35, 0x0d, 0xed, 0x45, 0x9d, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x56, 0xbd, 0x76, - 0x6a, 0x74, 0x02, 0x00, 0x00, + // 419 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xc1, 0xca, 0xd3, 0x40, + 0x10, 0x66, 0x93, 0x98, 0xff, 0xef, 0x54, 0x7e, 0x71, 0x45, 0x59, 0x8a, 0xb4, 0xb1, 0xa7, 0x5c, + 0x9a, 0x60, 0xa5, 0x07, 0xf1, 0xa4, 0xf6, 0x22, 0x28, 0x4a, 0xf4, 0xe4, 0x45, 0xb6, 0xc9, 0xb2, + 0x5d, 0x68, 0xb2, 0x61, 0x77, 0x5b, 0x88, 0x27, 0x5f, 0xc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16, + 0xdc, 0xb8, 0x02, 0xb0, 0xd4, 0xf2, 0x50, 0xf4, 0x1a, 0x3c, 0xa9, 0xc9, 0x6d, 0x84, 0xe2, 0xe1, + 0xfc, 0xf9, 0xd5, 0xaf, 0x26, 0x1f, 0x6b, 0xa6, 0xa8, 0x11, 0x15, 0xff, 0xdc, 0x68, 0xc3, 0xca, + 0xcc, 0x93, 0x1a, 0x7f, 0x80, 0x70, 0x43, 0x1b, 0xa6, 0x34, 0x19, 0xb8, 0x8d, 0x2d, 0xae, 0xb7, + 0xe9, 0x87, 0xef, 0x6d, 0x75, 0xd6, 0x36, 0x19, 0xe5, 0xf0, 0xe0, 0x1f, 0x95, 0xd3, 0x66, 0xd0, + 0xd9, 0x66, 0xce, 0x5c, 0xf5, 0xfa, 0xae, 0x4e, 0xe1, 0x3e, 0x55, 0xf9, 0x5a, 0x18, 0x96, 0x9b, + 0xad, 0x3a, 0xee, 0xb3, 0xc7, 0x8d, 0x34, 0x3c, 0xba, 0x30, 0x83, 0x15, 0xda, 0xaa, 0x8d, 0x3e, + 0x0a, 0x59, 0x8c, 0x9f, 0xc2, 0xa0, 0x64, 0x85, 0xa0, 0x5f, 0x9a, 0x9a, 0xb5, 0x52, 0x1d, 0x71, + 0x66, 0x86, 0x7f, 0xd1, 0x8c, 0xa0, 0x33, 0xe3, 0xcd, 0xab, 0x5f, 0xfb, 0x31, 0xfa, 0xbd, 0x1f, + 0xa3, 0x3f, 0xfb, 0x31, 0xfa, 0x3a, 0xe3, 0xc2, 0xac, 0xb7, 0xab, 0x24, 0x97, 0x65, 0xba, 0xa4, + 0x86, 0x2e, 0x25, 0x4f, 0x29, 0x67, 0x95, 0x99, 0xd5, 0x87, 0xc3, 0x4d, 0x77, 0x8b, 0xee, 0xf0, + 0x57, 0xa1, 0xbb, 0xfc, 0x17, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x24, 0x03, 0x04, 0x1c, + 0x03, 0x00, 0x00, } diff --git a/proto/contimage/contimage.proto b/proto/contimage/contimage.proto index ad1022fe..165cfd43 100644 --- a/proto/contimage/contimage.proto +++ b/proto/contimage/contimage.proto @@ -6,35 +6,35 @@ package datadog.contimage; // ContainerImagePayload represents the main container image payload message ContainerImagePayload { - string version = 1; // version represents the ContainerImagePayload message version - string host = 2; // host contains the hostname - repeated ContainerImage images = 3; // Images metadata + string version = 1; // version represents the ContainerImagePayload message version + string host = 2; // host contains the hostname + repeated ContainerImage images = 3; // Images metadata // repeated VulneratibilityReport reports = 4; // vulneratibility reports } // ContainerImage contains the details of a container image message ContainerImage { - string id = 1; - string registry = 2; - string name = 3; - repeated string tags = 4; - string digest = 5; - int64 size = 6; - string repo_digest = 7; - - // # platform info - // message OperatingSystem { - // string name = 1; - // string version = 2; - // string architecture = 3; - // } - // optional OperatingSystem os = 8 + string id = 1; + string registry = 2; + string name = 3; + repeated string tags = 4; + string digest = 5; + int64 size = 6; + string repo_digest = 7; + + // platform info + message OperatingSystem { + string name = 1; + string version = 2; + string architecture = 3; + } + OperatingSystem os = 8; message ContainerImageLayer { - string urls = 1; + string urls = 1; string mediaType = 2; - string digest = 3; - int64 size = 4; + string digest = 3; + int64 size = 4; } repeated ContainerImageLayer layers = 9; From 5339aa25900084684072b512ec0d6b512960666f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Fri, 2 Dec 2022 15:44:24 +0100 Subject: [PATCH 3/5] Rename `name` to `short_name`, add missing `repeated` for `urls` --- contimage/contimage.pb.go | 114 ++++++++++++++++++-------------- proto/contimage/contimage.proto | 10 +-- 2 files changed, 68 insertions(+), 56 deletions(-) diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go index a860be7b..9d77179e 100644 --- a/contimage/contimage.pb.go +++ b/contimage/contimage.pb.go @@ -67,7 +67,7 @@ func (m *ContainerImagePayload) GetImages() []*ContainerImage { type ContainerImage struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Registry string `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` Size_ int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` @@ -95,9 +95,9 @@ func (m *ContainerImage) GetRegistry() string { return "" } -func (m *ContainerImage) GetName() string { +func (m *ContainerImage) GetShortName() string { if m != nil { - return m.Name + return m.ShortName } return "" } @@ -180,10 +180,10 @@ func (m *ContainerImage_OperatingSystem) GetArchitecture() string { } type ContainerImage_ContainerImageLayer struct { - Urls string `protobuf:"bytes,1,opt,name=urls,proto3" json:"urls,omitempty"` - MediaType string `protobuf:"bytes,2,opt,name=mediaType,proto3" json:"mediaType,omitempty"` - Digest string `protobuf:"bytes,3,opt,name=digest,proto3" json:"digest,omitempty"` - Size_ int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Urls []string `protobuf:"bytes,1,rep,name=urls" json:"urls,omitempty"` + MediaType string `protobuf:"bytes,2,opt,name=mediaType,proto3" json:"mediaType,omitempty"` + Digest string `protobuf:"bytes,3,opt,name=digest,proto3" json:"digest,omitempty"` + Size_ int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` } func (m *ContainerImage_ContainerImageLayer) Reset() { *m = ContainerImage_ContainerImageLayer{} } @@ -193,11 +193,11 @@ func (*ContainerImage_ContainerImageLayer) Descriptor() ([]byte, []int) { return fileDescriptorContimage, []int{1, 1} } -func (m *ContainerImage_ContainerImageLayer) GetUrls() string { +func (m *ContainerImage_ContainerImageLayer) GetUrls() []string { if m != nil { return m.Urls } - return "" + return nil } func (m *ContainerImage_ContainerImageLayer) GetMediaType() string { @@ -296,11 +296,11 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContimage(dAtA, i, uint64(len(m.Registry))) i += copy(dAtA[i:], m.Registry) } - if len(m.Name) > 0 { + if len(m.ShortName) > 0 { dAtA[i] = 0x1a i++ - i = encodeVarintContimage(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i = encodeVarintContimage(dAtA, i, uint64(len(m.ShortName))) + i += copy(dAtA[i:], m.ShortName) } if len(m.Tags) > 0 { for _, s := range m.Tags { @@ -411,10 +411,19 @@ func (m *ContainerImage_ContainerImageLayer) MarshalTo(dAtA []byte) (int, error) var l int _ = l if len(m.Urls) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintContimage(dAtA, i, uint64(len(m.Urls))) - i += copy(dAtA[i:], m.Urls) + for _, s := range m.Urls { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } if len(m.MediaType) > 0 { dAtA[i] = 0x12 @@ -476,7 +485,7 @@ func (m *ContainerImage) Size() (n int) { if l > 0 { n += 1 + l + sovContimage(uint64(l)) } - l = len(m.Name) + l = len(m.ShortName) if l > 0 { n += 1 + l + sovContimage(uint64(l)) } @@ -531,9 +540,11 @@ func (m *ContainerImage_OperatingSystem) Size() (n int) { func (m *ContainerImage_ContainerImageLayer) Size() (n int) { var l int _ = l - l = len(m.Urls) - if l > 0 { - n += 1 + l + sovContimage(uint64(l)) + if len(m.Urls) > 0 { + for _, s := range m.Urls { + l = len(s) + n += 1 + l + sovContimage(uint64(l)) + } } l = len(m.MediaType) if l > 0 { @@ -790,7 +801,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ShortName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -815,7 +826,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.ShortName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -1201,7 +1212,7 @@ func (m *ContainerImage_ContainerImageLayer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Urls = string(dAtA[iNdEx:postIndex]) + m.Urls = append(m.Urls, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { @@ -1409,32 +1420,33 @@ var ( func init() { proto.RegisterFile("proto/contimage/contimage.proto", fileDescriptorContimage) } var fileDescriptorContimage = []byte{ - // 419 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xc1, 0xca, 0xd3, 0x40, - 0x10, 0x66, 0x93, 0x98, 0xff, 0xef, 0x54, 0x7e, 0x71, 0x45, 0x59, 0x8a, 0xb4, 0xb1, 0xa7, 0x5c, - 0x9a, 0x60, 0xa5, 0x07, 0xf1, 0xa4, 0xf6, 0x22, 0x28, 0x4a, 0xf4, 0xe4, 0x45, 0xb6, 0xc9, 0xb2, - 0x5d, 0x68, 0xb2, 0x61, 0x77, 0x5b, 0x88, 0x27, 0x5f, 0xc4, 0xf7, 0xf1, 0xe8, 0x23, 0x48, 0x9f, - 0x44, 0x76, 0x9b, 0x36, 0x8d, 0x16, 0x7a, 0xfb, 0xe6, 0x9b, 0x9d, 0xf9, 0x66, 0xe7, 0x1b, 0x98, - 0xd4, 0x4a, 0x1a, 0x99, 0xe6, 0xb2, 0x32, 0xa2, 0xa4, 0x9c, 0x75, 0x28, 0x71, 0x19, 0xfc, 0xb0, - 0xa0, 0x86, 0x16, 0x92, 0x27, 0xa7, 0xc4, 0xf4, 0x07, 0x82, 0xc7, 0x6f, 0x65, 0x65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 0x6d, 0x75, 0xd6, 0x36, 0x19, 0xe5, 0xf0, 0xe0, 0x1f, 0x95, 0xd3, 0x66, 0xd0, - 0xd9, 0x66, 0xce, 0x5c, 0xf5, 0xfa, 0xae, 0x4e, 0xe1, 0x3e, 0x55, 0xf9, 0x5a, 0x18, 0x96, 0x9b, - 0xad, 0x3a, 0xee, 0xb3, 0xc7, 0x8d, 0x34, 0x3c, 0xba, 0x30, 0x83, 0x15, 0xda, 0xaa, 0x8d, 0x3e, - 0x0a, 0x59, 0x8c, 0x9f, 0xc2, 0xa0, 0x64, 0x85, 0xa0, 0x5f, 0x9a, 0x9a, 0xb5, 0x52, 0x1d, 0x71, - 0x66, 0x86, 0x7f, 0xd1, 0x8c, 0xa0, 0x33, 0xe3, 0xcd, 0xab, 0x5f, 0xfb, 0x31, 0xfa, 0xbd, 0x1f, - 0xa3, 0x3f, 0xfb, 0x31, 0xfa, 0x3a, 0xe3, 0xc2, 0xac, 0xb7, 0xab, 0x24, 0x97, 0x65, 0xba, 0xa4, - 0x86, 0x2e, 0x25, 0x4f, 0x29, 0x67, 0x95, 0x99, 0xd5, 0x87, 0xc3, 0x4d, 0x77, 0x8b, 0xee, 0xf0, - 0x57, 0xa1, 0xbb, 0xfc, 0x17, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x24, 0x03, 0x04, 0x1c, - 0x03, 0x00, 0x00, + // 436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcd, 0x6e, 0x13, 0x31, + 0x10, 0x96, 0x77, 0xc3, 0xb6, 0x99, 0xa0, 0x22, 0x8c, 0x40, 0x56, 0x04, 0xe9, 0x92, 0x53, 0x2e, + 0xdd, 0x88, 0xa2, 0x1e, 0x10, 0x27, 0x20, 0x17, 0x24, 0xfe, 0xb4, 0x70, 0xe2, 0x52, 0xb9, 0xbb, + 0x23, 0xc7, 0x52, 0x76,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 0x7f, + 0xe0, 0x22, 0x09, 0x9f, 0xe0, 0xe5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x07, 0xc9, 0x9e, + 0x27, 0x03, 0x00, 0x00, } diff --git a/proto/contimage/contimage.proto b/proto/contimage/contimage.proto index 165cfd43..84e7f844 100644 --- a/proto/contimage/contimage.proto +++ b/proto/contimage/contimage.proto @@ -16,7 +16,7 @@ message ContainerImagePayload { message ContainerImage { string id = 1; string registry = 2; - string name = 3; + string short_name = 3; repeated string tags = 4; string digest = 5; int64 size = 6; @@ -31,10 +31,10 @@ message ContainerImage { OperatingSystem os = 8; message ContainerImageLayer { - string urls = 1; - string mediaType = 2; - string digest = 3; - int64 size = 4; + repeated string urls = 1; + string mediaType = 2; + string digest = 3; + int64 size = 4; } repeated ContainerImageLayer layers = 9; From f43438fb6c0cc98ae74e880fc2d803db94188f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Wed, 7 Dec 2022 15:18:04 +0100 Subject: [PATCH 4/5] Make `repo_digest` a slice to be consistent with what containerd returns. --- contimage/contimage.pb.go | 113 ++++++++++++++++++-------------- proto/contimage/contimage.proto | 14 ++-- 2 files changed, 69 insertions(+), 58 deletions(-) diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go index 9d77179e..cc85ebfc 100644 --- a/contimage/contimage.pb.go +++ b/contimage/contimage.pb.go @@ -65,15 +65,15 @@ func (m *ContainerImagePayload) GetImages() []*ContainerImage { // ContainerImage contains the details of a container image type ContainerImage struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Registry string `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` - ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` - Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` - Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` - Size_ int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` - RepoDigest string `protobuf:"bytes,7,opt,name=repo_digest,json=repoDigest,proto3" json:"repo_digest,omitempty"` - Os *ContainerImage_OperatingSystem `protobuf:"bytes,8,opt,name=os" json:"os,omitempty"` - Layers []*ContainerImage_ContainerImageLayer `protobuf:"bytes,9,rep,name=layers" json:"layers,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Registry string `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` + ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` + Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` + Size_ int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` + RepoDigests []string `protobuf:"bytes,7,rep,name=repo_digests,json=repoDigests" json:"repo_digests,omitempty"` + Os *ContainerImage_OperatingSystem `protobuf:"bytes,8,opt,name=os" json:"os,omitempty"` + Layers []*ContainerImage_ContainerImageLayer `protobuf:"bytes,9,rep,name=layers" json:"layers,omitempty"` } func (m *ContainerImage) Reset() { *m = ContainerImage{} } @@ -123,11 +123,11 @@ func (m *ContainerImage) GetSize_() int64 { return 0 } -func (m *ContainerImage) GetRepoDigest() string { +func (m *ContainerImage) GetRepoDigests() []string { if m != nil { - return m.RepoDigest + return m.RepoDigests } - return "" + return nil } func (m *ContainerImage) GetOs() *ContainerImage_OperatingSystem { @@ -328,11 +328,20 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintContimage(dAtA, i, uint64(m.Size_)) } - if len(m.RepoDigest) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintContimage(dAtA, i, uint64(len(m.RepoDigest))) - i += copy(dAtA[i:], m.RepoDigest) + if len(m.RepoDigests) > 0 { + for _, s := range m.RepoDigests { + dAtA[i] = 0x3a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } if m.Os != nil { dAtA[i] = 0x42 @@ -502,9 +511,11 @@ func (m *ContainerImage) Size() (n int) { if m.Size_ != 0 { n += 1 + sovContimage(uint64(m.Size_)) } - l = len(m.RepoDigest) - if l > 0 { - n += 1 + l + sovContimage(uint64(l)) + if len(m.RepoDigests) > 0 { + for _, s := range m.RepoDigests { + l = len(s) + n += 1 + l + sovContimage(uint64(l)) + } } if m.Os != nil { l = m.Os.Size() @@ -907,7 +918,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RepoDigest", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RepoDigests", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -932,7 +943,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RepoDigest = string(dAtA[iNdEx:postIndex]) + m.RepoDigests = append(m.RepoDigests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 8: if wireType != 2 { @@ -1420,33 +1431,33 @@ var ( func init() { proto.RegisterFile("proto/contimage/contimage.proto", fileDescriptorContimage) } var fileDescriptorContimage = []byte{ - // 436 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0x96, 0x77, 0xc3, 0xb6, 0x99, 0xa0, 0x22, 0x8c, 0x40, 0x56, 0x04, 0xe9, 0x92, 0x53, 0x2e, - 0xdd, 0x88, 0xa2, 0x1e, 0x10, 0x27, 0x20, 0x17, 0x24, 0xfe, 0xb4, 0x70, 0xe2, 0x52, 0xb9, 0xbb, - 0x23, 0xc7, 0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cf, 0x76, 0x7f, - 0xe0, 0x22, 0x09, 0x9f, 0xe0, 0xe5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x07, 0xc9, 0x9e, - 0x27, 0x03, 0x00, 0x00, + // 438 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcd, 0x6e, 0xd4, 0x30, + 0x10, 0x96, 0x93, 0x25, 0xed, 0xce, 0x56, 0x45, 0x18, 0x81, 0xac, 0x15, 0x2c, 0xe9, 0x9e, 0xf6, + 0xd2, 0x44, 0x14, 0xf5, 0x80, 0x38, 0x01, 0x7b, 0x41, 0xe2, 0x4f, 0x81, 0x13, 0x97, 0xca, 0x4d, + 0x2c, 0xc7, 0xd2, 0x26, 0x8e, 0xec, 0xd9, 0x4a, 0xe1, 0xc4, 0xf3, 0xf0, 0x24, 0x1c, 0x79, 0x04, + 0xb4, 0x4f, 0x82, 0xec, 0xa4, 0x4d, 0x03, 0x95, 0xf6, 0xf6, 0xcd, 0x37, 0xe3, 0xf9, 0xc6, 0xf3, + 0xd9, 0xf0, 0xac, 0x31, 0x1a, 0x75, 0x9a, 0xeb, 0x1a, 0x55, 0xc5, 0xa5, 0x18, 0x50, 0xe2, 0x33, + 0xf4, 0x41, 0xc1, 0x91, 0x17, 0x5a, 0x26, 0x37, 0x89, 0xe5, 0x0f, 0x02, 0x8f, 0xde, 0xea, 0x1a, + 0xb9, 0xaa, 0x85, 0x79, 0xe7, 0xa8, 0xcf, 0xbc, 0xdd, 0x68, 0x5e, 0x50, 0x06, 0x07, 0x57, 0xc2, + 0x58, 0xa5, 0x6b, 0x46, 0x62, 0xb2, 0x9a, 0x66, 0xd7, 0x21, 0xa5, 0x30, 0x29, 0xb5, 0x45, 0x16, + 0x78, 0xda, 0x63, 0xfa, 0x12, 0x22, 0xdf, 0xd0, 0xb2, 0x30, 0x0e, 0x57, 0xb3, 0xb3, 0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, 0x88, 0x9b, 0x5b, 0x78, 0x78, 0xc7, 0x0c, 0x4e, 0x68, 0x6b, 0x36, 0x96, + 0x91, 0x6e, 0xe1, 0x0e, 0xd3, 0x27, 0x30, 0xad, 0x44, 0xa1, 0xf8, 0xd7, 0xb6, 0x11, 0xbd, 0xd4, + 0x40, 0xdc, 0xb2, 0x23, 0xbc, 0xd3, 0x8e, 0xc9, 0x60, 0xc7, 0x9b, 0x57, 0xbf, 0x76, 0x0b, 0xf2, + 0x7b, 0xb7, 0x20, 0x7f, 0x76, 0x0b, 0xf2, 0xed, 0x54, 0x2a, 0x2c, 0xb7, 0x97, 0x49, 0xae, 0xab, + 0x74, 0xcd, 0x91, 0xaf, 0xb5, 0x4c, 0xb9, 0x14, 0x35, 0x9e, 0x36, 0xdd, 0x2b, 0x4e, 0xaf, 0xce, + 0x87, 0x5f, 0x70, 0x19, 0xf9, 0x6f, 0xf0, 0xe2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x8f, + 0x05, 0x21, 0x29, 0x03, 0x00, 0x00, } diff --git a/proto/contimage/contimage.proto b/proto/contimage/contimage.proto index 84e7f844..72092f64 100644 --- a/proto/contimage/contimage.proto +++ b/proto/contimage/contimage.proto @@ -14,13 +14,13 @@ message ContainerImagePayload { // ContainerImage contains the details of a container image message ContainerImage { - string id = 1; - string registry = 2; - string short_name = 3; - repeated string tags = 4; - string digest = 5; - int64 size = 6; - string repo_digest = 7; + string id = 1; + string registry = 2; + string short_name = 3; + repeated string tags = 4; + string digest = 5; + int64 size = 6; + repeated string repo_digests = 7; // platform info message OperatingSystem { From f4f9622bf37230f88ac3e92a9a18e808925989b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Tue, 3 Jan 2023 11:01:04 +0100 Subject: [PATCH 5/5] Add `name` field in addition to `registry` and `short_name` --- contimage/contimage.pb.go | 151 +++++++++++++++++++++----------- proto/contimage/contimage.proto | 31 ++----- 2 files changed, 108 insertions(+), 74 deletions(-) diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go index cc85ebfc..f6a13ba0 100644 --- a/contimage/contimage.pb.go +++ b/contimage/contimage.pb.go @@ -66,14 +66,15 @@ func (m *ContainerImagePayload) GetImages() []*ContainerImage { // ContainerImage contains the details of a container image type ContainerImage struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Registry string `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` - ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` - Tags []string `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` - Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` - Size_ int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` - RepoDigests []string `protobuf:"bytes,7,rep,name=repo_digests,json=repoDigests" json:"repo_digests,omitempty"` - Os *ContainerImage_OperatingSystem `protobuf:"bytes,8,opt,name=os" json:"os,omitempty"` - Layers []*ContainerImage_ContainerImageLayer `protobuf:"bytes,9,rep,name=layers" json:"layers,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Registry string `protobuf:"bytes,3,opt,name=registry,proto3" json:"registry,omitempty"` + ShortName string `protobuf:"bytes,4,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` + Tags []string `protobuf:"bytes,5,rep,name=tags" json:"tags,omitempty"` + Digest string `protobuf:"bytes,6,opt,name=digest,proto3" json:"digest,omitempty"` + Size_ int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` + RepoDigests []string `protobuf:"bytes,8,rep,name=repo_digests,json=repoDigests" json:"repo_digests,omitempty"` + Os *ContainerImage_OperatingSystem `protobuf:"bytes,9,opt,name=os" json:"os,omitempty"` + Layers []*ContainerImage_ContainerImageLayer `protobuf:"bytes,10,rep,name=layers" json:"layers,omitempty"` } func (m *ContainerImage) Reset() { *m = ContainerImage{} } @@ -88,6 +89,13 @@ func (m *ContainerImage) GetId() string { return "" } +func (m *ContainerImage) GetName() string { + if m != nil { + return m.Name + } + return "" +} + func (m *ContainerImage) GetRegistry() string { if m != nil { return m.Registry @@ -290,21 +298,27 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContimage(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } - if len(m.Registry) > 0 { + if len(m.Name) > 0 { dAtA[i] = 0x12 i++ + i = encodeVarintContimage(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.Registry) > 0 { + dAtA[i] = 0x1a + i++ i = encodeVarintContimage(dAtA, i, uint64(len(m.Registry))) i += copy(dAtA[i:], m.Registry) } if len(m.ShortName) > 0 { - dAtA[i] = 0x1a + dAtA[i] = 0x22 i++ i = encodeVarintContimage(dAtA, i, uint64(len(m.ShortName))) i += copy(dAtA[i:], m.ShortName) } if len(m.Tags) > 0 { for _, s := range m.Tags { - dAtA[i] = 0x22 + dAtA[i] = 0x2a i++ l = len(s) for l >= 1<<7 { @@ -318,19 +332,19 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { } } if len(m.Digest) > 0 { - dAtA[i] = 0x2a + dAtA[i] = 0x32 i++ i = encodeVarintContimage(dAtA, i, uint64(len(m.Digest))) i += copy(dAtA[i:], m.Digest) } if m.Size_ != 0 { - dAtA[i] = 0x30 + dAtA[i] = 0x38 i++ i = encodeVarintContimage(dAtA, i, uint64(m.Size_)) } if len(m.RepoDigests) > 0 { for _, s := range m.RepoDigests { - dAtA[i] = 0x3a + dAtA[i] = 0x42 i++ l = len(s) for l >= 1<<7 { @@ -344,7 +358,7 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { } } if m.Os != nil { - dAtA[i] = 0x42 + dAtA[i] = 0x4a i++ i = encodeVarintContimage(dAtA, i, uint64(m.Os.Size())) n1, err := m.Os.MarshalTo(dAtA[i:]) @@ -355,7 +369,7 @@ func (m *ContainerImage) MarshalTo(dAtA []byte) (int, error) { } if len(m.Layers) > 0 { for _, msg := range m.Layers { - dAtA[i] = 0x4a + dAtA[i] = 0x52 i++ i = encodeVarintContimage(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) @@ -490,6 +504,10 @@ func (m *ContainerImage) Size() (n int) { if l > 0 { n += 1 + l + sovContimage(uint64(l)) } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovContimage(uint64(l)) + } l = len(m.Registry) if l > 0 { n += 1 + l + sovContimage(uint64(l)) @@ -782,6 +800,35 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContimage + } + 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 ErrInvalidLengthContimage + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Registry", wireType) } @@ -810,7 +857,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } m.Registry = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ShortName", wireType) } @@ -839,7 +886,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } m.ShortName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) } @@ -868,7 +915,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } m.Tags = append(m.Tags, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) } @@ -897,7 +944,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } m.Digest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) } @@ -916,7 +963,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { break } } - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RepoDigests", wireType) } @@ -945,7 +992,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { } m.RepoDigests = append(m.RepoDigests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 8: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Os", wireType) } @@ -978,7 +1025,7 @@ func (m *ContainerImage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Layers", wireType) } @@ -1431,33 +1478,33 @@ var ( func init() { proto.RegisterFile("proto/contimage/contimage.proto", fileDescriptorContimage) } var fileDescriptorContimage = []byte{ - // 438 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcd, 0x6e, 0xd4, 0x30, - 0x10, 0x96, 0x93, 0x25, 0xed, 0xce, 0x56, 0x45, 0x18, 0x81, 0xac, 0x15, 0x2c, 0xe9, 0x9e, 0xf6, - 0xd2, 0x44, 0x14, 0xf5, 0x80, 0x38, 0x01, 0x7b, 0x41, 0xe2, 0x4f, 0x81, 0x13, 0x97, 0xca, 0x4d, - 0x2c, 0xc7, 0xd2, 0x26, 0x8e, 0xec, 0xd9, 0x4a, 0xe1, 0xc4, 0xf3, 0xf0, 0x24, 0x1c, 0x79, 0x04, - 0xb4, 0x4f, 0x82, 0xec, 0xa4, 0x4d, 0x03, 0x95, 0xf6, 0xf6, 0xcd, 0x37, 0xe3, 0xf9, 0xc6, 0xf3, - 0xd9, 0xf0, 0xac, 0x31, 0x1a, 0x75, 0x9a, 0xeb, 0x1a, 0x55, 0xc5, 0xa5, 0x18, 0x50, 0xe2, 0x33, - 0xf4, 0x41, 0xc1, 0x91, 0x17, 0x5a, 0x26, 0x37, 0x89, 0xe5, 0x0f, 0x02, 0x8f, 0xde, 0xea, 0x1a, - 0xb9, 0xaa, 0x85, 0x79, 0xe7, 0xa8, 0xcf, 0xbc, 0xdd, 0x68, 0x5e, 0x50, 0x06, 0x07, 0x57, 0xc2, - 0x58, 0xa5, 0x6b, 0x46, 0x62, 0xb2, 0x9a, 0x66, 0xd7, 0x21, 0xa5, 0x30, 0x29, 0xb5, 0x45, 0x16, - 0x78, 0xda, 0x63, 0xfa, 0x12, 0x22, 0xdf, 0xd0, 0xb2, 0x30, 0x0e, 0x57, 0xb3, 0xb3, 0x93, 0xe4, - 0x3f, 0xad, 0x64, 0xac, 0x93, 0xf5, 0x07, 0x96, 0x3f, 0x27, 0x70, 0x3c, 0x4e, 0xd1, 0x63, 0x08, - 0x54, 0xd1, 0xcb, 0x06, 0xaa, 0xa0, 0x73, 0x38, 0x34, 0x42, 0x2a, 0x8b, 0xa6, 0xed, 0x55, 0x6f, - 0x62, 0xfa, 0x14, 0xc0, 0x96, 0xda, 0xe0, 0x45, 0xcd, 0x2b, 0xc1, 0x42, 0x9f, 0x9d, 0x7a, 0xe6, - 0x23, 0xaf, 0x84, 0x1b, 0x16, 0xb9, 0xb4, 0x6c, 0x12, 0x87, 0x6e, 0x58, 0x87, 0xe9, 0x63, 0x88, - 0x0a, 0x25, 0x85, 0x45, 0x76, 0xcf, 0x97, 0xf7, 0x91, 0xab, 0xb5, 0xea, 0xbb, 0x60, 0x51, 0x4c, -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 0xf9, 0x6f, 0xf0, 0xe2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x8f, - 0x05, 0x21, 0x29, 0x03, 0x00, 0x00, + // 440 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x4d, 0x6f, 0xd3, 0x40, + 0x14, 0xd4, 0xda, 0xc6, 0x6d, 0x5e, 0xaa, 0x22, 0x16, 0x81, 0x56, 0x11, 0x04, 0x37, 0xa7, 0x5c, + 0xea, 0x88, 0xa2, 0x1e, 0x10, 0x27, 0x20, 0x17, 0x24, 0xbe, 0x64, 0x38, 0x71, 0xa9, 0xb6, 0xf6, + 0x6a, 0xb3, 0x52, 0xec, 0xb5, 0x76, 0x5f, 0x2a, 0x99, 0x13, 0xbf, 0x8c, 0x33, 0x47, 0x7e, 0x02, + 0xca, 0x2f, 0x41, 0xbb, 0x76, 0xe2, 0x18, 0x2a, 0xf5, 0x36, 0x6f, 0xde, 0xc7, 0x58, 0x33, 0x5e, + 0x78, 0x56, 0x1b, 0x8d, 0x7a, 0x91, 0xeb, 0x0a, 0x55, 0xc9, 0xa5, 0xe8, 0x51, 0xea, 0x3b, 0xf4, + 0x41, 0xc1, 0x91, 0x17, 0x5a, 0xa6, 0xfb, 0xc6, 0xec, 0x07, 0x81, 0x47, 0x6f, 0x75, 0x85, 0x5c, + 0x55, 0xc2, 0xbc, 0x73, 0xd4, 0x67, 0xde, 0xac, 0x35, 0x2f, 0x28, 0x83, 0xa3, 0x1b, 0x61, 0xac, + 0xd2, 0x15, 0x23, 0x09, 0x99, 0x8f, 0xb2, 0x5d, 0x49, 0x29, 0x44, 0x2b, 0x6d, 0x91, 0x05, 0x9e, + 0xf6, 0x98, 0xbe, 0x84, 0xd8, 0x1f, 0xb4, 0x2c, 0x4c, 0xc2, 0xf9, 0xf8, 0xe2, 0x2c, 0xfd, 0x4f, + 0x2b, 0x1d, 0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, 0xf0, 0xf0, 0x96, 0x6f, 0x70, 0x42, 0x1b, + 0xb3, 0xb6, 0x8c, 0xb4, 0x86, 0x3b, 0x4c, 0x9f, 0xc0, 0xa8, 0x14, 0x85, 0xe2, 0x5f, 0x9b, 0x7a, + 0x17, 0x6c, 0x4f, 0x1c, 0xc4, 0x11, 0xde, 0x1a, 0x47, 0xd4, 0xc7, 0xf1, 0xe6, 0xd5, 0xaf, 0xed, + 0x94, 0xfc, 0xde, 0x4e, 0xc9, 0x9f, 0xed, 0x94, 0x7c, 0x3b, 0x97, 0x0a, 0x57, 0x9b, 0xeb, 0x34, + 0xd7, 0xe5, 0x62, 0xc9, 0x91, 0x2f, 0xb5, 0x5c, 0x70, 0x29, 0x2a, 0x3c, 0xaf, 0xdb, 0x3f, 0x7b, + 0x71, 0x73, 0xd9, 0xbf, 0x8c, 0xeb, 0xd8, 0x3f, 0x8d, 0x17, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x44, 0x02, 0x51, 0x73, 0x3d, 0x03, 0x00, 0x00, } diff --git a/proto/contimage/contimage.proto b/proto/contimage/contimage.proto index 72092f64..440c3a17 100644 --- a/proto/contimage/contimage.proto +++ b/proto/contimage/contimage.proto @@ -9,18 +9,18 @@ message ContainerImagePayload { string version = 1; // version represents the ContainerImagePayload message version string host = 2; // host contains the hostname repeated ContainerImage images = 3; // Images metadata - // repeated VulneratibilityReport reports = 4; // vulneratibility reports } // ContainerImage contains the details of a container image message ContainerImage { string id = 1; - string registry = 2; - string short_name = 3; - repeated string tags = 4; - string digest = 5; - int64 size = 6; - repeated string repo_digests = 7; + string name = 2; + string registry = 3; + string short_name = 4; + repeated string tags = 5; + string digest = 6; + int64 size = 7; + repeated string repo_digests = 8; // platform info message OperatingSystem { @@ -28,7 +28,7 @@ message ContainerImage { string version = 2; string architecture = 3; } - OperatingSystem os = 8; + OperatingSystem os = 9; message ContainerImageLayer { repeated string urls = 1; @@ -36,18 +36,5 @@ message ContainerImage { string digest = 3; int64 size = 4; } - repeated ContainerImageLayer layers = 9; - - // optional ImageSBOM sbom = 10; - - // optional VulneratibilityReport vulns = 10; + repeated ContainerImageLayer layers = 10; } - -// // VulneratibilityReport container a -// message VulneratibilityReport { -// // TODO -// } - -// message ImageSBOM { -// // TODO -// }