Skip to content

Validate ephemeral containers in per-container checks#1204

Open
kanywst wants to merge 1 commit into
FairwindsOps:masterfrom
kanywst:add-ephemeral-container-checks
Open

Validate ephemeral containers in per-container checks#1204
kanywst wants to merge 1 commit into
FairwindsOps:masterfrom
kanywst:add-ephemeral-container-checks

Conversation

@kanywst

@kanywst kanywst commented Jun 27, 2026

Copy link
Copy Markdown

This PR fixes #1203

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

Run the per-container checks against ephemeral containers. Today they only cover init and regular containers, so a privileged ephemeral container passes every container-level check.

What changes did you make?

Added an EphemeralContainers loop in applyControllerSchemaChecks (pkg/validator/schema.go) alongside the init and regular container loops. EphemeralContainer.EphemeralContainerCommon converts to corev1.Container, so it reuses applyContainerSchemaChecks. Added a test that a privileged ephemeral container is now evaluated.

What alternative solution should we consider, if any?

None.

Per-container schema checks only iterated init and regular containers, so a
privileged ephemeral container passed every container-level check. Add an
EphemeralContainers loop alongside the existing two; EphemeralContainerCommon
converts to corev1.Container and reuses applyContainerSchemaChecks.

Fixes FairwindsOps#1203
@CLAassistant

CLAassistant commented Jun 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-container checks skip ephemeral containers

2 participants