Skip to content

Commit a37bab4

Browse files
committed
Correct typo in nvsandboxutils feature flag
This original implementation of the FeatureDisableNvsandboxUtils feature flag included a dash that was not supposed to be there. This change updates the feature flag's string representation to disable-nvsandboxutils. Special handling is included for users that may still use the old string value (e.g. for the nvidia-ctk cdi generate command), but no changes are expected for users of the nvcdi API. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent ffe768b commit a37bab4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/nvcdi/api.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ const (
8080
// FeatureEnableExplicitDriverLibraries enables the inclusion of a list of
8181
// explicit driver libraries.
8282
FeatureEnableExplicitDriverLibraries = FeatureFlag("enable-explicit-driver-libraries")
83+
8384
// FeatureDisableNvsandboxUtils disables the use of nvsandboxutils when
8485
// querying devices.
85-
FeatureDisableNvsandboxUtils = FeatureFlag("disable-nvsandbox-utils")
86+
FeatureDisableNvsandboxUtils = FeatureFlag("disable-nvsandboxutils")
87+
8688
// FeatureEnableCoherentAnnotations enables the addition of annotations
8789
// coherent or non-coherent devices.
8890
FeatureEnableCoherentAnnotations = FeatureFlag("enable-coherent-annotations")

pkg/nvcdi/options.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ func WithFeatureFlags[T string | FeatureFlag](featureFlags ...T) Option {
183183
o.featureFlags = make(map[FeatureFlag]bool)
184184
}
185185
for _, featureFlag := range featureFlags {
186+
// The initial release of the FeatureDisableNvsandboxUtils feature
187+
// flag included a typo which we handle here.
188+
if string(featureFlag) == "disable-nvsandbox-utils" {
189+
featureFlag = T(FeatureDisableNvsandboxUtils)
190+
}
186191
o.featureFlags[FeatureFlag(featureFlag)] = true
187192
}
188193
}

0 commit comments

Comments
 (0)