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

secret: accept required flag without value #4791

Merged
merged 2 commits into from May 16, 2023

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented May 15, 2023

Buildkit and docker accepts required flag as true when provided without any value in --mount=type=secret so lets do same for buildah.

Example usage

FROM docker.io/nginx:1.23.3

RUN --mount=type=secret,id=nginx-crt,dst=/nginx-repo.crt,required \
    --mount=type=secret,id=nginx-key,dst=/nginx-repo.key,required \
    set -x \
    && . /etc/os-release \
    && stat /nginx-repo.crt \
    && stat /nginx-repo.key

Closes: containers/podman#18438

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

secret: accept `required` flag without value

`Buildkit` and `docker` accepts `required` flag as `true` in
`--mount=type=secret` so let do same for buildah.

Example usage

```Dockerfile
FROM docker.io/nginx:1.23.3

RUN --mount=type=secret,id=nginx-crt,dst=/nginx-repo.crt,required \
    --mount=type=secret,id=nginx-key,dst=/nginx-repo.key,required \
    set -x \
    && . /etc/os-release \
    && stat /nginx-repo.crt \
    && stat /nginx-repo.key
```

Closes: containers/podman#18438

Signed-off-by: Aditya R <arajan@redhat.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@flouthoc
Copy link
Collaborator Author

@nalind @rhatdan @containers/buildah-maintainers PTAL

@rhatdan
Copy link
Member

rhatdan commented May 15, 2023

LGTM
Do we need a test with required=false?

@TomSweeneyRedHat
Copy link
Member

I don't think we do, and it would be a good addition.
Otherwise, LGTM

Signed-off-by: Aditya R <arajan@redhat.com>
@flouthoc
Copy link
Collaborator Author

Okay added a case for missing required=false in a new commit.

@rhatdan
Copy link
Member

rhatdan commented May 16, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm label May 16, 2023
@openshift-merge-robot openshift-merge-robot merged commit 395f6f5 into containers:main May 16, 2023
32 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman crashes if required mount flag is used
4 participants