Add support for ephemeralContainers - #48
Merged
Merged
Conversation
MPV
force-pushed
the
claude/ephemeral-containers-support-qybk3c
branch
from
July 23, 2026 06:38
c481737 to
934bc2c
Compare
Collect images from podSpec.EphemeralContainers alongside Containers and InitContainers in GetContainersFromObject. EphemeralContainerCommon is a direct type definition of Container, so each entry converts cleanly without copying fields. Add unit coverage in the k8s and yamlparser packages. For the end-to-end approval layer, fold ephemeralContainers into the existing Pod fixture (the only kind where they are valid, since they are injected into a live Pod via the ephemeralcontainers subresource rather than declared in a workload template), ordered regular -> init -> ephemeral. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013YcWYpbf4mF49SYnbkf28b
MPV
force-pushed
the
claude/ephemeral-containers-support-qybk3c
branch
from
July 23, 2026 07:07
934bc2c to
57408d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Collects OCI images from a pod's
ephemeralContainersin addition tocontainersandinitContainers.Why
kirpreviously ignoredephemeralContainers, so images injected viakubectl debug(or otherwise present in a manifest's ephemeral container list) were silently missing from the output. For a tool whose purpose is enumerating every image a pod would run — e.g. to feed a vulnerability scanner — that's a coverage gap.How
GetContainersFromObjectink8s/k8s.gonow walkspodSpec.EphemeralContainers. BecauseEphemeralContainerCommonis a direct type definition ofcorev1.Container, each entry converts cleanly without copying fields:Nothing else needed changing —
EphemeralContainersalready rides along on thePodSpecfor every supported kind (Pod, Deployment, DaemonSet, ReplicaSet, StatefulSet, Job, CronJob), and everything downstream is generic over[]corev1.Container.Tests
k8s/k8s_test.go: new table case asserting an ephemeral container's image is collected alongside regular and init containers.yamlparser/yamlparser_test.go: round-trip test that decodes a Pod manifest withephemeralContainersfrom YAML and confirms all three image sources come through, exercising the deserializer path end-to-end.go build ./...andgo test ./...both pass.🤖 Generated with Claude Code
https://claude.ai/code/session_013YcWYpbf4mF49SYnbkf28b
Generated by Claude Code