diff --git a/pkg/hub/controllers/cluster/cluster_controller_test.go b/pkg/hub/controllers/cluster/cluster_controller_test.go index 67a623653..16d30168b 100644 --- a/pkg/hub/controllers/cluster/cluster_controller_test.go +++ b/pkg/hub/controllers/cluster/cluster_controller_test.go @@ -306,6 +306,11 @@ var _ = Describe("Hub ClusterController", func() { Name: PROJECT_NS, }, } + nsmWebhookNs := &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: NSM_WEBHOOK_NS, + }, + } node = &corev1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "test-node", @@ -399,6 +404,7 @@ var _ = Describe("Hub ClusterController", func() { sa = getSA("kubeslice-kubernetes-dashboard", CONTROL_PLANE_NS, operatorSecret.Name) Expect(k8sClient.Create(ctx, node)) Expect(k8sClient.Create(ctx, ns)) + Expect(k8sClient.Create(ctx, nsmWebhookNs)) Expect(k8sClient.Create(ctx, nsSpire)) Expect(k8sClient.Create(ctx, nsIstio)) Expect(k8sClient.Create(ctx, operatorSecret)) @@ -530,9 +536,9 @@ var _ = Describe("Hub ClusterController", func() { ObjectMeta: metav1.ObjectMeta{ Name: "admission-webhook", Labels: map[string]string{ - "app": "admission-webhook-k8s", + "app": "kubeslice-nsm-webhook", }, - Namespace: "kubeslice-system", + Namespace: NSM_WEBHOOK_NS, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ diff --git a/pkg/hub/controllers/cluster/component.go b/pkg/hub/controllers/cluster/component.go index 69850af13..d1daefa80 100644 --- a/pkg/hub/controllers/cluster/component.go +++ b/pkg/hub/controllers/cluster/component.go @@ -27,9 +27,9 @@ var components = []component{ { name: "admission-webhook", labels: map[string]string{ - "app": "admission-webhook-k8s", + "app": "kubeslice-nsm-webhook", }, - ns: controllers.ControlPlaneNamespace, + ns: NSM_WEBHOOK_NS, }, { name: "netop", diff --git a/pkg/hub/controllers/cluster/vars.go b/pkg/hub/controllers/cluster/vars.go index ee17958ca..7f8abc37a 100644 --- a/pkg/hub/controllers/cluster/vars.go +++ b/pkg/hub/controllers/cluster/vars.go @@ -34,4 +34,5 @@ var ( HubCAFile = utils.GetEnvOrDefault("HUB_CA_FILE", "/var/run/secrets/kubernetes.io/hub-serviceaccount/ca.crt") ClusterName = os.Getenv("CLUSTER_NAME") WORKER_INSTALLER_DEFAULT_IMAGE = "aveshasystems/worker-installer:1.1.8" + NSM_WEBHOOK_NS = "kubeslice-nsm-webhook-system" )