From 3d91ca39f309a01f8892b7cbc41c9244cad0a377 Mon Sep 17 00:00:00 2001 From: Vishesh Tanksale Date: Thu, 11 Jul 2024 22:03:39 +0000 Subject: [PATCH] Updating variable names in runtime tranformation method Signed-off-by: Vishesh Tanksale --- controllers/object_controls.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/object_controls.go b/controllers/object_controls.go index 2883e3c35..07ed0ffa7 100644 --- a/controllers/object_controls.go +++ b/controllers/object_controls.go @@ -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)