From 67f8a9fb812ccd8889d7bac59ea87a36078d754e Mon Sep 17 00:00:00 2001 From: Andreas Gerstmayr Date: Wed, 31 May 2023 11:10:59 +0200 Subject: [PATCH] Rename operator deployment Commit 7fa448aa2bf28fb44ecf0cb530f7a530855894d6 added additional labels to the operator deployment and its selector field. Unfortunately the selector field is immutable, and when OLM tries to patch the deployment while upgrading, Kubernetes will reject this update. A workaround is to rename the deployment, as suggested here: https://github.com/operator-framework/operator-lifecycle-manager/issues/952 Signed-off-by: Andreas Gerstmayr --- .chloggen/rename_operator_deployment.yaml | 16 ++++++++++++++++ .../tempo-operator.clusterserviceversion.yaml | 6 +++--- .../tempo-operator.clusterserviceversion.yaml | 6 +++--- config/default/manager_auth_proxy_patch.yaml | 2 +- config/default/manager_config_patch.yaml | 2 +- config/default/manager_webhook_patch.yaml | 2 +- config/manager/manager.yaml | 2 +- .../openshift/manager_auth_proxy_tls_patch.yaml | 2 +- 8 files changed, 27 insertions(+), 11 deletions(-) create mode 100755 .chloggen/rename_operator_deployment.yaml diff --git a/.chloggen/rename_operator_deployment.yaml b/.chloggen/rename_operator_deployment.yaml new file mode 100755 index 000000000..996be85fb --- /dev/null +++ b/.chloggen/rename_operator_deployment.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: operator + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Rename operator deployment to enable upgrading from 0.1.0 + +# One or more tracking issues related to the change +issues: [432] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml b/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml index 8f72b08c0..951a5e9a0 100644 --- a/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml +++ b/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml @@ -640,7 +640,7 @@ spec: app.kubernetes.io/name: tempo-operator app.kubernetes.io/part-of: tempo-operator control-plane: controller-manager - name: tempo-operator-controller-manager + name: tempo-operator-controller-manager-v2 spec: replicas: 1 selector: @@ -805,7 +805,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: tempo-operator-controller-manager + deploymentName: tempo-operator-controller-manager-v2 failurePolicy: Fail generateName: mtempostack.tempo.grafana.com rules: @@ -825,7 +825,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: tempo-operator-controller-manager + deploymentName: tempo-operator-controller-manager-v2 failurePolicy: Fail generateName: vtempostack.tempo.grafana.com rules: diff --git a/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml b/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml index fa25a341c..56c33b1f1 100644 --- a/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml +++ b/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml @@ -640,7 +640,7 @@ spec: app.kubernetes.io/name: tempo-operator app.kubernetes.io/part-of: tempo-operator control-plane: controller-manager - name: tempo-operator-controller-manager + name: tempo-operator-controller-manager-v2 spec: replicas: 1 selector: @@ -816,7 +816,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: tempo-operator-controller-manager + deploymentName: tempo-operator-controller-manager-v2 failurePolicy: Fail generateName: mtempostack.tempo.grafana.com rules: @@ -836,7 +836,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: tempo-operator-controller-manager + deploymentName: tempo-operator-controller-manager-v2 failurePolicy: Fail generateName: vtempostack.tempo.grafana.com rules: diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index cec149a07..07b4e8fd5 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-manager-v2 namespace: system spec: template: diff --git a/config/default/manager_config_patch.yaml b/config/default/manager_config_patch.yaml index 66db78379..29f71e42a 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-manager-v2 namespace: system spec: template: diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml index 738de350b..2b8155447 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-manager-v2 namespace: system spec: template: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 2bf932008..428237b90 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -8,7 +8,7 @@ metadata: apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller-manager-v2 namespace: system labels: control-plane: controller-manager diff --git a/config/overlays/openshift/manager_auth_proxy_tls_patch.yaml b/config/overlays/openshift/manager_auth_proxy_tls_patch.yaml index 83623808b..a1dd39400 100644 --- a/config/overlays/openshift/manager_auth_proxy_tls_patch.yaml +++ b/config/overlays/openshift/manager_auth_proxy_tls_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: controller-manager-v2 namespace: system spec: template: