@@ -1963,16 +1963,6 @@ func TransformValidatorComponent(config *gpuv1.ClusterPolicySpec, podSpec *corev
1963
1963
if ! strings .Contains (initContainer .Name , fmt .Sprintf ("%s-validation" , component )) {
1964
1964
continue
1965
1965
}
1966
- if component == "nvidia-fs" && (config .GPUDirectStorage == nil || ! config .GPUDirectStorage .IsEnabled ()) {
1967
- // remove nvidia-fs init container from validator Daemonset if GDS is not enabled
1968
- podSpec .InitContainers = append (podSpec .InitContainers [:i ], podSpec .InitContainers [i + 1 :]... )
1969
- return nil
1970
- }
1971
- if component == "cc-manager" && ! config .CCManager .IsEnabled () {
1972
- // remove cc-manager init container from validator Daemonset if it is not enabled
1973
- podSpec .InitContainers = append (podSpec .InitContainers [:i ], podSpec .InitContainers [i + 1 :]... )
1974
- return nil
1975
- }
1976
1966
// update validation image
1977
1967
image , err := gpuv1 .ImagePath (& config .Validator )
1978
1968
if err != nil {
@@ -2003,6 +1993,11 @@ func TransformValidatorComponent(config *gpuv1.ClusterPolicySpec, podSpec *corev
2003
1993
setContainerEnv (& (podSpec .InitContainers [i ]), ValidatorRuntimeClassEnvName , * podSpec .RuntimeClassName )
2004
1994
}
2005
1995
case "plugin" :
1996
+ // remove plugin init container from validator Daemonset if it is not enabled
1997
+ if ! config .DevicePlugin .IsEnabled () {
1998
+ podSpec .InitContainers = append (podSpec .InitContainers [:i ], podSpec .InitContainers [i + 1 :]... )
1999
+ return nil
2000
+ }
2006
2001
// set/append environment variables for plugin-validation container
2007
2002
if len (config .Validator .Plugin .Env ) > 0 {
2008
2003
for _ , env := range config .Validator .Plugin .Env {
@@ -2030,9 +2025,17 @@ func TransformValidatorComponent(config *gpuv1.ClusterPolicySpec, podSpec *corev
2030
2025
}
2031
2026
}
2032
2027
case "nvidia-fs" :
2033
- // no additional config required for nvidia-fs validation
2028
+ if config .GPUDirectStorage == nil || ! config .GPUDirectStorage .IsEnabled () {
2029
+ // remove nvidia-fs init container from validator Daemonset if GDS is not enabled
2030
+ podSpec .InitContainers = append (podSpec .InitContainers [:i ], podSpec .InitContainers [i + 1 :]... )
2031
+ return nil
2032
+ }
2034
2033
case "cc-manager" :
2035
- // no additional config required for cc-manager validation
2034
+ if ! config .CCManager .IsEnabled () {
2035
+ // remove cc-manager init container from validator Daemonset if it is not enabled
2036
+ podSpec .InitContainers = append (podSpec .InitContainers [:i ], podSpec .InitContainers [i + 1 :]... )
2037
+ return nil
2038
+ }
2036
2039
case "toolkit" :
2037
2040
// set/append environment variables for toolkit-validation container
2038
2041
if len (config .Validator .Toolkit .Env ) > 0 {
0 commit comments