File tree Expand file tree Collapse file tree
deployments/gpu-operator/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1151,5 +1151,10 @@ func validateClusterPolicySpec(spec *gpuv1.ClusterPolicySpec) error {
11511151 if ! spec .CDI .IsEnabled () && spec .CDI .IsNRIPluginEnabled () {
11521152 return fmt .Errorf ("the NRI Plugin cannot be enabled when CDI is disabled" )
11531153 }
1154+
1155+ if spec .CDI .IsNRIPluginEnabled () && ! spec .Toolkit .IsEnabled () {
1156+ return fmt .Errorf ("the NRI Plugin cannot be enabled when the Container Toolkit is disabled" )
1157+ }
1158+
11541159 return nil
11551160}
Original file line number Diff line number Diff line change @@ -318,6 +318,19 @@ func TestValidateClusterPolicySpec(t *testing.T) {
318318 },
319319 err : errors .New ("the NRI Plugin cannot be enabled when CDI is disabled" ),
320320 },
321+ {
322+ description : "invalid CDI and Toolkit config combination" ,
323+ spec : & gpuv1.ClusterPolicySpec {
324+ CDI : gpuv1.CDIConfigSpec {
325+ Enabled : ptr .To (true ),
326+ NRIPluginEnabled : ptr .To (true ),
327+ },
328+ Toolkit : gpuv1.ToolkitSpec {
329+ Enabled : ptr .To (false ),
330+ },
331+ },
332+ err : errors .New ("the NRI Plugin cannot be enabled when the Container Toolkit is disabled" ),
333+ },
321334 }
322335
323336 for _ , tc := range tests {
Original file line number Diff line number Diff line change 11{{- if and (eq .Values.cdi.enabled false) (eq .Values.cdi.nriPluginEnabled true) }}
22{{ fail "the NRI Plugin cannot be enabled when CDI is disabled" }}
3- {{- end}}
3+ {{- end }}
4+
5+ {{- if and (eq .Values.cdi.nriPluginEnabled true) (eq .Values.toolkit.enabled false) }}
6+ {{ fail "the NRI Plugin cannot be enabled when the Container Toolkit is disabled" }}
7+ {{- end }}
You can’t perform that action at this time.
0 commit comments