mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-03-09 22:00:31 +00:00
Merge pull request #943 from elezar/add-disable-imex-channels-feature
Some checks failed
Some checks failed
Add ignore-imex-channel-requests feature flag
This commit is contained in:
commit
bc9ec77fdd
@ -198,6 +198,10 @@ func getMigDevices(image image.CUDA, envvar string) *string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (hookConfig *hookConfig) getImexChannels(image image.CUDA, privileged bool) []string {
|
func (hookConfig *hookConfig) getImexChannels(image image.CUDA, privileged bool) []string {
|
||||||
|
if hookConfig.Features.IgnoreImexChannelRequests.IsEnabled() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// If enabled, try and get the device list from volume mounts first
|
// If enabled, try and get the device list from volume mounts first
|
||||||
if hookConfig.AcceptDeviceListAsVolumeMounts {
|
if hookConfig.AcceptDeviceListAsVolumeMounts {
|
||||||
devices := image.ImexChannelsFromMounts()
|
devices := image.ImexChannelsFromMounts()
|
||||||
|
@ -34,6 +34,14 @@ type features struct {
|
|||||||
// DisableImexChannelCreation ensures that the implicit creation of
|
// DisableImexChannelCreation ensures that the implicit creation of
|
||||||
// requested IMEX channels is skipped when invoking the nvidia-container-cli.
|
// requested IMEX channels is skipped when invoking the nvidia-container-cli.
|
||||||
DisableImexChannelCreation *feature `toml:"disable-imex-channel-creation,omitempty"`
|
DisableImexChannelCreation *feature `toml:"disable-imex-channel-creation,omitempty"`
|
||||||
|
// IgnoreImexChannelRequests configures the NVIDIA Container Toolkit to
|
||||||
|
// ignore IMEX channel requests through the NVIDIA_IMEX_CHANNELS envvar or
|
||||||
|
// volume mounts.
|
||||||
|
// This ensures that the NVIDIA Container Toolkit cannot be used to provide
|
||||||
|
// access to an IMEX channel by simply specifying an environment variable,
|
||||||
|
// possibly bypassing other checks by an orchestration system such as
|
||||||
|
// kubernetes.
|
||||||
|
IgnoreImexChannelRequests *feature `toml:"ignore-imex-channel-requests,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type feature bool
|
type feature bool
|
||||||
|
Loading…
Reference in New Issue
Block a user