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

Empty secret when set from environment variable with --secret id=MYSECRET,type=env #5808

Open
r10r opened this issue Oct 31, 2024 · 2 comments
Assignees

Comments

@r10r
Copy link
Contributor

r10r commented Oct 31, 2024

When playing with secrets I first passed with the following options:

MYSECRET=foobar buildah bud --secret id=MYSECRET,type=env

FROM alpine:latest
RUN --mount=type=secret,id=MYSECRET echo "MYSECRET: $(cat /run/secrets/MYSECRET)"

But the secret file is empty. Seems there is a missing case in https://github.com/containers/buildah/blob/release-1.37/pkg/parse/parse.go#L1264 that checks for type=env.

I know know after studying the code and the latest changes to the manual that I can simply omit thetype=env
but I still think that this case should be fixed.

@nalind nalind self-assigned this Oct 31, 2024
Copy link

github-actions bot commented Dec 1, 2024

A friendly reminder that this issue had no activity for 30 days.

@miopp2
Copy link

miopp2 commented Dec 16, 2024

@r10r
How is omitting the type=env solving your problem? If I try to pass a secret from an env variable to the buildah bud I get the following error: error creating build executor: incorrect secret flag format: should be --secret id=foo,src=bar

E.g. buildah bud --secret id=mySecret

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

3 participants