Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutating webhook does not run if secrets are only set through a configMap #227

Open
isaac-ped opened this issue May 12, 2023 · 0 comments
Open

Comments

@isaac-ped
Copy link

The mutateContainer hook skips mutation if no environment variables are set with a secret reference:

// Ignore if there are no berglas references in the container.
if !m.hasBerglasReferences(c.Env) {
    return c, false
}

However, environment variables can also be defined from configmaps, such as:

 envFrom:
   - configMapRef:
       name: config-map-name

If there is a single env entry with the sm:// prefix, the container will be mutated and the configmap variables will be resolved with berglas exec at runtime. This behavior for configMapRef variables changes when the unrelated env variables are removed.

Ideally, hasBerglasReferences would be run on all env variables that the container will use, rather than just those explicitly defined in the env section of the deployment.

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

No branches or pull requests

1 participant