diff --git a/cmd/scheduler/options/options.go b/cmd/scheduler/options/options.go index 8837ffd7fa1..d175cb9f7c5 100644 --- a/cmd/scheduler/options/options.go +++ b/cmd/scheduler/options/options.go @@ -14,6 +14,7 @@ limitations under the License. package options import ( + "errors" "fmt" "strconv" "strings" @@ -139,7 +140,7 @@ func New(origArgs []string) (*Options, error) { if fs.Changed("kubeconfig") { if opts.Mode != string(modes.KubernetesMode) { - return nil, fmt.Errorf("kubeconfig flag is only valid in --mode=kubernetes") + return nil, errors.New("kubeconfig flag is only valid in --mode=kubernetes") } opts.KubeConfig = &opts.kubeconfig } diff --git a/pkg/scheduler/server/internal/controller/controller.go b/pkg/scheduler/server/internal/controller/controller.go index 85c9d8352d7..5b67d9d5449 100644 --- a/pkg/scheduler/server/internal/controller/controller.go +++ b/pkg/scheduler/server/internal/controller/controller.go @@ -15,6 +15,7 @@ package controller import ( "context" + "errors" "fmt" "os" @@ -98,7 +99,7 @@ func New(opts Options) (concurrency.Runner, error) { return fmt.Errorf("unable to get informer: %w", err) } if !mgr.GetCache().WaitForCacheSync(ctx) { - return fmt.Errorf("unable to sync cache") + return errors.New("unable to sync cache") } hzTarget.Ready() log.Info("Controller ready") diff --git a/pkg/scheduler/server/internal/controller/namespace_test.go b/pkg/scheduler/server/internal/controller/namespace_test.go index 51d5a899a30..76ee2919229 100644 --- a/pkg/scheduler/server/internal/controller/namespace_test.go +++ b/pkg/scheduler/server/internal/controller/namespace_test.go @@ -63,7 +63,6 @@ func Test_Reconcile(t *testing.T) { req := ctrl.Request{NamespacedName: types.NamespacedName{Name: "test-ns"}} for name, test := range tests { - test := test t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/tests/integration/framework/process/scheduler/scheduler.go b/tests/integration/framework/process/scheduler/scheduler.go index 132ab77e81d..2d0475d4bc7 100644 --- a/tests/integration/framework/process/scheduler/scheduler.go +++ b/tests/integration/framework/process/scheduler/scheduler.go @@ -347,7 +347,7 @@ func (s *Scheduler) ETCDClient(t *testing.T) *clientv3.Client { t.Helper() client, err := clientv3.New(clientv3.Config{ - Endpoints: []string{fmt.Sprintf("127.0.0.1:%s", s.EtcdClientPort())}, + Endpoints: []string{"127.0.0.1:" + s.EtcdClientPort()}, DialTimeout: 40 * time.Second, }) require.NoError(t, err)