-
Notifications
You must be signed in to change notification settings - Fork 788
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 containers.conf #2457
Conversation
LGTM |
Fixed the typo |
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.
Code LGTM, just minor wording nits
docs/buildah.md
Outdated
@@ -91,6 +91,10 @@ This option overrides the *remap-gids* setting in the *options* section of | |||
|
|||
Print the version | |||
|
|||
## Environment Variables | |||
|
|||
Buildah can set up environment variables from env of [engine] table in containers.conf. These variables can be overridden by passing environment variables before the `buildah` commands. |
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.
Buildah can set up environment variables from env of [engine] table in containers.conf. These variables can be overridden by passing environment variables before the `buildah` commands. | |
Buildah can set up environment variables from the env entry in the [engine] table in the containers.conf(5). These variables can be overridden by passing environment variables before the `buildah` commands. |
cmd/buildah/main.go
Outdated
for _, env := range defaultContainerConfig.Engine.Env { | ||
splitEnv := strings.SplitN(env, "=", 2) | ||
if len(splitEnv) != 2 { | ||
return fmt.Errorf("invalid environment variable for engine %s, valid configuration is KEY=value pair", env) |
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.
return fmt.Errorf("invalid environment variable for engine %s, valid configuration is KEY=value pair", env) | |
return fmt.Errorf("invalid environment variable %q from containers.conf, valid configuration is KEY=value pair", env) |
cmd/buildah/main.go
Outdated
} | ||
// skip if the env is already defined | ||
if _, ok := os.LookupEnv(splitEnv[0]); ok { | ||
logrus.Debugf("environment variable %s is already defined, skip the settings from containers.conf", splitEnv[0]) |
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.
logrus.Debugf("environment variable %s is already defined, skip the settings from containers.conf", splitEnv[0]) | |
logrus.Debugf("environment variable %q is already defined, skip the settings from containers.conf", splitEnv[0]) |
@rhatdan PTAL. This can be merged. |
## Environment Variables | ||
|
||
Buildah can set up environment variables from the env entry in the [engine] table in the containers.conf(5). These variables can be overridden by passing environment variables before the `buildah` commands. | ||
|
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.
Can you add containers.conf(5)
to the bottom of this file please?
One small change, then LGTM |
Set engine env from containers.conf. Mirror podman PR containers/podman#6790. Signed-off-by: Qi Wang <[email protected]>
bors r+ |
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]>
Build failed:
|
bors retry |
Build succeeded:
|
Set engine env from containrs.conf. Mirror podman PR containers/podman#6790.
Signed-off-by: Qi Wang [email protected]
What type of PR is this?
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?