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

Use environment from containers.conf #7355

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Aug 18, 2020

podman needs to use the environment settings in containers.conf
when setting up the containers.

Also host environment variables should be relative to server side
not the client.

Signed-off-by: Daniel J Walsh [email protected]

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2020
@rhatdan
Copy link
Member Author

rhatdan commented Aug 18, 2020

@mheon I believe this is a better fix then #7343

@@ -43,6 +43,13 @@ type ContainerBasicConfig struct {
// image's configuration.
// Optional.
Command []string `json:"command,omitempty"`
// EnvHost indicates that the host environment should be added to container
// Optional.
EnvHost bool `json:"env_host,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Why are we sourcing this from the server, instead of the host? This doesn't make sense, IMO

Copy link
Member Author

Choose a reason for hiding this comment

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

If you are on a MAC or Windows box you want this from the server. The Proxies are setup on the Server, Proxies on the Client might not work while you are on the server machines.

@mheon
Copy link
Member

mheon commented Aug 18, 2020

This does not solve the problem #7343 is trying to solve - ensuring that $PATH and $TERM are always populated in containers we make.

@rhatdan
Copy link
Member Author

rhatdan commented Aug 18, 2020

PATH will always be set. If we need TERM set always the change should go into containers common. Not be hard coded in Podman.

@mheon
Copy link
Member

mheon commented Aug 18, 2020

I don't see any guarantee that we set a default $PATH if one is not provided by the image.

@mheon
Copy link
Member

mheon commented Aug 18, 2020

And IMO, we should just not support --env=host on Windows and OS X - it makes no sense to source from the server, that's not what the description of the flag tells me it will do and it feels like a security issue, leaking server environment into containers.

@edsantiago
Copy link
Member

rebase on master >= 748e882 to fix CI

@rhatdan
Copy link
Member Author

rhatdan commented Aug 18, 2020

Looking at the code --env-host and --http-proxy is already blocked from podman-Remote calls.

@rhatdan rhatdan force-pushed the env branch 4 times, most recently from 422f623 to 831ecae Compare August 25, 2020 17:49
@TomSweeneyRedHat
Copy link
Member

LGTM

podman needs to use the environment settings in containers.conf
when setting up the containers.

Also host environment variables should be relative to server side
not the client.

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan
Copy link
Member Author

rhatdan commented Aug 28, 2020

@mheon @baude @giuseppe @vrothberg @QiWang19 @ashley-cui @jwhonce PTAL
This is ready to go in.

@QiWang19
Copy link
Contributor

LGTM

@mheon
Copy link
Member

mheon commented Aug 28, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 28, 2020
@mheon
Copy link
Member

mheon commented Aug 28, 2020

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 28, 2020
@mheon
Copy link
Member

mheon commented Aug 28, 2020

Wait a moment, I thought we agreed to drop env=host from specgen?

@openshift-merge-robot openshift-merge-robot merged commit 522a32f into containers:master Aug 28, 2020
@rhatdan
Copy link
Member Author

rhatdan commented Aug 29, 2020

env=host was dropped from podman-remote.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants