@@ -61,113 +61,113 @@ func main() {
6161 Name : "mig-strategy" ,
6262 Value : spec .MigStrategyNone ,
6363 Usage : "the desired strategy for exposing MIG devices on GPUs that support it:\n \t \t [none | single | mixed]" ,
64- EnvVars : [] string { "MIG_STRATEGY" } ,
64+ Sources : cli . EnvVars ( "MIG_STRATEGY" ) ,
6565 },
6666 & cli.BoolFlag {
6767 Name : "fail-on-init-error" ,
6868 Value : true ,
6969 Usage : "fail the plugin if an error is encountered during initialization, otherwise block indefinitely" ,
70- EnvVars : [] string { "FAIL_ON_INIT_ERROR" } ,
70+ Sources : cli . EnvVars ( "FAIL_ON_INIT_ERROR" ) ,
7171 },
7272 & cli.StringFlag {
7373 Name : "driver-root" ,
7474 Aliases : []string {"nvidia-driver-root" },
7575 Value : "/" ,
7676 Usage : "the root path for the NVIDIA driver installation on the host (typical values are '/' or '/run/nvidia/driver')" ,
77- EnvVars : [] string { "NVIDIA_DRIVER_ROOT" } ,
77+ Sources : cli . EnvVars ( "NVIDIA_DRIVER_ROOT" ) ,
7878 },
7979 & cli.StringFlag {
8080 Name : "dev-root" ,
8181 Aliases : []string {"nvidia-dev-root" },
8282 Usage : "the root path for the NVIDIA device nodes on the host (typical values are '/' or '/run/nvidia/driver')" ,
83- EnvVars : [] string { "NVIDIA_DEV_ROOT" } ,
83+ Sources : cli . EnvVars ( "NVIDIA_DEV_ROOT" ) ,
8484 },
8585 & cli.BoolFlag {
8686 Name : "pass-device-specs" ,
8787 Value : false ,
8888 Usage : "pass the list of DeviceSpecs to the kubelet on Allocate()" ,
89- EnvVars : [] string { "PASS_DEVICE_SPECS" } ,
89+ Sources : cli . EnvVars ( "PASS_DEVICE_SPECS" ) ,
9090 },
9191 & cli.StringSliceFlag {
9292 Name : "device-list-strategy" ,
9393 Value : cli .NewStringSlice (string (spec .DeviceListStrategyEnvVar )),
9494 Usage : "the desired strategy for passing the device list to the underlying runtime:\n \t \t [envvar | volume-mounts | cdi-annotations]" ,
95- EnvVars : [] string { "DEVICE_LIST_STRATEGY" } ,
95+ Sources : cli . EnvVars ( "DEVICE_LIST_STRATEGY" ) ,
9696 },
9797 & cli.StringFlag {
9898 Name : "device-id-strategy" ,
9999 Value : spec .DeviceIDStrategyUUID ,
100100 Usage : "the desired strategy for passing device IDs to the underlying runtime:\n \t \t [uuid | index]" ,
101- EnvVars : [] string { "DEVICE_ID_STRATEGY" } ,
101+ Sources : cli . EnvVars ( "DEVICE_ID_STRATEGY" ) ,
102102 },
103103 & cli.BoolFlag {
104104 Name : "gdrcopy-enabled" ,
105105 Usage : "ensure that containers that request NVIDIA GPU resources are started with GDRCopy support" ,
106- EnvVars : [] string { "GDRCOPY_ENABLED" } ,
106+ Sources : cli . EnvVars ( "GDRCOPY_ENABLED" ) ,
107107 },
108108 & cli.BoolFlag {
109109 Name : "gds-enabled" ,
110110 Usage : "ensure that containers that request NVIDIA GPU resources are started with GPUDirect Storage support" ,
111- EnvVars : [] string { "GDS_ENABLED" } ,
111+ Sources : cli . EnvVars ( "GDS_ENABLED" ) ,
112112 },
113113 & cli.BoolFlag {
114114 Name : "mofed-enabled" ,
115115 Usage : "ensure that containers that request NVIDIA GPU resources are started with MOFED support" ,
116- EnvVars : [] string { "MOFED_ENABLED" } ,
116+ Sources : cli . EnvVars ( "MOFED_ENABLED" ) ,
117117 },
118118 & cli.StringFlag {
119119 Name : "kubelet-socket" ,
120120 Value : pluginapi .KubeletSocket ,
121121 Usage : "specify the socket for communicating with the kubelet; if this is empty, no connection with the kubelet is attempted" ,
122122 Destination : & o .kubeletSocket ,
123- EnvVars : [] string { "KUBELET_SOCKET" } ,
123+ Sources : cli . EnvVars ( "KUBELET_SOCKET" ) ,
124124 },
125125 & cli.StringFlag {
126126 Name : "config-file" ,
127127 Usage : "the path to a config file as an alternative to command line options or environment variables" ,
128128 Destination : & o .configFile ,
129- EnvVars : [] string { "CONFIG_FILE" } ,
129+ Sources : cli . EnvVars ( "CONFIG_FILE" ) ,
130130 },
131131 & cli.StringFlag {
132132 Name : "cdi-annotation-prefix" ,
133133 Value : spec .DefaultCDIAnnotationPrefix ,
134134 Usage : "the prefix to use for CDI container annotation keys" ,
135- EnvVars : [] string { "CDI_ANNOTATION_PREFIX" } ,
135+ Sources : cli . EnvVars ( "CDI_ANNOTATION_PREFIX" ) ,
136136 },
137137 & cli.StringFlag {
138138 Name : "nvidia-cdi-hook-path" ,
139139 Aliases : []string {"nvidia-ctk-path" },
140140 Value : spec .DefaultNvidiaCTKPath ,
141141 Usage : "the path to use for NVIDIA CDI hooks in the generated CDI specification" ,
142- EnvVars : [] string { "NVIDIA_CDI_HOOK_PATH" , "NVIDIA_CTK_PATH" } ,
142+ Sources : cli . EnvVars ( "NVIDIA_CDI_HOOK_PATH" , "NVIDIA_CTK_PATH" ) ,
143143 },
144144 & cli.StringFlag {
145145 Name : "driver-root-ctr-path" ,
146146 Aliases : []string {"container-driver-root" },
147147 Value : spec .DefaultContainerDriverRoot ,
148148 Usage : "the path where the NVIDIA driver root is mounted in the container; used for generating CDI specifications" ,
149- EnvVars : [] string { "DRIVER_ROOT_CTR_PATH" , "CONTAINER_DRIVER_ROOT" } ,
149+ Sources : cli . EnvVars ( "DRIVER_ROOT_CTR_PATH" , "CONTAINER_DRIVER_ROOT" ) ,
150150 },
151151 & cli.StringFlag {
152152 Name : "mps-root" ,
153153 Usage : "the path on the host where MPS-specific mounts and files are created by the MPS control daemon manager" ,
154- EnvVars : [] string { "MPS_ROOT" } ,
154+ Sources : cli . EnvVars ( "MPS_ROOT" ) ,
155155 },
156156 & cli.StringFlag {
157157 Name : "device-discovery-strategy" ,
158158 Value : "auto" ,
159159 Usage : "the strategy to use to discover devices: 'auto', 'nvml', or 'tegra'" ,
160- EnvVars : [] string { "DEVICE_DISCOVERY_STRATEGY" } ,
160+ Sources : cli . EnvVars ( "DEVICE_DISCOVERY_STRATEGY" ) ,
161161 },
162162 & cli.IntSliceFlag {
163163 Name : "imex-channel-ids" ,
164164 Usage : "A list of IMEX channels to inject." ,
165- EnvVars : [] string { "IMEX_CHANNEL_IDS" } ,
165+ Sources : cli . EnvVars ( "IMEX_CHANNEL_IDS" ) ,
166166 },
167167 & cli.BoolFlag {
168168 Name : "imex-required" ,
169169 Usage : "The specified IMEX channels are required" ,
170- EnvVars : [] string { "IMEX_REQUIRED" } ,
170+ Sources : cli . EnvVars ( "IMEX_REQUIRED" ) ,
171171 },
172172 }
173173 o .flags = c .Flags
0 commit comments