From 4b12472cc5007e0931238dd5e26f819e6be093b5 Mon Sep 17 00:00:00 2001 From: Simone Rodigari <32323373+SRodi@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:59:04 +0000 Subject: [PATCH] fix(protoc): update packagemanager to tdnf , re-run make proto-gen (#1106) # Description Update `Dockerfile.proto` as the image was changed a while ago and it broke `make proto-gen` since the wrong package manger was called. Also update `protoc-gen-go@v1.34.2` - which is the same version we used to generate `pkg/utils/metadata_linux.pb.go` ## Related Issue #1083 ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [x] I have updated the documentation, if necessary. - [x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --- controller/Dockerfile.proto | 7 +- pkg/utils/metadata_linux.pb.go | 137 +++++++++++++++++---------------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/controller/Dockerfile.proto b/controller/Dockerfile.proto index 0189b19376..a0843ce7d5 100644 --- a/controller/Dockerfile.proto +++ b/controller/Dockerfile.proto @@ -3,15 +3,14 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/oss/go/microsoft/golang@sha256: LABEL Name=retina-builder Version=0.0.1 -RUN apt-get update &&\ - apt-get -y install lsb-release wget software-properties-common gnupg file git make unzip +RUN tdnf install -y unzip WORKDIR /tmp -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2 RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v24.2/protoc-24.2-linux-x86_64.zip RUN unzip protoc-24.2-linux-x86_64.zip -d protoc RUN mv protoc/bin/protoc /usr/bin/protoc WORKDIR /app -ENTRYPOINT protoc -I=. --go_out=paths=source_relative:. ./pkg/utils/metadata.proto +ENTRYPOINT protoc -I=. --go_out=paths=source_relative:. ./pkg/utils/metadata_linux.proto diff --git a/pkg/utils/metadata_linux.pb.go b/pkg/utils/metadata_linux.pb.go index 28b2717b17..7455a1191a 100644 --- a/pkg/utils/metadata_linux.pb.go +++ b/pkg/utils/metadata_linux.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v3.19.1 -// source: metadata_linux.proto +// protoc v4.24.2 +// source: pkg/utils/metadata_linux.proto package utils @@ -53,11 +53,11 @@ func (x DNSType) String() string { } func (DNSType) Descriptor() protoreflect.EnumDescriptor { - return file_metadata_linux_proto_enumTypes[0].Descriptor() + return file_pkg_utils_metadata_linux_proto_enumTypes[0].Descriptor() } func (DNSType) Type() protoreflect.EnumType { - return &file_metadata_linux_proto_enumTypes[0] + return &file_pkg_utils_metadata_linux_proto_enumTypes[0] } func (x DNSType) Number() protoreflect.EnumNumber { @@ -66,7 +66,7 @@ func (x DNSType) Number() protoreflect.EnumNumber { // Deprecated: Use DNSType.Descriptor instead. func (DNSType) EnumDescriptor() ([]byte, []int) { - return file_metadata_linux_proto_rawDescGZIP(), []int{0} + return file_pkg_utils_metadata_linux_proto_rawDescGZIP(), []int{0} } // Ref: pkg/plugin/dropreason/_cprog/drop_reason.h. @@ -115,11 +115,11 @@ func (x DropReason) String() string { } func (DropReason) Descriptor() protoreflect.EnumDescriptor { - return file_metadata_linux_proto_enumTypes[1].Descriptor() + return file_pkg_utils_metadata_linux_proto_enumTypes[1].Descriptor() } func (DropReason) Type() protoreflect.EnumType { - return &file_metadata_linux_proto_enumTypes[1] + return &file_pkg_utils_metadata_linux_proto_enumTypes[1] } func (x DropReason) Number() protoreflect.EnumNumber { @@ -128,7 +128,7 @@ func (x DropReason) Number() protoreflect.EnumNumber { // Deprecated: Use DropReason.Descriptor instead. func (DropReason) EnumDescriptor() ([]byte, []int) { - return file_metadata_linux_proto_rawDescGZIP(), []int{1} + return file_pkg_utils_metadata_linux_proto_rawDescGZIP(), []int{1} } type RetinaMetadata struct { @@ -149,7 +149,7 @@ type RetinaMetadata struct { func (x *RetinaMetadata) Reset() { *x = RetinaMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_metadata_linux_proto_msgTypes[0] + mi := &file_pkg_utils_metadata_linux_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -162,7 +162,7 @@ func (x *RetinaMetadata) String() string { func (*RetinaMetadata) ProtoMessage() {} func (x *RetinaMetadata) ProtoReflect() protoreflect.Message { - mi := &file_metadata_linux_proto_msgTypes[0] + mi := &file_pkg_utils_metadata_linux_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -175,7 +175,7 @@ func (x *RetinaMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use RetinaMetadata.ProtoReflect.Descriptor instead. func (*RetinaMetadata) Descriptor() ([]byte, []int) { - return file_metadata_linux_proto_rawDescGZIP(), []int{0} + return file_pkg_utils_metadata_linux_proto_rawDescGZIP(), []int{0} } func (x *RetinaMetadata) GetBytes() uint32 { @@ -213,62 +213,63 @@ func (x *RetinaMetadata) GetDropReason() DropReason { return DropReason_IPTABLE_RULE_DROP } -var File_metadata_linux_proto protoreflect.FileDescriptor - -var file_metadata_linux_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x69, 0x6e, 0x75, 0x78, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x22, 0xc1, 0x01, - 0x0a, 0x0e, 0x52, 0x65, 0x74, 0x69, 0x6e, 0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x64, 0x6e, 0x73, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, - 0x2e, 0x44, 0x4e, 0x53, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x64, 0x6e, 0x73, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x63, 0x70, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x63, 0x70, 0x49, 0x64, 0x12, 0x32, 0x0a, - 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x52, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x2a, 0x2f, 0x0a, 0x07, 0x44, 0x4e, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, 0x45, - 0x52, 0x59, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, - 0x10, 0x02, 0x2a, 0xa5, 0x01, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x50, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x52, 0x55, 0x4c, - 0x45, 0x5f, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x50, 0x54, 0x41, - 0x42, 0x4c, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x5f, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x15, - 0x0a, 0x11, 0x54, 0x43, 0x50, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x5f, 0x42, 0x41, - 0x53, 0x49, 0x43, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x43, 0x50, 0x5f, 0x41, 0x43, 0x43, - 0x45, 0x50, 0x54, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x54, - 0x43, 0x50, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x04, - 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4e, 0x4e, 0x54, 0x52, 0x41, 0x43, 0x4b, 0x5f, 0x41, 0x44, - 0x44, 0x5f, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x5f, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x06, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, - 0x66, 0x74, 0x2f, 0x72, 0x65, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x75, 0x74, - 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_pkg_utils_metadata_linux_proto protoreflect.FileDescriptor + +var file_pkg_utils_metadata_linux_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x6b, 0x67, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x05, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x74, 0x69, + 0x6e, 0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x29, 0x0a, 0x08, 0x64, 0x6e, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2e, 0x44, 0x4e, 0x53, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x07, 0x64, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, + 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x12, 0x15, 0x0a, 0x06, 0x74, 0x63, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x74, 0x63, 0x70, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x5f, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x75, + 0x74, 0x69, 0x6c, 0x73, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, + 0x0a, 0x64, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2a, 0x2f, 0x0a, 0x07, 0x44, + 0x4e, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x0c, + 0x0a, 0x08, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x10, 0x02, 0x2a, 0xa5, 0x01, 0x0a, + 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x49, + 0x50, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x44, 0x52, 0x4f, 0x50, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x50, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x4e, 0x41, + 0x54, 0x5f, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x43, 0x50, 0x5f, + 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x02, 0x12, + 0x14, 0x0a, 0x10, 0x54, 0x43, 0x50, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x5f, 0x42, 0x41, + 0x53, 0x49, 0x43, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x43, 0x50, 0x5f, 0x43, 0x4c, 0x4f, + 0x53, 0x45, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, + 0x4e, 0x4e, 0x54, 0x52, 0x41, 0x43, 0x4b, 0x5f, 0x41, 0x44, 0x44, 0x5f, 0x44, 0x52, 0x4f, 0x50, + 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x44, 0x52, + 0x4f, 0x50, 0x10, 0x06, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2f, 0x72, 0x65, 0x74, + 0x69, 0x6e, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_metadata_linux_proto_rawDescOnce sync.Once - file_metadata_linux_proto_rawDescData = file_metadata_linux_proto_rawDesc + file_pkg_utils_metadata_linux_proto_rawDescOnce sync.Once + file_pkg_utils_metadata_linux_proto_rawDescData = file_pkg_utils_metadata_linux_proto_rawDesc ) -func file_metadata_linux_proto_rawDescGZIP() []byte { - file_metadata_linux_proto_rawDescOnce.Do(func() { - file_metadata_linux_proto_rawDescData = protoimpl.X.CompressGZIP(file_metadata_linux_proto_rawDescData) +func file_pkg_utils_metadata_linux_proto_rawDescGZIP() []byte { + file_pkg_utils_metadata_linux_proto_rawDescOnce.Do(func() { + file_pkg_utils_metadata_linux_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_utils_metadata_linux_proto_rawDescData) }) - return file_metadata_linux_proto_rawDescData + return file_pkg_utils_metadata_linux_proto_rawDescData } -var file_metadata_linux_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_metadata_linux_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_metadata_linux_proto_goTypes = []any{ +var file_pkg_utils_metadata_linux_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_pkg_utils_metadata_linux_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_pkg_utils_metadata_linux_proto_goTypes = []any{ (DNSType)(0), // 0: utils.DNSType (DropReason)(0), // 1: utils.DropReason (*RetinaMetadata)(nil), // 2: utils.RetinaMetadata } -var file_metadata_linux_proto_depIdxs = []int32{ +var file_pkg_utils_metadata_linux_proto_depIdxs = []int32{ 0, // 0: utils.RetinaMetadata.dns_type:type_name -> utils.DNSType 1, // 1: utils.RetinaMetadata.drop_reason:type_name -> utils.DropReason 2, // [2:2] is the sub-list for method output_type @@ -278,13 +279,13 @@ var file_metadata_linux_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_metadata_linux_proto_init() } -func file_metadata_linux_proto_init() { - if File_metadata_linux_proto != nil { +func init() { file_pkg_utils_metadata_linux_proto_init() } +func file_pkg_utils_metadata_linux_proto_init() { + if File_pkg_utils_metadata_linux_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_metadata_linux_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_pkg_utils_metadata_linux_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*RetinaMetadata); i { case 0: return &v.state @@ -301,19 +302,19 @@ func file_metadata_linux_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_metadata_linux_proto_rawDesc, + RawDescriptor: file_pkg_utils_metadata_linux_proto_rawDesc, NumEnums: 2, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_metadata_linux_proto_goTypes, - DependencyIndexes: file_metadata_linux_proto_depIdxs, - EnumInfos: file_metadata_linux_proto_enumTypes, - MessageInfos: file_metadata_linux_proto_msgTypes, + GoTypes: file_pkg_utils_metadata_linux_proto_goTypes, + DependencyIndexes: file_pkg_utils_metadata_linux_proto_depIdxs, + EnumInfos: file_pkg_utils_metadata_linux_proto_enumTypes, + MessageInfos: file_pkg_utils_metadata_linux_proto_msgTypes, }.Build() - File_metadata_linux_proto = out.File - file_metadata_linux_proto_rawDesc = nil - file_metadata_linux_proto_goTypes = nil - file_metadata_linux_proto_depIdxs = nil + File_pkg_utils_metadata_linux_proto = out.File + file_pkg_utils_metadata_linux_proto_rawDesc = nil + file_pkg_utils_metadata_linux_proto_goTypes = nil + file_pkg_utils_metadata_linux_proto_depIdxs = nil }