-
Notifications
You must be signed in to change notification settings - Fork 202
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 missing fields to be used with podman #29
Conversation
56d319c
to
05fe824
Compare
Fixes: #31 |
General comment, but I think we need to define formats for all the []string fields. Stuff like AdditionalVolumes. We need to make sure that it will be consistently parsed by Buildah, Podman, etc. I would almost rather we do structures here (Source, Destination, Options) to remove the ambiguity of how Buildah, Podman, CRI-O could parse them. |
That's a very valid concern and I think it's smart to prevent any boilerplate code from consumers of this library. If we have fields that must be post-processed by consumers, we should do it for them. |
pkg/config/config.go
Outdated
// DNS Set default DNS servers. | ||
DNS string `toml:"default_ulimits"` | ||
|
||
// DNSOptions Set default DNS options. |
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.
extra space after set.
Should the various "Set"
used in the comments be lower case?
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
pkg/config/config.go
Outdated
// HTTPProxy is the proxy environment variable list to apply to container process | ||
HTTPProxy []string `toml:"http_proxy"` | ||
|
||
// Init tells containre runtimes wither to run init inside the |
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.
typo in containre and wither
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
// InitPath is the path for init to run if the Init bool is enabled | ||
InitPath string `toml:"init_path"` | ||
|
||
// IPCNS way to to create a ipc namespace for the container |
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.
double "to"
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
pkg/config/config.go
Outdated
// NetNS indicates how to create a network namespace for the container | ||
NetNS string `toml:"netns"` | ||
|
||
// NoHost tells container engine wheter to create its own /etc/hosts |
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.
typo in "wheter"
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
pkg/config/config.go
Outdated
@@ -179,7 +221,7 @@ type LibpodConfig struct { | |||
// containers and pods will be visible. The default namespace is "". | |||
Namespace string `toml:"namespace,omitempty"` | |||
|
|||
// NetworkCmdPath is the path to the slirp4netns binary. | |||
// NewtorkCmdPath is the path to the slirp4netns binary. |
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.
typo in "NewtorkCmdPath"
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
# 2. /etc/containers/containers.conf | ||
# 3. $HOME/.config/containers/containers.conf (Rootless containers ONLY) | ||
# Items specified in the latter containers.conf, if they exist, override the | ||
# previous containers.conf # settings, or the default settings. |
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'm still not clear on the ordering for rootless. If a variable is defined in all three files with different values, what does it get set to in a rootless environment? Does the processing really go through all three files and the value from 1 would be overridden by the 2nd, and then finally by the 3rd file's value? If so, then this is good, if not and we instead read just file 3 in a rootless environment, I think this needs to be adjusted.
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.
Goes through all three, and LAST one with a field get's used.
So if ~/.config/containers/containers.conf has a field in a rootless container, it wins. If it does not, then the precedence goes
/etc/containers/containers.conf
/usr/share/containers/containers.conf
Defaults.
All of these are checked even in the case of rootless.
I look at these 4 configuration settings as being controlled by different entities.
Defaults -> Upstream
/usr/share -> distros
/etc -> administrators
$HOME-> Users
Each able to override the other.
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.
One question, then other than @giuseppe 's comments, LGTM
@rhatdan glint is barking at you:
|
We also want to be able to default namespaces to host, so that HPC machines can default to not using most of the namespaces by default. Signed-off-by: Daniel J Walsh <[email protected]>
Signed-off-by: Daniel J Walsh <[email protected]>
I have fixed comments and tests pass, merging. |
Add network information to setupopts
We also want to be able to default namespaces to host, so that HPC
machines can default to not using most of the namespaces by default.
Signed-off-by: Daniel J Walsh [email protected]