-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add env to [engines] for engine to use #198
Conversation
docs/containers.conf.5.md
Outdated
@@ -256,6 +256,9 @@ conmon_path=[ | |||
] | |||
``` | |||
|
|||
**container_engine_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.
Should be just called env
, but this should be in the "engine" section.
When used inside of the code it would be
Engine.Env rather then Containers.Env
docs/containers.conf.5.md
Outdated
@@ -256,6 +256,9 @@ conmon_path=[ | |||
] | |||
``` | |||
|
|||
**container_engine_env**=[] | |||
Additional environment variables to apply to the container engine. For example "http_proxy=internal.proxy.company.com" |
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.
How about something like:
"Environment variables to be used when running the container engine. Example....
Note these environment variables will not be used within the container. Set the env section under containers, if you want
to set environment variables for the container.
pkg/config/config.go
Outdated
@@ -195,6 +195,9 @@ type EngineConfig struct { | |||
// The first path pointing to a valid file will be used. | |||
ConmonPath []string `toml:"conmon_path,omitempty"` | |||
|
|||
// Additional environment variables to apply to the container engine. For example "http_proxy=internal.proxy.company.com" |
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.
Same comment as above.
pkg/config/config.go
Outdated
@@ -195,6 +195,9 @@ type EngineConfig struct { | |||
// The first path pointing to a valid file will be used. | |||
ConmonPath []string `toml:"conmon_path,omitempty"` | |||
|
|||
// Additional environment variables to apply to the container engine. For example "http_proxy=internal.proxy.company.com" | |||
ContainerEngineEnv []string `toml:"container_engine_env,omitempty"` |
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.
Just Env
@@ -127,6 +127,9 @@ conmon_path = [ | |||
"/usr/local/sbin/conmon" | |||
] | |||
|
|||
# Additional environment variables to apply to the container engine. For example "http_proxy=internal.proxy.company.com" | |||
container_engine_env = ["http_proxy=internal.proxy.company.com", "foo=bar"] |
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.
Just 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.
fixed.
fa81d05
to
c66006e
Compare
Add container_env_var for setting envariables for engin to use. Signed-off-by: Qi Wang <[email protected]>
LGTM |
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.
LGTM, a very nice feature!
@@ -207,6 +207,9 @@ type EngineConfig struct { | |||
// memory. | |||
EnablePortReservation bool `toml:"enable_port_reservation,omitempty"` | |||
|
|||
// Environment variables to be used when running the container engine. For example "http_proxy=internal.proxy.company.com" | |||
Env []string `toml:"env,omitempty"` |
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's not too late (and we haven't cut a release yet, I think) - why is this []string and not map[string]string?
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.
Environments are slices in the stdlib and commonly used like that across the stack. pkg/env
allows to conveniently translate between slices and maps. Also, slices are much easier to configure in config file than maps.
@@ -207,6 +207,9 @@ type EngineConfig struct { | |||
// memory. | |||
EnablePortReservation bool `toml:"enable_port_reservation,omitempty"` | |||
|
|||
// Environment variables to be used when running the container engine. For example "http_proxy=internal.proxy.company.com" |
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.
Are these intended to be passed to Podman and Buildah? We need to make that more clear, not everyone uses our terminology about container engine vs runtime.
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.
Good point! Could you open an issue for that? I guess we need to run over the docs/configs/etc. and look out for that.
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.
They will be passed to Podman, Buildah. Are you suggesting something like this ?
// Environment variables to be used when running the container engine. For example "http_proxy=internal.proxy.company.com" | |
// Environment variables to be used when running the container engine (e.g., Podman, Buildah). For example "http_proxy=internal.proxy.company.com" |
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.
Yeah, that would be good!
Use map[string]string for engine env instead of a slice of string. Follow comments under containers#198 (comment) Signed-off-by: Qi Wang <[email protected]>
Add env for setting variables for engine to use.
close #31
Signed-off-by: Qi Wang [email protected]