From 07403b02e51e68f56935ffabccff76ef1c011ac2 Mon Sep 17 00:00:00 2001 From: Elliott Baron Date: Wed, 11 Sep 2024 13:16:39 -0400 Subject: [PATCH] fix(olm): rename deployment to handle immutable selector (#943) --- Makefile | 2 +- .../cryostat-operator.clusterserviceversion.yaml | 10 +++++----- config/default/image_pull_patch.yaml | 2 +- config/default/image_tag_patch.yaml | 2 +- config/default/manager_auth_proxy_patch.yaml | 2 +- config/default/manager_config_patch.yaml | 2 +- config/default/manager_webhook_patch.yaml | 2 +- config/insights/insights_patch.yaml | 2 +- config/manager/kustomization.yaml | 2 +- config/manager/manager.yaml | 2 +- config/manifests/kustomization.yaml | 2 +- hack/image_pull_patch.yaml.in | 2 +- hack/image_tag_patch.yaml.in | 2 +- hack/insights_patch.yaml.in | 2 +- .../resource_definitions/resource_definitions.go | 2 +- internal/controllers/constants/constants.go | 2 +- internal/controllers/reconciler_test.go | 6 +++--- internal/test/scorecard/common_utils.go | 2 +- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index cc5d6f1f3..d8522d72f 100644 --- a/Makefile +++ b/Makefile @@ -514,7 +514,7 @@ deploy: check_cert_manager manifests kustomize predeploy undeploy ## Deploy cont $(KUSTOMIZE) build $(KUSTOMIZE_DIR) | $(CLUSTER_CLIENT) create -f - ifeq ($(DISABLE_SERVICE_TLS), true) @echo "Disabling TLS for in-cluster communication between Services" - @$(CLUSTER_CLIENT) -n $(DEPLOY_NAMESPACE) set env deployment/cryostat-operator-controller-manager DISABLE_SERVICE_TLS=true + @$(CLUSTER_CLIENT) -n $(DEPLOY_NAMESPACE) set env deployment/cryostat-operator-controller DISABLE_SERVICE_TLS=true endif .PHONY: undeploy diff --git a/bundle/manifests/cryostat-operator.clusterserviceversion.yaml b/bundle/manifests/cryostat-operator.clusterserviceversion.yaml index 1d55dd8e8..4b4b47f11 100644 --- a/bundle/manifests/cryostat-operator.clusterserviceversion.yaml +++ b/bundle/manifests/cryostat-operator.clusterserviceversion.yaml @@ -30,7 +30,7 @@ metadata: capabilities: Seamless Upgrades categories: Monitoring, Developer Tools containerImage: quay.io/cryostat/cryostat-operator:4.0.0-dev - createdAt: "2024-08-07T21:05:35Z" + createdAt: "2024-09-11T16:26:11Z" description: JVM monitoring and profiling tool operatorframework.io/initialization-resource: |- { @@ -972,7 +972,7 @@ spec: - label: app.kubernetes.io/name: cryostat-operator control-plane: controller-manager - name: cryostat-operator-controller-manager + name: cryostat-operator-controller spec: replicas: 1 selector: @@ -1186,7 +1186,7 @@ spec: containerPort: 443 conversionCRDs: - cryostats.operator.cryostat.io - deploymentName: cryostat-operator-controller-manager + deploymentName: cryostat-operator-controller generateName: ccryostats.kb.io sideEffects: None targetPort: 9443 @@ -1195,7 +1195,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: cryostat-operator-controller-manager + deploymentName: cryostat-operator-controller failurePolicy: Fail generateName: mcryostat.kb.io rules: @@ -1215,7 +1215,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: cryostat-operator-controller-manager + deploymentName: cryostat-operator-controller failurePolicy: Fail generateName: vcryostat.kb.io rules: diff --git a/config/default/image_pull_patch.yaml b/config/default/image_pull_patch.yaml index 954a05466..9ecd573a0 100644 --- a/config/default/image_pull_patch.yaml +++ b/config/default/image_pull_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/config/default/image_tag_patch.yaml b/config/default/image_tag_patch.yaml index 1f889d50e..262dcd19b 100644 --- a/config/default/image_tag_patch.yaml +++ b/config/default/image_tag_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 208740def..94801cccf 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/config/default/manager_config_patch.yaml b/config/default/manager_config_patch.yaml index 6c400155c..0926f8b39 100644 --- a/config/default/manager_config_patch.yaml +++ b/config/default/manager_config_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml index 738de350b..349289c3d 100644 --- a/config/default/manager_webhook_patch.yaml +++ b/config/default/manager_webhook_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/config/insights/insights_patch.yaml b/config/insights/insights_patch.yaml index 5379bf855..3f144243b 100644 --- a/config/insights/insights_patch.yaml +++ b/config/insights/insights_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 06415e71b..42e8a8d4d 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -9,7 +9,7 @@ generatorOptions: # target: # group: apps # kind: Deployment -# name: controller-manager +# name: controller # namespace: system # version: v1 diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index a8788a81e..4dac0ddd0 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system labels: control-plane: controller-manager diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index be838f0ff..625570d4b 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -15,7 +15,7 @@ patchesJson6902: group: apps version: v1 kind: Deployment - name: controller-manager + name: controller namespace: system patch: |- # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs. diff --git a/hack/image_pull_patch.yaml.in b/hack/image_pull_patch.yaml.in index 567e42269..3d9bafd7b 100644 --- a/hack/image_pull_patch.yaml.in +++ b/hack/image_pull_patch.yaml.in @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/hack/image_tag_patch.yaml.in b/hack/image_tag_patch.yaml.in index 75ae9f77c..9664c5a40 100644 --- a/hack/image_tag_patch.yaml.in +++ b/hack/image_tag_patch.yaml.in @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/hack/insights_patch.yaml.in b/hack/insights_patch.yaml.in index dd30bf6ed..af011e7e1 100644 --- a/hack/insights_patch.yaml.in +++ b/hack/insights_patch.yaml.in @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller namespace: system spec: template: diff --git a/internal/controllers/common/resource_definitions/resource_definitions.go b/internal/controllers/common/resource_definitions/resource_definitions.go index 97a83bec2..3b4d337e0 100644 --- a/internal/controllers/common/resource_definitions/resource_definitions.go +++ b/internal/controllers/common/resource_definitions/resource_definitions.go @@ -98,7 +98,7 @@ func NewDeploymentForCR(cr *model.CryostatInstance, specs *ServiceSpecs, imageTa "app.kubernetes.io/name": "cryostat", } defaultDeploymentAnnotations := map[string]string{ - "app.openshift.io/connects-to": "cryostat-operator-controller-manager", + "app.openshift.io/connects-to": constants.OperatorDeploymentName, } defaultPodLabels := map[string]string{ "app": cr.Name, diff --git a/internal/controllers/constants/constants.go b/internal/controllers/constants/constants.go index 86351dfc1..862d742bd 100644 --- a/internal/controllers/constants/constants.go +++ b/internal/controllers/constants/constants.go @@ -29,7 +29,7 @@ const ( DatabasePort int32 = 5432 LoopbackAddress string = "127.0.0.1" OperatorNamePrefix string = "cryostat-operator-" - OperatorDeploymentName string = "cryostat-operator-controller-manager" + OperatorDeploymentName string = "cryostat-operator-controller" HttpPortName string = "http" // CAKey is the key for a CA certificate within a TLS secret CAKey = certMeta.TLSCAKey diff --git a/internal/controllers/reconciler_test.go b/internal/controllers/reconciler_test.go index d4684b3c4..6aa975e66 100644 --- a/internal/controllers/reconciler_test.go +++ b/internal/controllers/reconciler_test.go @@ -312,7 +312,7 @@ func (c *controllerTest) commonTests() { Expect(err).ToNot(HaveOccurred()) Expect(deploy.Annotations).To(Equal(map[string]string{ - "app.openshift.io/connects-to": "cryostat-operator-controller-manager", + "app.openshift.io/connects-to": "cryostat-operator-controller", "other": "annotation", })) Expect(deploy.Labels).To(Equal(map[string]string{ @@ -2648,7 +2648,7 @@ func (t *cryostatTestInput) expectMainDeployment() { Expect(deployment.Name).To(Equal(t.Name)) Expect(deployment.Namespace).To(Equal(t.Namespace)) Expect(deployment.Annotations).To(Equal(map[string]string{ - "app.openshift.io/connects-to": "cryostat-operator-controller-manager", + "app.openshift.io/connects-to": "cryostat-operator-controller", })) Expect(deployment.Labels).To(Equal(map[string]string{ "app": t.Name, @@ -2674,7 +2674,7 @@ func (t *cryostatTestInput) expectMainDeploymentHasExtraMetadata() { cr := t.getCryostatInstance() Expect(deployment.Annotations).To(Equal(map[string]string{ - "app.openshift.io/connects-to": "cryostat-operator-controller-manager", + "app.openshift.io/connects-to": "cryostat-operator-controller", "myDeploymentExtraAnnotation": "myDeploymentAnnotation", "mySecondDeploymentExtraAnnotation": "mySecondDeploymentAnnotation", })) diff --git a/internal/test/scorecard/common_utils.go b/internal/test/scorecard/common_utils.go index d219d2746..1ee9ecc93 100644 --- a/internal/test/scorecard/common_utils.go +++ b/internal/test/scorecard/common_utils.go @@ -41,7 +41,7 @@ import ( ) const ( - operatorDeploymentName string = "cryostat-operator-controller-manager" + operatorDeploymentName string = "cryostat-operator-controller" testTimeout time.Duration = time.Minute * 10 )