Skip to content

[chore] [receiver/k8s_cluster] Fix nil dereference in RecordSpecMetrics when container status is missing#47554

Merged
dmitryax merged 1 commit into
open-telemetry:mainfrom
dmitryax:chore/k8scluster-fix-nil-container-status
Apr 10, 2026
Merged

[chore] [receiver/k8s_cluster] Fix nil dereference in RecordSpecMetrics when container status is missing#47554
dmitryax merged 1 commit into
open-telemetry:mainfrom
dmitryax:chore/k8scluster-fix-nil-container-status

Conversation

@dmitryax

@dmitryax dmitryax commented Apr 10, 2026

Copy link
Copy Markdown
Member

Replacing #47538 as we need to merge it before the next release to avoid regression.

Guard docker.ParseImageName and LastTerminationState access under a single cs != nil block to avoid a panic when a container spec exists but kubelet has not yet reported its status.

Taking opportunity to increase test coverage of the receiver/k8sclusterreceiver/internal/container package

…s when container status is missing

Guard docker.ParseImageName and LastTerminationState access under a
single cs != nil block to avoid a panic when a container spec exists
but kubelet has not yet reported its status.

Assisted-by: Claude Opus 4.6
@dmitryax dmitryax merged commit 5a935e5 into open-telemetry:main Apr 10, 2026
195 checks passed
AndrewCharlesHay pushed a commit to AndrewCharlesHay/opentelemetry-collector-contrib that referenced this pull request Apr 23, 2026
…cs when container status is missing (open-telemetry#47554)

Replacing
open-telemetry#47538
as we need to merge it before the next release to avoid regression.

Guard `docker.ParseImageName` and `LastTerminationState` access under a
single cs != nil block to avoid a panic when a container spec exists but
kubelet has not yet reported its status.

Taking opportunity to increase test coverage of the
`receiver/k8sclusterreceiver/internal/container` package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants