Skip to content

Collector pod label app.kubernetes.io/version is wrong when using global --collector-image option #4175

@ChristianCiach

Description

@ChristianCiach

Component(s)

collector

What happened?

Description

I noticed that the label app.kubernetes.io/version of the created collector workloads (DaemonSet, ...) always has the value latest, even though I configured the operator with this CLI option:

--collector-image=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.129.1

It looks like the operator only uses the .spec.image attribut of the CR to generate this label and fallbacks to latest if not specified there, even when a global default image has been set.

This is an issue because the Otel Collector uses this label to determine the service.version resource attribute.

Steps to Reproduce

  • Deploy the operator with the option shown option.
  • Do not set .spec.image in the OpenTelemetryCollector custom resource.

Expected Result

The label should be app.kubernetes.io/version: '0.129.1'.

Actual Result

The label is app.kubernetes.io/version: 'latest'.

Kubernetes Version

1.33.1

Operator version

v0.129.1

Collector version

v0.129.1

Environment information

No response

Log output

Additional context

No response

Metadata

Metadata

Assignees

Labels

area:collectorIssues for deploying collectorbugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions