kubernetes: go vet error "non-constant format string" with upcoming go 1.24 release

What would you like to be added?

Below Unit Tests are failing with non-constant format string in call when run with golang tip:

[root@raji-x86-workspace1 kubernetes]# go vet ./...
# k8s.io/kubernetes/pkg/kubeapiserver/authorizer
pkg/kubeapiserver/authorizer/config.go:179:26: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/test/utils
test/utils/density_utils.go:102:22: non-constant format string in call to fmt.Errorf
test/utils/deployment.go:229:20: non-constant format string in call to fmt.Errorf
test/utils/runners.go:667:23: non-constant format string in call to (*k8s.io/kubernetes/test/utils.RCConfig).RCConfigLog
test/utils/runners.go:691:23: non-constant format string in call to (*k8s.io/kubernetes/test/utils.RCConfig).RCConfigLog
test/utils/runners.go:692:23: non-constant format string in call to (*k8s.io/kubernetes/test/utils.RCConfig).RCConfigLog
# k8s.io/kubernetes/cmd/kubeadm/app/phases/certs/renewal
# [k8s.io/kubernetes/cmd/kubeadm/app/phases/certs/renewal]
cmd/kubeadm/app/phases/certs/renewal/readwriter_test.go:268:51: non-constant format string in call to fmt.Sprintf
# k8s.io/kubernetes/pkg/apis/core/v1_test
# [k8s.io/kubernetes/pkg/apis/core/v1_test]
pkg/apis/core/v1/defaults_test.go:188:11: non-constant format string in call to (*testing.common).Logf
pkg/apis/core/v1/defaults_test.go:226:11: non-constant format string in call to (*testing.common).Logf
pkg/apis/core/v1/defaults_test.go:377:10: non-constant format string in call to (*testing.common).Logf
# k8s.io/kubernetes/pkg/controller/endpoint
# [k8s.io/kubernetes/pkg/controller/endpoint]
pkg/controller/endpoint/endpoints_controller_test.go:2785:12: non-constant format string in call to (*testing.common).Errorf
# k8s.io/kubernetes/pkg/controller/nodelifecycle
# [k8s.io/kubernetes/pkg/controller/nodelifecycle]
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go:2453:12: non-constant format string in call to (*testing.common).Errorf
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go:2482:12: non-constant format string in call to (*testing.common).Errorf
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go:2495:12: non-constant format string in call to (*testing.common).Errorf
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go:2641:12: non-constant format string in call to (*testing.common).Errorf
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go:2873:12: non-constant format string in call to (*testing.common).Errorf
pkg/controller/nodelifecycle/node_lifecycle_controller_test.go:2878:12: non-constant format string in call to (*testing.common).Errorf
# k8s.io/kubernetes/pkg/controller/util/selectors
# [k8s.io/kubernetes/pkg/controller/util/selectors]
pkg/controller/util/selectors/bimultimap_test.go:238:16: non-constant format string in call to (*testing.common).Fatalf
pkg/controller/util/selectors/bimultimap_test.go:264:12: non-constant format string in call to (*testing.common).Errorf
# k8s.io/kubernetes/pkg/controller/podautoscaler
# [k8s.io/kubernetes/pkg/controller/podautoscaler]
pkg/controller/podautoscaler/horizontal.go:341:112: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:388:26: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:395:88: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:396:26: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:416:90: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:417:26: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:573:19: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:620:57: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:722:19: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:724:51: non-constant format string in call to fmt.Errorf
pkg/controller/podautoscaler/horizontal.go:956:81: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:958:80: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:994:74: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:1000:78: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal.go:1002:77: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setCondition
pkg/controller/podautoscaler/horizontal_test.go:85:86: non-constant format string in call to k8s.io/kubernetes/pkg/controller/podautoscaler.setConditionInList
# k8s.io/kubernetes/pkg/controller/statefulset
# [k8s.io/kubernetes/pkg/controller/statefulset]
pkg/controller/statefulset/stateful_set_test.go:827:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:831:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:834:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:838:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:842:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:845:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:851:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:855:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:866:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:872:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:876:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:879:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:884:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:888:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:898:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:901:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:905:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:909:13: non-constant format string in call to (*testing.common).Errorf
pkg/controller/statefulset/stateful_set_test.go:912:13: non-constant format string in call to (*testing.common).Errorf
# k8s.io/kubernetes/pkg/controller/volume/expand
# [k8s.io/kubernetes/pkg/controller/volume/expand]
pkg/controller/volume/expand/expand_controller.go:259:22: non-constant format string in call to fmt.Errorf
pkg/controller/volume/expand/expand_controller.go:266:22: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache
# [k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache]
pkg/controller/volume/attachdetach/cache/actual_state_of_world.go:527:21: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/controller/volume/persistentvolume
# [k8s.io/kubernetes/pkg/controller/volume/persistentvolume]
pkg/controller/volume/persistentvolume/pv_controller.go:1633:33: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/kubelet/cm
# [k8s.io/kubernetes/pkg/kubelet/cm]
pkg/kubelet/cm/node_container_manager_linux.go:115:22: non-constant format string in call to fmt.Errorf
pkg/kubelet/cm/node_container_manager_linux.go:124:22: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/kubelet/nodeshutdown
# [k8s.io/kubernetes/pkg/kubelet/nodeshutdown]
pkg/kubelet/nodeshutdown/storage_test.go:63:25: non-constant format string in call to fmt.Sprintf
# k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache
# [k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache]
pkg/kubelet/pluginmanager/cache/desired_state_of_world.go:103:20: non-constant format string in call to fmt.Errorf
pkg/kubelet/pluginmanager/cache/desired_state_of_world.go:111:20: non-constant format string in call to fmt.Errorf
pkg/kubelet/pluginmanager/cache/desired_state_of_world.go:111:43: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/kubelet/prober
# [k8s.io/kubernetes/pkg/kubelet/prober]
pkg/kubelet/prober/scale_test.go:83:21: non-constant format string in call to fmt.Sprintf
# k8s.io/kubernetes/pkg/kubelet/kuberuntime
# [k8s.io/kubernetes/pkg/kubelet/kuberuntime]
pkg/kubelet/kuberuntime/kuberuntime_container.go:277:99: non-constant format string in call to (*k8s.io/kubernetes/pkg/kubelet/kuberuntime.kubeGenericRuntimeManager).recordContainerEvent
pkg/kubelet/kuberuntime/kuberuntime_container.go:286:99: non-constant format string in call to (*k8s.io/kubernetes/pkg/kubelet/kuberuntime.kubeGenericRuntimeManager).recordContainerEvent
pkg/kubelet/kuberuntime/kuberuntime_container.go:783:106: non-constant format string in call to (*k8s.io/kubernetes/pkg/kubelet/kuberuntime.kubeGenericRuntimeManager).recordContainerEvent
# k8s.io/kubernetes/pkg/scheduler/backend/cache
# [k8s.io/kubernetes/pkg/scheduler/backend/cache]
pkg/scheduler/backend/cache/cache.go:275:21: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/scheduler
# [k8s.io/kubernetes/pkg/scheduler]
pkg/scheduler/extender.go:290:36: non-constant format string in call to fmt.Errorf
pkg/scheduler/extender.go:376:21: non-constant format string in call to fmt.Errorf
pkg/scheduler/schedule_one_test.go:3634:20: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/volume/downwardapi
# [k8s.io/kubernetes/pkg/volume/downwardapi]
pkg/volume/downwardapi/downwardapi_test.go:324:12: non-constant format string in call to (*testing.common).Errorf
pkg/volume/downwardapi/downwardapi_test.go:360:17: non-constant format string in call to (*testing.common).Errorf
# k8s.io/kubernetes/pkg/volume/flexvolume
# [k8s.io/kubernetes/pkg/volume/flexvolume]
pkg/volume/flexvolume/driver-call.go:269:15: non-constant format string in call to k8s.io/klog/v2.Errorf
# k8s.io/kubernetes/pkg/volume/util/subpath
# [k8s.io/kubernetes/pkg/volume/util/subpath]
pkg/volume/util/subpath/subpath_linux_test.go:262:14: non-constant format string in call to (*testing.common).Fatalf
pkg/volume/util/subpath/subpath_linux_test.go:388:13: non-constant format string in call to (*testing.common).Fatalf
pkg/volume/util/subpath/subpath_linux_test.go:618:13: non-constant format string in call to (*testing.common).Fatalf
pkg/volume/util/subpath/subpath_linux_test.go:875:13: non-constant format string in call to (*testing.common).Fatalf
pkg/volume/util/subpath/subpath_linux_test.go:989:13: non-constant format string in call to (*testing.common).Fatalf
pkg/volume/util/subpath/subpath_linux_test.go:1223:13: non-constant format string in call to (*testing.common).Fatalf
pkg/volume/util/subpath/subpath_linux_test.go:1370:13: non-constant format string in call to (*testing.common).Fatalf
# k8s.io/kubernetes/pkg/volume/portworx
# [k8s.io/kubernetes/pkg/volume/portworx]
pkg/volume/portworx/portworx_util.go:369:15: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/portworx/portworx_util.go:382:15: non-constant format string in call to k8s.io/klog/v2.Errorf
# k8s.io/kubernetes/pkg/volume/secret
# [k8s.io/kubernetes/pkg/volume/secret]
pkg/volume/secret/secret.go:279:17: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/secret/secret.go:280:28: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/volume/util/recyclerclient
# [k8s.io/kubernetes/pkg/volume/util/recyclerclient]
pkg/volume/util/recyclerclient/recycler_client.go:131:25: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/pkg/volume/csi
# [k8s.io/kubernetes/pkg/volume/csi]
pkg/volume/csi/csi_attacher.go:265:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_attacher.go:359:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/csi/csi_attacher.go:373:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/csi/csi_attacher.go:411:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_attacher.go:544:15: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/csi/csi_attacher.go:567:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/csi/csi_attacher.go:590:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:108:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:140:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:152:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:155:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:163:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/csi/csi_block.go:203:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:215:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:282:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:344:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:411:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:424:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/csi/csi_block.go:434:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_block.go:460:20: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_mounter.go:104:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_mounter.go:349:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_mounter.go:361:20: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_mounter.go:397:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_mounter.go:419:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_mounter.go:450:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_plugin.go:100:13: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/csi/csi_plugin.go:113:13: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/csi/csi_plugin.go:435:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_plugin.go:700:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_plugin.go:842:20: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/csi_plugin.go:850:19: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
pkg/volume/csi/expander.go:39:18: non-constant format string in call to (k8s.io/klog/v2.Verbose).Infof
# k8s.io/kubernetes/pkg/volume/util/operationexecutor
# [k8s.io/kubernetes/pkg/volume/util/operationexecutor]
pkg/volume/util/operationexecutor/node_expander.go:137:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/node_expander.go:150:18: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/node_expander.go:155:18: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/node_expander.go:165:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:373:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:379:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:379:43: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:538:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:544:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:544:43: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:600:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:606:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:606:43: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:772:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:778:20: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_executor.go:778:43: non-constant format string in call to fmt.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:200:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:317:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/util/operationexecutor/operation_generator.go:437:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/util/operationexecutor/operation_generator.go:650:17: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:708:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:719:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:737:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:747:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:795:17: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:818:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:869:18: non-constant format string in call to k8s.io/klog/v2.Warningf
pkg/volume/util/operationexecutor/operation_generator.go:888:17: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:909:17: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:1154:17: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:1273:16: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:1387:14: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/util/operationexecutor/operation_generator.go:1522:18: non-constant format string in call to k8s.io/klog/v2.Warningf
pkg/volume/util/operationexecutor/operation_generator.go:1539:13: non-constant format string in call to k8s.io/klog/v2.Infof
pkg/volume/util/operationexecutor/operation_generator.go:1963:15: non-constant format string in call to k8s.io/klog/v2.Errorf
pkg/volume/util/operationexecutor/operation_generator.go:1994:19: non-constant format string in call to k8s.io/klog/v2.Warningf
pkg/volume/util/operationexecutor/operation_generator.go:2064:19: non-constant format string in call to k8s.io/klog/v2.Warningf
pkg/volume/util/operationexecutor/operation_generator.go:2109:17: non-constant format string in call to k8s.io/klog/v2.Warningf
pkg/volume/util/operationexecutor/operation_generator.go:2151:16: non-constant format string in call to k8s.io/klog/v2.Errorf
# k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service
test/e2e/storage/drivers/csi-test/mock/service/controller.go:115:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:135:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:153:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:182:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:249:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:283:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:312:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:335:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:353:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:376:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:388:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:467:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:482:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:496:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:600:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:633:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:648:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:664:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:674:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:703:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/controller.go:740:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:92:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:133:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:144:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:232:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:250:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:285:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:299:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:326:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:338:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:401:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:464:46: non-constant format string in call to google.golang.org/grpc/status.Errorf
test/e2e/storage/drivers/csi-test/mock/service/node.go:468:38: non-constant format string in call to google.golang.org/grpc/status.Errorf
# k8s.io/kubernetes/test/e2e/framework/skipper
test/e2e/framework/skipper/skipper.go:55:20: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework/skipper.skipInternalf
# k8s.io/kubernetes/test/e2e/cloud/gcp/common
test/e2e/cloud/gcp/common/upgrade_mechanics.go:113:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/e2e/framework
# [k8s.io/kubernetes/test/e2e/framework]
test/e2e/framework/flake_reporting_util.go:60:7: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/framework.go:314:10: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/framework.go:396:10: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
# k8s.io/kubernetes/test/e2e/framework/node
# [k8s.io/kubernetes/test/e2e/framework/node]
test/e2e/framework/node/resource.go:131:22: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/node/resource.go:835:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
# k8s.io/kubernetes/test/e2e/framework/network
test/e2e/framework/network/utils.go:258:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/network/utils.go:557:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/network/utils.go:562:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/e2e/framework/debug
test/e2e/framework/debug/resource_usage_gatherer.go:598:31: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/test/images/agnhost/netexec
test/images/agnhost/netexec/netexec.go:288:17: non-constant format string in call to fmt.Fprintf
# k8s.io/kubernetes/test/images/agnhost/net
test/images/agnhost/net/main.go:181:17: non-constant format string in call to fmt.Fprintf
# k8s.io/kubernetes/test/images/agnhost/crd-conversion-webhook/converter
# [k8s.io/kubernetes/test/images/agnhost/crd-conversion-webhook/converter]
test/images/agnhost/crd-conversion-webhook/converter/framework.go:130:15: non-constant format string in call to k8s.io/klog/v2.Errorf
test/images/agnhost/crd-conversion-webhook/converter/framework.go:150:16: non-constant format string in call to k8s.io/klog/v2.Errorf
test/images/agnhost/crd-conversion-webhook/converter/framework.go:164:16: non-constant format string in call to k8s.io/klog/v2.Errorf
test/images/agnhost/crd-conversion-webhook/converter/framework.go:185:15: non-constant format string in call to k8s.io/klog/v2.Errorf
# k8s.io/kubernetes/test/instrumentation
# [k8s.io/kubernetes/test/instrumentation]
test/instrumentation/decode_metric.go:348:37: non-constant format string in call to k8s.io/kubernetes/test/instrumentation.newDecodeErrorf
test/instrumentation/decode_metric.go:774:43: non-constant format string in call to k8s.io/kubernetes/test/instrumentation.newDecodeErrorf
# k8s.io/kubernetes/test/e2e/storage/testsuites
test/e2e/storage/testsuites/multivolume.go:765:20: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework/skipper.Skipf
test/e2e/storage/testsuites/volumelimits.go:317:21: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/test/e2e/scheduling
test/e2e/scheduling/limit_range.go:300:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/integration/framework
test/integration/framework/util.go:161:18: non-constant format string in call to k8s.io/klog/v2.Infof
# k8s.io/kubernetes/test/e2e/windows
test/e2e/windows/gmsa_full.go:115:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/windows/gmsa_full.go:121:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/windows/gmsa_full.go:127:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/windows/gmsa_full.go:179:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/windows/gmsa_full.go:185:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/windows/gmsa_full.go:191:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
# k8s.io/kubernetes/test/e2e/framework/ingress
# [k8s.io/kubernetes/test/e2e/framework/ingress]
test/e2e/framework/ingress/ingress_utils.go:563:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/ingress/ingress_utils.go:832:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/e2e/framework/statefulset
test/e2e/framework/statefulset/rest.go:53:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/framework/statefulset/rest.go:53:29: non-constant format string in call to fmt.Sprintf
test/e2e/framework/statefulset/rest.go:57:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/e2e/kubectl
test/e2e/kubectl/kubectl.go:224:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/kubectl/kubectl.go:399:20: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/kubectl/kubectl.go:1633:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/kubectl/kubectl.go:1641:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/kubectl/kubectl.go:1918:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/kubectl/kubectl.go:1986:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/kubectl/kubectl.go:2333:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
# k8s.io/kubernetes/test/e2e/upgrades/apps
test/e2e/upgrades/apps/cassandra.go:134:26: non-constant format string in call to fmt.Errorf
test/e2e/upgrades/apps/cassandra.go:156:21: non-constant format string in call to fmt.Errorf
test/e2e/upgrades/apps/etcd.go:128:26: non-constant format string in call to fmt.Errorf
test/e2e/upgrades/apps/etcd.go:149:21: non-constant format string in call to fmt.Errorf
test/e2e/upgrades/apps/mysql.go:197:21: non-constant format string in call to fmt.Errorf
test/e2e/upgrades/apps/mysql.go:215:24: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/test/e2e/storage
test/e2e/storage/volume_provisioning.go:553:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/storage/volume_provisioning.go:592:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/e2e/apps
test/e2e/apps/statefulset.go:2015:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/apps/statefulset.go:2050:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/apps/statefulset.go:2059:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/apps/statefulset.go:2090:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/apps/statefulset.go:2120:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/apps/statefulset.go:2129:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/e2e/cloud/gcp
test/e2e/cloud/gcp/ha_master.go:43:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/cloud/gcp/ha_master.go:52:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/cloud/gcp/ha_master.go:61:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/cloud/gcp/ha_master.go:70:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/integration/dualstack
# [k8s.io/kubernetes/test/integration/dualstack]
test/integration/dualstack/dualstack_test.go:1387:21: non-constant format string in call to fmt.Errorf
# k8s.io/kubernetes/test/e2e/apimachinery
test/e2e/apimachinery/aggregator.go:556:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
test/e2e/apimachinery/aggregator.go:562:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/apimachinery/aggregator.go:776:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/apimachinery/garbage_collector.go:265:19: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/integration/garbagecollector
# [k8s.io/kubernetes/test/integration/garbagecollector]
test/integration/garbagecollector/garbage_collector_test.go:700:12: non-constant format string in call to (*testing.common).Fatalf
# k8s.io/kubernetes/test/e2e/network
test/e2e/network/dns_common.go:126:20: non-constant format string in call to fmt.Errorf
test/e2e/network/proxy.go:274:21: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/network/service.go:266:18: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/network/service_latency.go:105:20: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/network/service_latency.go:132:20: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Failf
test/e2e/network/util.go:84:17: non-constant format string in call to k8s.io/kubernetes/test/e2e/framework.Logf
# k8s.io/kubernetes/test/integration/servicecidr
# [k8s.io/kubernetes/test/integration/servicecidr]
test/integration/servicecidr/allocator_test.go:71:21: non-constant format string in call to fmt.Sprintf
[root@raji-x86-workspace1 kubernetes]#
[root@raji-x86-workspace1 kubernetes]# go version
go version devel go1.24-de0aafa3c7 Wed Sep 4 20:42:05 2024 +0000 linux/amd64
[root@raji-x86-workspace1 kubernetes]#

Fixes of below kind are needed:

diff --git a/pkg/kubeapiserver/authorizer/config.go b/pkg/kubeapiserver/authorizer/config.go
index e654ed317f6..3b37c7a1885 100644
--- a/pkg/kubeapiserver/authorizer/config.go
+++ b/pkg/kubeapiserver/authorizer/config.go
@@ -176,7 +176,7 @@ func LoadAndValidateData(data []byte, requireNonWebhookTypes sets.Set[authzconfi
                sets.NewString(modes.AuthorizationModeChoices...),
                sets.NewString(repeatableAuthorizerTypes...),
        ); len(errors) != 0 {
-               return nil, fmt.Errorf(errors.ToAggregate().Error())
+               return nil, fmt.Errorf("%s", errors.ToAggregate().Error())
        }

        // test to check if the authorizer names passed conform to the authorizers for type!=Webhook
diff --git a/test/utils/density_utils.go b/test/utils/density_utils.go
index 23917ad9f3d..7df8d2476d6 100644
--- a/test/utils/density_utils.go
+++ b/test/utils/density_utils.go
@@ -99,7 +99,8 @@ func VerifyLabelsRemoved(c clientset.Interface, nodeName string, labelKeys []str
        }
        for _, labelKey := range labelKeys {
                if node.Labels != nil && len(node.Labels[labelKey]) != 0 {
-                       return fmt.Errorf("Failed removing label " + labelKey + " of the node " + nodeName)
+                       msgf := "Failed removing label %s of the node %s"
+                       return fmt.Errorf(msgf, labelKey, nodeName)
                }
        }
        return nil
diff --git a/test/utils/deployment.go b/test/utils/deployment.go
index a8876d799fc..102d66909d9 100644
--- a/test/utils/deployment.go
+++ b/test/utils/deployment.go
@@ -226,7 +226,7 @@ func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName
        })
        if wait.Interrupted(err) {
                LogReplicaSetsOfDeployment(deployment, nil, newRS, logf)
-               err = fmt.Errorf(reason)
+               err = fmt.Errorf("%s", reason)
        }
        if newRS == nil {
                return fmt.Errorf("deployment %q failed to create new replica set", deploymentName)

Why is this needed?

To support future stable releases of Golang.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

I don’t think so?

yeah, breaks running unit tests by default:

$ gotip test ./pkg/kubelet/pluginmanager/cache
# k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache
# [k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache]
pkg/kubelet/pluginmanager/cache/desired_state_of_world.go:103:20: non-constant format string in call to fmt.Errorf
pkg/kubelet/pluginmanager/cache/desired_state_of_world.go:111:20: non-constant format string in call to fmt.Errorf
pkg/kubelet/pluginmanager/cache/desired_state_of_world.go:111:43: non-constant format string in call to fmt.Errorf
FAIL	k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache [build failed]
go help test
...
As part of building a test binary, go test runs go vet on the package
and its test source files to identify significant problems. If go vet
finds any problems, go test reports those and does not run the test
binary. Only a high-confidence subset of the default go vet checks are
used. That subset is: atomic, bool, buildtags, directive, errorsas,
ifaceassert, nilfunc, printf, and stringintconv. You can see
the documentation for these and other vet tests via "go doc cmd/vet".
To disable the running of go vet, use the -vet=off flag. To run all
checks, use the -vet=all flag.

I don’t object to fixing the actual issues in master, of course, but I’d bristle at being required to churn all of that in release branches just to test with a new go version