diff --git a/pkg/controller/reconciler/deployment_reconciler_test.go b/pkg/controller/reconciler/deployment_reconciler_test.go index aadd052c2e..68e6a597f6 100644 --- a/pkg/controller/reconciler/deployment_reconciler_test.go +++ b/pkg/controller/reconciler/deployment_reconciler_test.go @@ -64,7 +64,7 @@ func SetupDeploymentTest(t *testing.T) (*mockRadiusClient, client.Client) { Scheme: scheme, Controller: crconfig.Controller{ SkipNameValidation: boolPtr(true), - }, + }, // Suppress metrics in tests to avoid conflicts. Metrics: server.Options{ diff --git a/pkg/controller/reconciler/recipe_reconciler_test.go b/pkg/controller/reconciler/recipe_reconciler_test.go index 2707c9499a..d403829a45 100644 --- a/pkg/controller/reconciler/recipe_reconciler_test.go +++ b/pkg/controller/reconciler/recipe_reconciler_test.go @@ -27,12 +27,11 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" - crconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/client" + crconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) - func SetupRecipeTest(t *testing.T) (*mockRadiusClient, client.Client) { SkipWithoutEnvironment(t) @@ -48,7 +47,7 @@ func SetupRecipeTest(t *testing.T) (*mockRadiusClient, client.Client) { t.Cleanup(cancel) mgr, err := ctrl.NewManager(config, ctrl.Options{ - Scheme: scheme, + Scheme: scheme, Controller: crconfig.Controller{ SkipNameValidation: boolPtr(true), }, diff --git a/pkg/controller/reconciler/shared_test.go b/pkg/controller/reconciler/shared_test.go index 19ae425ef6..fee8540702 100644 --- a/pkg/controller/reconciler/shared_test.go +++ b/pkg/controller/reconciler/shared_test.go @@ -21,7 +21,6 @@ import ( "testing" "time" - appsv1 "k8s.io/api/apps/v1" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" radappiov1alpha3 "github.com/radius-project/radius/pkg/controller/api/radapp.io/v1alpha3" "github.com/radius-project/radius/pkg/corerp/api/v20231001preview" @@ -29,9 +28,10 @@ import ( "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -189,5 +189,5 @@ func makeDeployment(name types.NamespacedName) *appsv1.Deployment { } func boolPtr(b bool) *bool { - return &b + return &b } diff --git a/pkg/ucp/queue/provider/factory.go b/pkg/ucp/queue/provider/factory.go index 739d894e7b..3cc87958c4 100644 --- a/pkg/ucp/queue/provider/factory.go +++ b/pkg/ucp/queue/provider/factory.go @@ -69,7 +69,6 @@ func initAPIServer(ctx context.Context, opt QueueProviderOptions) (queue.Client, Scheme: scheme, } - rc, err := runtimeclient.New(cfg, options) if err != nil { return nil, fmt.Errorf("failed to initialize APIServer client: %w", err)