Skip to content

Commit

Permalink
Updating variable names in runtime tranformation method
Browse files Browse the repository at this point in the history
Signed-off-by: Vishesh Tanksale <[email protected]>
  • Loading branch information
visheshtanksale committed Jul 11, 2024
1 parent 993f7cf commit 3d91ca3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,16 +1254,16 @@ func TransformToolkit(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n
return nil
}

func transformForRuntime(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, runtime string, mainContainerName string) error {
func transformForRuntime(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, runtime string, containerName string) error {
var mainContainer *corev1.Container
for i, ctr := range obj.Spec.Template.Spec.Containers {
if ctr.Name == mainContainerName {
if ctr.Name == containerName {
mainContainer = &obj.Spec.Template.Spec.Containers[i]
break
}
}
if mainContainer == nil {
return fmt.Errorf("failed to find main container %q", mainContainerName)
return fmt.Errorf("failed to find main container %q", containerName)
}

setContainerEnv(mainContainer, "RUNTIME", runtime)
Expand Down

0 comments on commit 3d91ca3

Please sign in to comment.