From 2ca2c61a57c8d725462e5c567b7bfd7f9d271c9f Mon Sep 17 00:00:00 2001 From: Darren Wang Date: Wed, 6 Dec 2023 17:19:09 +0800 Subject: [PATCH 1/2] fix logging err in collector container manifest --- internal/manifests/collector/container.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/manifests/collector/container.go b/internal/manifests/collector/container.go index e4d826e68e..e347d0ce56 100644 --- a/internal/manifests/collector/container.go +++ b/internal/manifests/collector/container.go @@ -44,7 +44,10 @@ func Container(cfg config.Config, logger logr.Logger, otelcol v1alpha1.OpenTelem // build container ports from service ports ports, err := getConfigContainerPorts(logger, otelcol.Spec.Config) - logger.Error(err, "container ports config") + if err != nil { + logger.Error(err, "container ports config") + } + for _, p := range otelcol.Spec.Ports { ports[p.Name] = corev1.ContainerPort{ Name: p.Name, From 8fe6a1cfa76d291e7f41546427c5accdd53f4c81 Mon Sep 17 00:00:00 2001 From: Darren Wang Date: Wed, 6 Dec 2023 18:37:40 +0800 Subject: [PATCH 2/2] add chlog --- .chloggen/fix-collector-container-log.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 .chloggen/fix-collector-container-log.yaml diff --git a/.chloggen/fix-collector-container-log.yaml b/.chloggen/fix-collector-container-log.yaml new file mode 100755 index 0000000000..6bb25ee4df --- /dev/null +++ b/.chloggen/fix-collector-container-log.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: operator + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: fix error logging in collector container creation + +# One or more tracking issues related to the change +issues: [2420] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: