@@ -451,7 +451,7 @@ func (f *testFixture) setWorkloadState(pods map[string]map[string]interface{}, r
451451 // if deployment does not exist - add it.
452452 res , err := f .k8sClient .AppsV1 ().Deployments ("default" ).Get (context .TODO (), "function-deployment" , metaV1.GetOptions {})
453453 if err != nil || res == nil {
454- repl := int32 (len (pods ))
454+ repl := int32 (len (pods )) //nolint:gosec // explanation: casting len to int64 for API compatibility
455455 deployment := & appsV1.Deployment {
456456 ObjectMeta : metaV1.ObjectMeta {
457457 Name : "function-deployment" ,
@@ -628,31 +628,31 @@ func (f *testFixture) setCurrentData(vals map[string]map[string]float64) {
628628}
629629
630630// comparePlans compares two planes and returns false if they are not the same.
631- func comparePlans (old []map [string ]interface {}, new []planner.Action ) bool {
632- if len (new ) != len (old ) {
631+ func comparePlans (onePlan []map [string ]interface {}, anotherPlan []planner.Action ) bool {
632+ if len (anotherPlan ) != len (onePlan ) {
633633 return false
634634 }
635635 var oldPlan []planner.Action
636- for _ , entry := range old {
636+ for _ , entry := range onePlan {
637637 tmp := planner.Action {
638638 Name : entry ["name" ].(string ),
639639 Properties : entry ["properties" ],
640640 }
641641 oldPlan = append (oldPlan , tmp )
642642 }
643643 for i , item := range oldPlan {
644- if item .Name != new [i ].Name {
645- klog .Infof ("Expected action name: %v - got %v" , item .Name , new [i ].Name )
644+ if item .Name != anotherPlan [i ].Name {
645+ klog .Infof ("Expected action name: %v - got %v" , item .Name , anotherPlan [i ].Name )
646646 return false
647647 }
648648 one := fmt .Sprintf ("%v" , item .Properties )
649- another := fmt .Sprintf ("%v" , new [i ].Properties )
649+ another := fmt .Sprintf ("%v" , anotherPlan [i ].Properties )
650650 if one != another && item .Name != "rmPod" {
651651 klog .Infof ("Expected property: %v - got %v" , one , another )
652652 return false
653653 } else if item .Name == "rmPod" {
654654 if one != another && len (one ) == len (another ) {
655- klog .Warningf ("Not super sure - but looks ok: %v - %v" , item .Properties , new [i ].Properties )
655+ klog .Warningf ("Not super sure - but looks ok: %v - %v" , item .Properties , anotherPlan [i ].Properties )
656656 } else if one != another {
657657 klog .Infof ("This does not look right; expected: %v - got %v" , one , another )
658658 return false
0 commit comments