Skip to content

Commit

Permalink
fix error logging in collector container creation (open-telemetry#2420)
Browse files Browse the repository at this point in the history
* fix logging err in collector container manifest

* add chlog
  • Loading branch information
changexd authored Dec 6, 2023
1 parent 5273fe1 commit 93ef035
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .chloggen/fix-collector-container-log.yaml
Original file line number Diff line number Diff line change
@@ -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:
5 changes: 4 additions & 1 deletion internal/manifests/collector/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 93ef035

Please sign in to comment.