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

Set engine env from containers.conf #2457

Merged
merged 1 commit into from
Jul 15, 2020
Merged

Conversation

QiWang19
Copy link
Contributor

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?

/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?


@rhatdan rhatdan changed the title Set engine env from containrs.conf Set engine env from containers.conf Jul 11, 2020
@rhatdan
Copy link
Member

rhatdan commented Jul 11, 2020

LGTM
Although it would be nice if you fixed the commit message spelling mistake.

@QiWang19
Copy link
Contributor Author

Fixed the typo

@rhatdan
Copy link
Member

rhatdan commented Jul 13, 2020

Copy link
Member

@vrothberg vrothberg left a 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

}
// 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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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])

@QiWang19
Copy link
Contributor Author

@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.

Copy link
Member

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?

@TomSweeneyRedHat
Copy link
Member

One small change, then LGTM

Set engine env from containers.conf. Mirror podman PR containers/podman#6790.

Signed-off-by: Qi Wang <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jul 15, 2020

bors r+

bors bot added a commit that referenced this pull request Jul 15, 2020
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]>
@bors
Copy link
Contributor

bors bot commented Jul 15, 2020

Build failed:

  • cirrus-ci/success

@rhatdan
Copy link
Member

rhatdan commented Jul 15, 2020

bors retry

@bors
Copy link
Contributor

bors bot commented Jul 15, 2020

Build succeeded:

  • cirrus-ci/success

@bors bors bot merged commit d4c696a into containers:master Jul 15, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 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.

4 participants