From ac19d1ef662076d970fe4d5c5aec7f60d910d14d Mon Sep 17 00:00:00 2001 From: Steven Blumenthal Date: Thu, 16 Mar 2023 13:45:54 -0400 Subject: [PATCH 1/4] Add optionalExitTimestamp to contlcycle.PodEvent --- contlcycle/contlcycle.pb.go | 181 +++++++++++++++++++++++++----- proto/contlcycle/contlcycle.proto | 3 + 2 files changed, 155 insertions(+), 29 deletions(-) diff --git a/contlcycle/contlcycle.pb.go b/contlcycle/contlcycle.pb.go index 6f54b396..d02b1e86 100644 --- a/contlcycle/contlcycle.pb.go +++ b/contlcycle/contlcycle.pb.go @@ -405,6 +405,9 @@ func _ContainerEvent_OneofSizer(msg proto.Message) (n int) { type PodEvent struct { PodUID string `protobuf:"bytes,1,opt,name=podUID,proto3" json:"podUID,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + // Types that are valid to be assigned to OptionalExitTimestamp: + // *PodEvent_ExitTimestamp + OptionalExitTimestamp isPodEvent_OptionalExitTimestamp `protobuf_oneof:"optionalExitTimestamp"` } func (m *PodEvent) Reset() { *m = PodEvent{} } @@ -412,6 +415,25 @@ func (m *PodEvent) String() string { return proto.CompactTextString(m func (*PodEvent) ProtoMessage() {} func (*PodEvent) Descriptor() ([]byte, []int) { return fileDescriptorContlcycle, []int{3} } +type isPodEvent_OptionalExitTimestamp interface { + isPodEvent_OptionalExitTimestamp() + MarshalTo([]byte) (int, error) + Size() int +} + +type PodEvent_ExitTimestamp struct { + ExitTimestamp int64 `protobuf:"varint,3,opt,name=exitTimestamp,proto3,oneof"` +} + +func (*PodEvent_ExitTimestamp) isPodEvent_OptionalExitTimestamp() {} + +func (m *PodEvent) GetOptionalExitTimestamp() isPodEvent_OptionalExitTimestamp { + if m != nil { + return m.OptionalExitTimestamp + } + return nil +} + func (m *PodEvent) GetPodUID() string { if m != nil { return m.PodUID @@ -426,6 +448,63 @@ func (m *PodEvent) GetSource() string { return "" } +func (m *PodEvent) GetExitTimestamp() int64 { + if x, ok := m.GetOptionalExitTimestamp().(*PodEvent_ExitTimestamp); ok { + return x.ExitTimestamp + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PodEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PodEvent_OneofMarshaler, _PodEvent_OneofUnmarshaler, _PodEvent_OneofSizer, []interface{}{ + (*PodEvent_ExitTimestamp)(nil), + } +} + +func _PodEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PodEvent) + // optionalExitTimestamp + switch x := m.OptionalExitTimestamp.(type) { + case *PodEvent_ExitTimestamp: + _ = b.EncodeVarint(3<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.ExitTimestamp)) + case nil: + default: + return fmt.Errorf("PodEvent.OptionalExitTimestamp has unexpected type %T", x) + } + return nil +} + +func _PodEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PodEvent) + switch tag { + case 3: // optionalExitTimestamp.exitTimestamp + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.OptionalExitTimestamp = &PodEvent_ExitTimestamp{int64(x)} + return true, err + default: + return false, nil + } +} + +func _PodEvent_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PodEvent) + // optionalExitTimestamp + switch x := m.OptionalExitTimestamp.(type) { + case *PodEvent_ExitTimestamp: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.ExitTimestamp)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + func init() { proto.RegisterType((*EventsPayload)(nil), "datadog.contlcycle.EventsPayload") proto.RegisterType((*Event)(nil), "datadog.contlcycle.Event") @@ -624,9 +703,23 @@ func (m *PodEvent) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContlcycle(dAtA, i, uint64(len(m.Source))) i += copy(dAtA[i:], m.Source) } + if m.OptionalExitTimestamp != nil { + nn6, err := m.OptionalExitTimestamp.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += nn6 + } return i, nil } +func (m *PodEvent_ExitTimestamp) MarshalTo(dAtA []byte) (int, error) { + i := 0 + dAtA[i] = 0x18 + i++ + i = encodeVarintContlcycle(dAtA, i, uint64(m.ExitTimestamp)) + return i, nil +} func encodeVarintContlcycle(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -732,6 +825,16 @@ func (m *PodEvent) Size() (n int) { if l > 0 { n += 1 + l + sovContlcycle(uint64(l)) } + if m.OptionalExitTimestamp != nil { + n += m.OptionalExitTimestamp.Size() + } + return n +} + +func (m *PodEvent_ExitTimestamp) Size() (n int) { + var l int + _ = l + n += 1 + sovContlcycle(uint64(m.ExitTimestamp)) return n } @@ -1274,6 +1377,26 @@ func (m *PodEvent) Unmarshal(dAtA []byte) error { } m.Source = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitTimestamp", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContlcycle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.OptionalExitTimestamp = &PodEvent_ExitTimestamp{v} default: iNdEx = preIndex skippy, err := skipContlcycle(dAtA[iNdEx:]) @@ -1403,34 +1526,34 @@ var ( func init() { proto.RegisterFile("proto/contlcycle/contlcycle.proto", fileDescriptorContlcycle) } var fileDescriptorContlcycle = []byte{ - // 450 bytes of a gzipped FileDescriptorProto + // 460 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0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1f, 0x96, 0xb7, 0x5a, 0x87, 0xf0, 0x21, 0x34, 0x0b, 0xbe, 0x9d, 0x47, 0x54, 0xde, 0x6d, 0xd9, + 0xe1, 0x05, 0x9c, 0xd1, 0xb7, 0x44, 0x5d, 0x72, 0x4c, 0x3a, 0xea, 0xc9, 0xc8, 0x08, 0x2b, 0x04, + 0x9f, 0x41, 0x7b, 0x5d, 0x5f, 0x27, 0x33, 0x2a, 0x94, 0x9c, 0xe5, 0x76, 0xc3, 0x11, 0x7d, 0x73, + 0x24, 0xc2, 0x7d, 0x38, 0x40, 0xe8, 0x72, 0xae, 0x12, 0xce, 0x64, 0x7a, 0x55, 0x6a, 0x83, 0x73, + 0x78, 0x50, 0xc7, 0x2a, 0xb2, 0xfb, 0x1d, 0xce, 0xb6, 0x3b, 0x5f, 0xc7, 0xca, 0x39, 0xfe, 0x5c, + 0x65, 0x2e, 0xbb, 0xa3, 0x71, 0xef, 0x04, 0x32, 0x75, 0x20, 0xe3, 0xff, 0x40, 0xc7, 0xcc, 0x83, + 0xb7, 0x3f, 0x57, 0x3d, 0xf1, 0x6b, 0xd5, 0x13, 0xbf, 0x57, 0x3d, 0xf1, 0xc5, 0x9b, 0x26, 0xea, + 0xe6, 0x76, 0xe2, 0x45, 0x3c, 0x1b, 0x0c, 0xa5, 0x92, 0x43, 0x9e, 0x0e, 0xe4, 0x94, 0x32, 0xf5, + 0x22, 0xdf, 0xfc, 0xc6, 0x83, 0xc5, 0x9b, 0xda, 0x2b, 0x9b, 0x34, 0xf5, 0x33, 0x7b, 0xfd, 0x2f, + 0x00, 0x00, 0xff, 0xff, 0x13, 0x10, 0x44, 0x22, 0x8b, 0x03, 0x00, 0x00, } diff --git a/proto/contlcycle/contlcycle.proto b/proto/contlcycle/contlcycle.proto index c68b49fa..7e3ed086 100644 --- a/proto/contlcycle/contlcycle.proto +++ b/proto/contlcycle/contlcycle.proto @@ -44,4 +44,7 @@ message ContainerEvent { message PodEvent { string podUID = 1; // podUID contains the pod UID string source = 2; // source contains the pod source (kubelet) + oneof optionalExitTimestamp { + int64 exitTimestamp = 3; // exitTimestamp contains the exit timestamp of the pod + } } From 5682772a5eaa349074f85ced1a484cf05c9b6b7a Mon Sep 17 00:00:00 2001 From: Steven Blumenthal Date: Thu, 16 Mar 2023 13:49:29 -0400 Subject: [PATCH 2/4] Add unrelated autogen changes to fix CI --- contimage/contimage.pb.go | 2 +- cyclonedx_v1_4/bom-1.4.pb.go | 2 +- sbom/sbom.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go index 47bbe8c5..525706be 100644 --- a/contimage/contimage.pb.go +++ b/contimage/contimage.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/contimage/contimage.proto diff --git a/cyclonedx_v1_4/bom-1.4.pb.go b/cyclonedx_v1_4/bom-1.4.pb.go index 98c0e26f..a2acb8e4 100644 --- a/cyclonedx_v1_4/bom-1.4.pb.go +++ b/cyclonedx_v1_4/bom-1.4.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto diff --git a/sbom/sbom.pb.go b/sbom/sbom.pb.go index 4b03ea3f..e883277a 100644 --- a/sbom/sbom.pb.go +++ b/sbom/sbom.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/sbom/sbom.proto From 867a7d70f74d638ee9847d064b3297a44c069705 Mon Sep 17 00:00:00 2001 From: Steven Blumenthal Date: Thu, 16 Mar 2023 13:59:56 -0400 Subject: [PATCH 3/4] Use optional instead of oneof MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lénaïc Huard --- proto/contlcycle/contlcycle.proto | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/proto/contlcycle/contlcycle.proto b/proto/contlcycle/contlcycle.proto index 7e3ed086..0f76d706 100644 --- a/proto/contlcycle/contlcycle.proto +++ b/proto/contlcycle/contlcycle.proto @@ -44,7 +44,5 @@ message ContainerEvent { message PodEvent { string podUID = 1; // podUID contains the pod UID string source = 2; // source contains the pod source (kubelet) - oneof optionalExitTimestamp { - int64 exitTimestamp = 3; // exitTimestamp contains the exit timestamp of the pod - } + optional int64 exitTimestamp = 3; // exitTimestamp contains the exit timestamp of the pod } From 0e6977edc1fa0f56ac7ff5fd0e211ded1bd9e382 Mon Sep 17 00:00:00 2001 From: Steven Blumenthal Date: Fri, 17 Mar 2023 13:28:51 -0400 Subject: [PATCH 4/4] Re-generate code with optional type --- contimage/contimage.pb.go | 2 +- contlcycle/contlcycle.pb.go | 29 +++++++++++++++++++++-------- cyclonedx_v1_4/bom-1.4.pb.go | 2 +- sbom/sbom.pb.go | 2 +- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/contimage/contimage.pb.go b/contimage/contimage.pb.go index 8c38b0cb..525706be 100644 --- a/contimage/contimage.pb.go +++ b/contimage/contimage.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/contimage/contimage.proto diff --git a/contlcycle/contlcycle.pb.go b/contlcycle/contlcycle.pb.go index 00040b9d..035d6221 100644 --- a/contlcycle/contlcycle.pb.go +++ b/contlcycle/contlcycle.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/contlcycle/contlcycle.proto @@ -386,8 +386,9 @@ type PodEvent struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PodUID string `protobuf:"bytes,1,opt,name=podUID,proto3" json:"podUID,omitempty"` // podUID contains the pod UID - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // source contains the pod source (kubelet) + PodUID string `protobuf:"bytes,1,opt,name=podUID,proto3" json:"podUID,omitempty"` // podUID contains the pod UID + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // source contains the pod source (kubelet) + ExitTimestamp *int64 `protobuf:"varint,3,opt,name=exitTimestamp,proto3,oneof" json:"exitTimestamp,omitempty"` // exitTimestamp contains the exit timestamp of the pod } func (x *PodEvent) Reset() { @@ -436,6 +437,13 @@ func (x *PodEvent) GetSource() string { return "" } +func (x *PodEvent) GetExitTimestamp() int64 { + if x != nil && x.ExitTimestamp != nil { + return *x.ExitTimestamp + } + return 0 +} + var File_proto_contlcycle_contlcycle_proto protoreflect.FileDescriptor var file_proto_contlcycle_contlcycle_proto_rawDesc = []byte{ @@ -483,14 +491,18 @@ var file_proto_contlcycle_contlcycle_proto_rawDesc = []byte{ 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x12, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x0a, 0x08, 0x50, 0x6f, 0x64, 0x45, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x77, 0x0a, 0x08, 0x50, 0x6f, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x44, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x67, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x2d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x6c, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x0d, 0x65, 0x78, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x65, + 0x78, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x88, 0x01, 0x01, 0x42, + 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x44, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x67, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2d, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x6c, 0x63, 0x79, + 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -591,6 +603,7 @@ func file_proto_contlcycle_contlcycle_proto_init() { (*ContainerEvent_ExitCode)(nil), (*ContainerEvent_ExitTimestamp)(nil), } + file_proto_contlcycle_contlcycle_proto_msgTypes[3].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cyclonedx_v1_4/bom-1.4.pb.go b/cyclonedx_v1_4/bom-1.4.pb.go index 5f999bdd..a2acb8e4 100644 --- a/cyclonedx_v1_4/bom-1.4.pb.go +++ b/cyclonedx_v1_4/bom-1.4.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto diff --git a/sbom/sbom.pb.go b/sbom/sbom.pb.go index c2148ed8..e883277a 100644 --- a/sbom/sbom.pb.go +++ b/sbom/sbom.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: proto/sbom/sbom.proto