-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Set engine env from common config #6790
Set engine env from common config #6790
Conversation
value := "" | ||
if len(splitEnv) == 2 { | ||
value = splitEnv[1] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is not 2, this should also be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you did, but users might accidentally override an existing environement variable with nothing.
If they want nothing then they should set it
foo=""
38b7929
to
11b5bec
Compare
@@ -128,6 +128,16 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error { | |||
return err | |||
} | |||
|
|||
for _, env := range cfg.Engine.Env { | |||
splitEnv := strings.SplitN(env, "=", 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to take precedence over actual OS environment? I imagine that if I have something set in containers.conf but later do a ENVVAR=value podman run ...
I want the version passed there to take precedence.
If so, we should only define environment variables that are not already defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I guess that makes sense. @QiWang19 Please add a note to the man pages on podman (buildah) about this, also, just do a check to see if environment is set, it set write a debug message, if different, and don't override,
456f9ef
to
6797511
Compare
Set the env that is used by Podman. related issue containers/common#31 Signed-off-by: Qi Wang <[email protected]>
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: QiWang19, rhatdan 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 |
Set engine env from containrs.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]>
Set engine env from containers.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]>
Set engine env from containers.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]>
Set engine env from containers.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]>
2457: Set engine env from containers.conf r=rhatdan a=QiWang19 Set engine env from containrs.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /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: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: Qi Wang <[email protected]>
2457: Set engine env from containers.conf r=rhatdan a=QiWang19 Set engine env from containrs.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /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: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: Qi Wang <[email protected]>
vendor commond PR containers/common#198 to set env
related issue containers/common#31
Signed-off-by: Qi Wang [email protected]