From aa26b048b9786eb35ffacc51baeef96cf53a2924 Mon Sep 17 00:00:00 2001 From: Andy Stoneberg Date: Fri, 12 Sep 2025 14:17:06 -0400 Subject: [PATCH] chore: update controller manifests to follow conventions This commit brings about various changes to improve naming consistency across the `workspaces/` components. The original `controller/` manifests were generated by kubebuilder and were not aligned with the conventions we have established in the `backend` and `frontend` components. Changing the manifests also had a "trickle effect" of requiring minor modifications to the `Makefile` as well as some e2e tests and documentation. Key manifest changes: - dropped `namePrefix` transformation - standardized on `kubeflow-workspaces` namespace - leveraged name of `workspaces-controller` where sensible - Standardized `app.kubernetes.io/*` labels across all resources - leveraging `labels` transformation as much as possible - selectively applied `includeSelectors: true` when appropriate - Removed legacy control-plane=controller-manager labels - replaced with appropriate `app.kubernetes.io/*` labels to keep behavioral parity Signed-off-by: Andy Stoneberg --- workspaces/controller/Makefile | 7 ++++-- workspaces/controller/PROJECT | 2 +- workspaces/controller/README.md | 10 ++++---- .../config/certmanager/certificate.yaml | 12 ---------- .../config/certmanager/kustomization.yaml | 4 ++++ .../config/default/kustomization.yaml | 20 ++++++---------- .../config/default/manager_config_patch.yaml | 3 +-- .../config/default/manager_metrics_patch.yaml | 3 +-- .../config/default/manager_webhook_patch.yaml | 3 +-- .../default/webhookcainjection_patch.yaml | 5 ---- .../config/manager/kustomization.yaml | 11 ++++++++- .../controller/config/manager/manager.yaml | 23 +++++-------------- .../config/prometheus/kustomization.yaml | 4 ++++ .../controller/config/prometheus/monitor.yaml | 9 ++------ .../controller/config/rbac/kustomization.yaml | 5 ++++ .../config/rbac/leader_election_role.yaml | 3 --- .../rbac/leader_election_role_binding.yaml | 7 ++---- .../config/rbac/metrics_service.yaml | 9 ++------ .../controller/config/rbac/role_binding.yaml | 7 ++---- .../config/rbac/service_account.yaml | 6 +---- .../config/rbac/workspace_editor_role.yaml | 3 --- .../config/rbac/workspace_viewer_role.yaml | 3 --- .../rbac/workspacekind_editor_role.yaml | 3 --- .../rbac/workspacekind_viewer_role.yaml | 3 --- .../config/webhook/kustomization.yaml | 4 ++++ .../controller/config/webhook/service.yaml | 6 +---- workspaces/controller/go.mod | 2 +- workspaces/controller/test/e2e/e2e_test.go | 16 ++++++------- 28 files changed, 73 insertions(+), 120 deletions(-) diff --git a/workspaces/controller/Makefile b/workspaces/controller/Makefile index 6032c8c9..34a97a31 100644 --- a/workspaces/controller/Makefile +++ b/workspaces/controller/Makefile @@ -1,5 +1,8 @@ # Image URL to use all building/pushing image targets -IMG ?= controller:latest +TAG ?= $(shell git describe --tags --always --dirty) +IMG ?= ghcr.io/kubeflow/notebooks/workspaces-controller:$(TAG) + + # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.31.0 @@ -128,7 +131,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform .PHONY: build-installer build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment. mkdir -p dist - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + cd config/manager && $(KUSTOMIZE) edit set image workspaces-controller=${IMG} $(KUSTOMIZE) build config/default > dist/install.yaml ##@ Deployment diff --git a/workspaces/controller/PROJECT b/workspaces/controller/PROJECT index 4a01c524..64543903 100644 --- a/workspaces/controller/PROJECT +++ b/workspaces/controller/PROJECT @@ -5,7 +5,7 @@ domain: kubeflow.org layout: - go.kubebuilder.io/v4 -projectName: workspace-controller +projectName: workspaces-controller repo: github.com/kubeflow/notebooks/workspaces/controller resources: - api: diff --git a/workspaces/controller/README.md b/workspaces/controller/README.md index b4c97ce2..d98e1fc7 100644 --- a/workspaces/controller/README.md +++ b/workspaces/controller/README.md @@ -4,7 +4,7 @@ The Kubeflow Workspace Controller is responsible for reconciling the `Workspace` > ⚠️ __Warning__ ⚠️ > > The Kubeflow Workspace Controller is a work in progress and is __NOT__ currently ready for use. -> We greatly appreciate any contributions. +> We greatly appreciate any contributions. ## Getting Started @@ -18,7 +18,7 @@ The Kubeflow Workspace Controller is responsible for reconciling the `Workspace` **Build and push your image to the location specified by `IMG`:** ```sh -make docker-build docker-push IMG=/workspace-controller:tag +make docker-build docker-push IMG=/workspaces-controller:tag ``` **NOTE:** This image ought to be published in the personal registry you specified. @@ -34,7 +34,7 @@ make install **Deploy the Manager to the cluster with the image specified by `IMG`:** ```sh -make deploy IMG=/workspace-controller:tag +make deploy IMG=/workspaces-controller:tag ``` > **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin @@ -75,7 +75,7 @@ Following are the steps to build the installer and distribute this project to us 1. Build the installer for the image built and published in the registry: ```sh -make build-installer IMG=/workspace-controller:tag +make build-installer IMG=/workspaces-controller:tag ``` NOTE: The makefile target mentioned above generates an 'install.yaml' @@ -88,5 +88,5 @@ its dependencies. Users can just run kubectl apply -f to install the project, i.e.: ```sh -kubectl apply -f https://raw.githubusercontent.com//workspace-controller//dist/install.yaml +kubectl apply -f https://raw.githubusercontent.com//workspaces-controller//dist/install.yaml ``` diff --git a/workspaces/controller/config/certmanager/certificate.yaml b/workspaces/controller/config/certmanager/certificate.yaml index 7943460b..75e2fb17 100644 --- a/workspaces/controller/config/certmanager/certificate.yaml +++ b/workspaces/controller/config/certmanager/certificate.yaml @@ -5,14 +5,8 @@ apiVersion: cert-manager.io/v1 kind: Issuer metadata: labels: - app.kubernetes.io/name: certificate app.kubernetes.io/instance: serving-cert - app.kubernetes.io/component: certificate - app.kubernetes.io/created-by: workspace-controller - app.kubernetes.io/part-of: workspace-controller - app.kubernetes.io/managed-by: kustomize name: selfsigned-issuer - namespace: system spec: selfSigned: {} --- @@ -20,14 +14,8 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: labels: - app.kubernetes.io/name: certificate app.kubernetes.io/instance: serving-cert - app.kubernetes.io/component: certificate - app.kubernetes.io/created-by: workspace-controller - app.kubernetes.io/part-of: workspace-controller - app.kubernetes.io/managed-by: kustomize name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml - namespace: system spec: # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize dnsNames: diff --git a/workspaces/controller/config/certmanager/kustomization.yaml b/workspaces/controller/config/certmanager/kustomization.yaml index bebea5a5..7cfada1f 100644 --- a/workspaces/controller/config/certmanager/kustomization.yaml +++ b/workspaces/controller/config/certmanager/kustomization.yaml @@ -1,3 +1,7 @@ +labels: +- pairs: + app.kubernetes.io/component: webhook + resources: - certificate.yaml diff --git a/workspaces/controller/config/default/kustomization.yaml b/workspaces/controller/config/default/kustomization.yaml index 6ac63df2..4c8495f6 100644 --- a/workspaces/controller/config/default/kustomization.yaml +++ b/workspaces/controller/config/default/kustomization.yaml @@ -1,18 +1,12 @@ # Adds namespace to all resources. -namespace: workspace-controller-system +namespace: kubeflow-workspaces -# Value of this field is prepended to the -# names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". -# Note that it should also match with the prefix (text before '-') of the namespace -# field above. -namePrefix: workspace-controller- - -# Labels to add to all resources and selectors. -#labels: -#- includeSelectors: true -# pairs: -# someName: someValue +labels: +- includeSelectors: true + pairs: + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: workspaces-controller + app.kubernetes.io/part-of: kubeflow-workspaces resources: - ../crd diff --git a/workspaces/controller/config/default/manager_config_patch.yaml b/workspaces/controller/config/default/manager_config_patch.yaml index f6f58916..71a1a0db 100644 --- a/workspaces/controller/config/default/manager_config_patch.yaml +++ b/workspaces/controller/config/default/manager_config_patch.yaml @@ -1,8 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager - namespace: system + name: workspaces-controller spec: template: spec: diff --git a/workspaces/controller/config/default/manager_metrics_patch.yaml b/workspaces/controller/config/default/manager_metrics_patch.yaml index ee197d3f..dc58f4ab 100644 --- a/workspaces/controller/config/default/manager_metrics_patch.yaml +++ b/workspaces/controller/config/default/manager_metrics_patch.yaml @@ -2,8 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager - namespace: system + name: workspaces-controller spec: template: spec: diff --git a/workspaces/controller/config/default/manager_webhook_patch.yaml b/workspaces/controller/config/default/manager_webhook_patch.yaml index 738de350..abfb290d 100644 --- a/workspaces/controller/config/default/manager_webhook_patch.yaml +++ b/workspaces/controller/config/default/manager_webhook_patch.yaml @@ -1,8 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager - namespace: system + name: workspaces-controller spec: template: spec: diff --git a/workspaces/controller/config/default/webhookcainjection_patch.yaml b/workspaces/controller/config/default/webhookcainjection_patch.yaml index 0124dbc5..5403ad05 100644 --- a/workspaces/controller/config/default/webhookcainjection_patch.yaml +++ b/workspaces/controller/config/default/webhookcainjection_patch.yaml @@ -4,12 +4,7 @@ apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: labels: - app.kubernetes.io/name: validatingwebhookconfiguration app.kubernetes.io/instance: validating-webhook-configuration - app.kubernetes.io/component: webhook - app.kubernetes.io/created-by: workspace-controller - app.kubernetes.io/part-of: workspace-controller - app.kubernetes.io/managed-by: kustomize name: validating-webhook-configuration annotations: cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME diff --git a/workspaces/controller/config/manager/kustomization.yaml b/workspaces/controller/config/manager/kustomization.yaml index 2c5fb1ff..09ed5840 100644 --- a/workspaces/controller/config/manager/kustomization.yaml +++ b/workspaces/controller/config/manager/kustomization.yaml @@ -2,7 +2,16 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - manager.yaml + +labels: +- includeSelectors: true + pairs: + app.kubernetes.io/component: controller-manager + images: - name: controller - newName: ghcr.io/kubeflow/notebooks/workspace-controller + newName: ghcr.io/kubeflow/notebooks/workspaces-controller + newTag: latest +- name: workspaces-controller + newName: ghcr.io/kubeflow/notebooks/workspaces-controller newTag: latest diff --git a/workspaces/controller/config/manager/manager.yaml b/workspaces/controller/config/manager/manager.yaml index 1e6d6609..1595fea2 100644 --- a/workspaces/controller/config/manager/manager.yaml +++ b/workspaces/controller/config/manager/manager.yaml @@ -1,32 +1,21 @@ apiVersion: v1 kind: Namespace metadata: - labels: - control-plane: controller-manager - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize - name: system + name: kubeflow-workspaces --- apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager - namespace: system - labels: - control-plane: controller-manager - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize + name: workspaces-controller spec: selector: - matchLabels: - control-plane: controller-manager + matchLabels: {} replicas: 1 template: metadata: annotations: kubectl.kubernetes.io/default-container: manager - labels: - control-plane: controller-manager + labels: {} spec: # TODO(user): Uncomment the following code to configure the nodeAffinity expression # according to the platforms which are supported by your solution. @@ -64,7 +53,7 @@ spec: - --leader-elect - --health-probe-bind-address=:8081 - --metrics-bind-address=0 - image: controller:latest + image: workspaces-controller:latest imagePullPolicy: IfNotPresent name: manager securityContext: @@ -93,5 +82,5 @@ spec: requests: cpu: 10m memory: 64Mi - serviceAccountName: controller-manager + serviceAccountName: workspaces-controller terminationGracePeriodSeconds: 10 diff --git a/workspaces/controller/config/prometheus/kustomization.yaml b/workspaces/controller/config/prometheus/kustomization.yaml index ed137168..614884a9 100644 --- a/workspaces/controller/config/prometheus/kustomization.yaml +++ b/workspaces/controller/config/prometheus/kustomization.yaml @@ -1,2 +1,6 @@ resources: - monitor.yaml + +labels: +- pairs: + app.kubernetes.io/component: metrics diff --git a/workspaces/controller/config/prometheus/monitor.yaml b/workspaces/controller/config/prometheus/monitor.yaml index e2473fed..fa6a4dd5 100644 --- a/workspaces/controller/config/prometheus/monitor.yaml +++ b/workspaces/controller/config/prometheus/monitor.yaml @@ -2,12 +2,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - labels: - control-plane: controller-manager - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize - name: controller-manager-metrics-monitor - namespace: system + name: workspaces-controller-metrics-monitor spec: endpoints: - path: /metrics @@ -15,4 +10,4 @@ spec: scheme: http selector: matchLabels: - control-plane: controller-manager + app.kubernetes.io/component: controller-manager diff --git a/workspaces/controller/config/rbac/kustomization.yaml b/workspaces/controller/config/rbac/kustomization.yaml index 7221cd43..b5f0bf15 100644 --- a/workspaces/controller/config/rbac/kustomization.yaml +++ b/workspaces/controller/config/rbac/kustomization.yaml @@ -1,3 +1,7 @@ +labels: +- pairs: + app.kubernetes.io/component: controller-manager + resources: # All RBAC will be applied under this service account in # the deployment namespace. You may comment out this resource @@ -18,3 +22,4 @@ resources: - workspacekind_viewer_role.yaml - workspace_editor_role.yaml - workspace_viewer_role.yaml + diff --git a/workspaces/controller/config/rbac/leader_election_role.yaml b/workspaces/controller/config/rbac/leader_election_role.yaml index 7e0c160f..4190ec80 100644 --- a/workspaces/controller/config/rbac/leader_election_role.yaml +++ b/workspaces/controller/config/rbac/leader_election_role.yaml @@ -2,9 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: leader-election-role rules: - apiGroups: diff --git a/workspaces/controller/config/rbac/leader_election_role_binding.yaml b/workspaces/controller/config/rbac/leader_election_role_binding.yaml index abbd3f91..d1b4acd2 100644 --- a/workspaces/controller/config/rbac/leader_election_role_binding.yaml +++ b/workspaces/controller/config/rbac/leader_election_role_binding.yaml @@ -1,9 +1,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: leader-election-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io @@ -11,5 +8,5 @@ roleRef: name: leader-election-role subjects: - kind: ServiceAccount - name: controller-manager - namespace: system + name: workspaces-controller + namespace: kubeflow-workspaces diff --git a/workspaces/controller/config/rbac/metrics_service.yaml b/workspaces/controller/config/rbac/metrics_service.yaml index 2881b756..fcfe0bda 100644 --- a/workspaces/controller/config/rbac/metrics_service.yaml +++ b/workspaces/controller/config/rbac/metrics_service.yaml @@ -1,12 +1,7 @@ apiVersion: v1 kind: Service metadata: - labels: - control-plane: controller-manager - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize - name: controller-manager-metrics-service - namespace: system + name: workspaces-controller-metrics-service spec: ports: - name: http @@ -14,4 +9,4 @@ spec: protocol: TCP targetPort: 8080 selector: - control-plane: controller-manager + app.kubernetes.io/component: controller-manager diff --git a/workspaces/controller/config/rbac/role_binding.yaml b/workspaces/controller/config/rbac/role_binding.yaml index d552ab2c..186de38c 100644 --- a/workspaces/controller/config/rbac/role_binding.yaml +++ b/workspaces/controller/config/rbac/role_binding.yaml @@ -1,9 +1,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io @@ -11,5 +8,5 @@ roleRef: name: manager-role subjects: - kind: ServiceAccount - name: controller-manager - namespace: system + name: workspaces-controller + namespace: kubeflow-workspaces diff --git a/workspaces/controller/config/rbac/service_account.yaml b/workspaces/controller/config/rbac/service_account.yaml index 90b5d57e..7367bd17 100644 --- a/workspaces/controller/config/rbac/service_account.yaml +++ b/workspaces/controller/config/rbac/service_account.yaml @@ -1,8 +1,4 @@ apiVersion: v1 kind: ServiceAccount metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize - name: controller-manager - namespace: system + name: workspaces-controller diff --git a/workspaces/controller/config/rbac/workspace_editor_role.yaml b/workspaces/controller/config/rbac/workspace_editor_role.yaml index c8a2ae88..8915c201 100644 --- a/workspaces/controller/config/rbac/workspace_editor_role.yaml +++ b/workspaces/controller/config/rbac/workspace_editor_role.yaml @@ -2,9 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: workspace-editor-role rules: - apiGroups: diff --git a/workspaces/controller/config/rbac/workspace_viewer_role.yaml b/workspaces/controller/config/rbac/workspace_viewer_role.yaml index 37643dc3..6a1b5b9a 100644 --- a/workspaces/controller/config/rbac/workspace_viewer_role.yaml +++ b/workspaces/controller/config/rbac/workspace_viewer_role.yaml @@ -2,9 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: workspace-viewer-role rules: - apiGroups: diff --git a/workspaces/controller/config/rbac/workspacekind_editor_role.yaml b/workspaces/controller/config/rbac/workspacekind_editor_role.yaml index 0ec9182a..685626c2 100644 --- a/workspaces/controller/config/rbac/workspacekind_editor_role.yaml +++ b/workspaces/controller/config/rbac/workspacekind_editor_role.yaml @@ -2,9 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: workspacekind-editor-role rules: - apiGroups: diff --git a/workspaces/controller/config/rbac/workspacekind_viewer_role.yaml b/workspaces/controller/config/rbac/workspacekind_viewer_role.yaml index 986f15e8..ce3095b5 100644 --- a/workspaces/controller/config/rbac/workspacekind_viewer_role.yaml +++ b/workspaces/controller/config/rbac/workspacekind_viewer_role.yaml @@ -2,9 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: workspacekind-viewer-role rules: - apiGroups: diff --git a/workspaces/controller/config/webhook/kustomization.yaml b/workspaces/controller/config/webhook/kustomization.yaml index 9cf26134..e0bbf32b 100644 --- a/workspaces/controller/config/webhook/kustomization.yaml +++ b/workspaces/controller/config/webhook/kustomization.yaml @@ -1,3 +1,7 @@ +labels: +- pairs: + app.kubernetes.io/component: webhook + resources: - manifests.yaml - service.yaml diff --git a/workspaces/controller/config/webhook/service.yaml b/workspaces/controller/config/webhook/service.yaml index ddabd8e7..e4b01949 100644 --- a/workspaces/controller/config/webhook/service.yaml +++ b/workspaces/controller/config/webhook/service.yaml @@ -1,15 +1,11 @@ apiVersion: v1 kind: Service metadata: - labels: - app.kubernetes.io/name: workspace-controller - app.kubernetes.io/managed-by: kustomize name: webhook-service - namespace: system spec: ports: - port: 443 protocol: TCP targetPort: 9443 selector: - control-plane: controller-manager + app.kubernetes.io/component: controller-manager diff --git a/workspaces/controller/go.mod b/workspaces/controller/go.mod index 8e1b5b5b..b5c84804 100644 --- a/workspaces/controller/go.mod +++ b/workspaces/controller/go.mod @@ -6,6 +6,7 @@ require ( github.com/go-logr/logr v1.4.2 github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 + golang.org/x/time v0.3.0 k8s.io/api v0.31.0 k8s.io/apimachinery v0.31.0 k8s.io/client-go v0.31.0 @@ -56,7 +57,6 @@ require ( golang.org/x/sys v0.21.0 // indirect golang.org/x/term v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect - golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/workspaces/controller/test/e2e/e2e_test.go b/workspaces/controller/test/e2e/e2e_test.go index 9d075f31..207621fd 100644 --- a/workspaces/controller/test/e2e/e2e_test.go +++ b/workspaces/controller/test/e2e/e2e_test.go @@ -34,8 +34,8 @@ import ( const ( // controller configs - controllerNamespace = "workspace-controller-system" - controllerImage = "ghcr.io/kubeflow/notebooks/workspace-controller:latest" + controllerNamespace = "kubeflow-workspaces" + controllerImage = "ghcr.io/kubeflow/notebooks/workspaces-controller:latest" // workspace configs workspaceNamespace = "workspace-test" @@ -89,17 +89,17 @@ var _ = Describe("controller", Ordered, func() { _, err = utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred()) - By("deploying the controller-manager") + By("deploying the workspaces-controller") cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", controllerImage)) _, err = utils.Run(cmd) ExpectWithOffset(1, err).NotTo(HaveOccurred()) - By("validating that the controller-manager pod is running as expected") + By("validating that the workspaces-controller pod is running as expected") var controllerPodName string verifyControllerUp := func(g Gomega) { // Get controller pod name cmd := exec.Command("kubectl", "get", "pods", - "-l", "control-plane=controller-manager", + "-l", "app.kubernetes.io/component=controller-manager", "-n", controllerNamespace, "-o", "go-template={{ range .items }}"+ "{{ if not .metadata.deletionTimestamp }}"+ @@ -107,13 +107,13 @@ var _ = Describe("controller", Ordered, func() { "{{ \"\\n\" }}{{ end }}{{ end }}", ) podOutput, err := utils.Run(cmd) - g.Expect(err).NotTo(HaveOccurred(), "failed to get controller-manager pod") + g.Expect(err).NotTo(HaveOccurred(), "failed to get workspaces-controller pod") // Ensure only 1 controller pod is running podNames := utils.GetNonEmptyLines(podOutput) g.Expect(podNames).To(HaveLen(1), "expected 1 controller pod running") controllerPodName = podNames[0] - g.Expect(controllerPodName).To(ContainSubstring("controller-manager")) + g.Expect(controllerPodName).To(ContainSubstring("workspaces-controller")) // Validate controller pod status cmd = exec.Command("kubectl", "get", "pods", @@ -123,7 +123,7 @@ var _ = Describe("controller", Ordered, func() { ) statusPhase, err := utils.Run(cmd) g.Expect(err).NotTo(HaveOccurred()) - g.Expect(statusPhase).To(BeEquivalentTo(corev1.PodRunning), "Incorrect controller-manager pod phase") + g.Expect(statusPhase).To(BeEquivalentTo(corev1.PodRunning), "Incorrect workspaces-controller pod phase") } Eventually(verifyControllerUp, timeout, interval).Should(Succeed())