Skip to content

Commit 5a3dcbe

Browse files
committed
Make list of explicit driver libraries opt-in
Instead of always injecting the list of explict libraries, we switch these to opt-in instead. This means that they can be generated in use cases such as GKE where they are expected, but don't affect other use cases where they are not. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 9983817 commit 5a3dcbe

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pkg/nvcdi/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ const (
7777
type FeatureFlag string
7878

7979
const (
80+
// FeatureEnableExplicitDriverLibraries enables the inclusion of a list of
81+
// explicit driver libraries.
82+
FeatureEnableExplicitDriverLibraries = FeatureFlag("enable-explicit-driver-libraries")
8083
// FeatureDisableNvsandboxUtils disables the use of nvsandboxutils when
8184
// querying devices.
8285
FeatureDisableNvsandboxUtils = FeatureFlag("disable-nvsandbox-utils")

pkg/nvcdi/driver-nvml.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ func (l *nvcdilib) getVersionSuffixDriverLibraryMounts(version string) (discover
145145
}
146146

147147
func (l *nvcdilib) getExplicitDriverLibraryMounts() (discover.Discover, error) {
148+
if !l.featureFlags[FeatureEnableExplicitDriverLibraries] {
149+
return nil, nil
150+
}
151+
148152
// List of explicit libraries to locate
149153
// TODO(ArangoGutierrez): we should load the version of the libraries from
150154
// the sandboxutils-filelist or have a way to allow users to specify the

0 commit comments

Comments
 (0)