-
Notifications
You must be signed in to change notification settings - Fork 408
Allow config sources to be specified for containerd #1251
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,12 @@ func Flags(opts *Options) []cli.Flag { | |
Sources: cli.EnvVars("NVIDIA_RUNTIME_SET_AS_DEFAULT", "CONTAINERD_SET_AS_DEFAULT", "DOCKER_SET_AS_DEFAULT"), | ||
Hidden: true, | ||
}, | ||
&cli.StringSliceFlag{ | ||
Name: "config-source", | ||
Usage: "specify the config sources", | ||
Destination: &opts.ConfigSources, | ||
Sources: cli.EnvVars("RUNTIME_CONFIG_SOURCES"), | ||
Comment on lines
+106
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flag to be called
As the user can do same for the ENV VAR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't agree that the flag name should be changed. The flag specifies the sources and the ordering is implied by the order in which the sources are specified. Valid values for this argument are currently:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then let's expand the |
||
}, | ||
} | ||
|
||
flags = append(flags, containerd.Flags(&opts.containerdOptions)...) | ||
|
@@ -137,6 +143,9 @@ func (opts *Options) Validate(logger logger.Interface, c *cli.Command, runtime s | |
if opts.RestartMode == runtimeSpecificDefault { | ||
opts.RestartMode = containerd.DefaultRestartMode | ||
} | ||
if len(opts.ConfigSources) == 0 { | ||
opts.ConfigSources = []string{"command", "file"} | ||
} | ||
case crio.Name: | ||
if opts.Config == runtimeSpecificDefault { | ||
opts.Config = crio.DefaultConfig | ||
|
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.
Note to self: Since
command
here impliescontainerd config dump
command we may want to make this more expressive. For now I have used the values that we support in thenvidia-ctk runtime configure
command:nvidia-container-toolkit/cmd/nvidia-ctk/runtime/configure/configure.go
Lines 132 to 137 in 7b1b20b