From 7d20a847a80307d4db915f478d7fbde0e45cd862 Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 11 Feb 2026 09:32:00 +0100 Subject: [PATCH 1/4] Add target version annotation to rabbitmq cluster This commit adds the rabbitmq.openstack.org/target-version annotation to the RabbitMQ cluster resource, using the constant from the infra-operator API package. This annotation is used by the infra-operator to trigger version upgrades, including skip-version upgrades (e.g., from 3.9 to 4.x) that require storage wipe. The annotation value is sourced from OpenStackVersion.Status.ServiceDefaults.RabbitmqVersion, allowing the openstack-operator to declaratively control RabbitMQ version upgrades through the OpenStackVersion resource. Jira: https://issues.redhat.com/browse/OSPRH-21178 --- api/bases/core.openstack.org_openstackversions.yaml | 4 ++++ api/core/v1beta1/openstackversion_types.go | 3 ++- api/core/v1beta1/zz_generated.deepcopy.go | 5 +++++ .../bases/core.openstack.org_openstackversions.yaml | 4 ++++ internal/openstack/rabbitmq.go | 10 ++++++++++ internal/openstack/version.go | 3 +++ 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/api/bases/core.openstack.org_openstackversions.yaml b/api/bases/core.openstack.org_openstackversions.yaml index ae79d6c77..0ee152302 100644 --- a/api/bases/core.openstack.org_openstackversions.yaml +++ b/api/bases/core.openstack.org_openstackversions.yaml @@ -250,6 +250,8 @@ spec: properties: glanceWsgi: type: string + rabbitmqVersion: + type: string type: object type: object availableVersion: @@ -685,6 +687,8 @@ spec: properties: glanceWsgi: type: string + rabbitmqVersion: + type: string type: object trackedCustomImages: additionalProperties: diff --git a/api/core/v1beta1/openstackversion_types.go b/api/core/v1beta1/openstackversion_types.go index 1f138156d..3a360b49a 100644 --- a/api/core/v1beta1/openstackversion_types.go +++ b/api/core/v1beta1/openstackversion_types.go @@ -177,7 +177,8 @@ type ContainerTemplate struct { // ServiceDefaults - struct that contains defaults for OSP services that can change over time // but are associated with a specific OpenStack release version type ServiceDefaults struct { - GlanceWsgi *string `json:"glanceWsgi,omitempty"` + GlanceWsgi *string `json:"glanceWsgi,omitempty"` + RabbitmqVersion *string `json:"rabbitmqVersion,omitempty"` } // OpenStackVersionStatus defines the observed state of OpenStackVersion diff --git a/api/core/v1beta1/zz_generated.deepcopy.go b/api/core/v1beta1/zz_generated.deepcopy.go index b8b1cf7fe..a5107687d 100644 --- a/api/core/v1beta1/zz_generated.deepcopy.go +++ b/api/core/v1beta1/zz_generated.deepcopy.go @@ -1763,6 +1763,11 @@ func (in *ServiceDefaults) DeepCopyInto(out *ServiceDefaults) { *out = new(string) **out = **in } + if in.RabbitmqVersion != nil { + in, out := &in.RabbitmqVersion, &out.RabbitmqVersion + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDefaults. diff --git a/config/crd/bases/core.openstack.org_openstackversions.yaml b/config/crd/bases/core.openstack.org_openstackversions.yaml index ae79d6c77..0ee152302 100644 --- a/config/crd/bases/core.openstack.org_openstackversions.yaml +++ b/config/crd/bases/core.openstack.org_openstackversions.yaml @@ -250,6 +250,8 @@ spec: properties: glanceWsgi: type: string + rabbitmqVersion: + type: string type: object type: object availableVersion: @@ -685,6 +687,8 @@ spec: properties: glanceWsgi: type: string + rabbitmqVersion: + type: string type: object trackedCustomImages: additionalProperties: diff --git a/internal/openstack/rabbitmq.go b/internal/openstack/rabbitmq.go index 742b92ac8..d1b7d0732 100644 --- a/internal/openstack/rabbitmq.go +++ b/internal/openstack/rabbitmq.go @@ -277,6 +277,16 @@ func reconcileRabbitMQ( rabbitmq.Spec.TLS.CaSecretName = tlsCert rabbitmq.Spec.TLS.DisableNonTLSListeners = true } + // add annotation to store the target rabbitmq-server version + if rabbitmq.GetAnnotations() == nil { + rabbitmq.SetAnnotations(make(map[string]string)) + } + if version.Status.ServiceDefaults.RabbitmqVersion != nil { + rabbitmq.GetAnnotations()[rabbitmqv1.AnnotationTargetVersion] = *version.Status.ServiceDefaults.RabbitmqVersion + } else { + rabbitmq.GetAnnotations()[rabbitmqv1.AnnotationTargetVersion] = "3.9" + } + rabbitmq.Spec.ContainerImage = *version.Status.ContainerImages.RabbitmqImage err := controllerutil.SetControllerReference(helper.GetBeforeObject(), rabbitmq, helper.GetScheme()) if err != nil { diff --git a/internal/openstack/version.go b/internal/openstack/version.go index f15e6c191..16d4c5616 100644 --- a/internal/openstack/version.go +++ b/internal/openstack/version.go @@ -230,6 +230,9 @@ func InitializeOpenStackVersionServiceDefaults(ctx context.Context) *corev1beta1 trueString := "true" defaults.GlanceWsgi = &trueString // all new glance deployments use WSGI by default (FR3 and later) + versionString := "4.0" + defaults.RabbitmqVersion = &versionString // all new rabbitmq deployments will have rabbitm-server 4.0 (FR5) + return defaults } From d9dae9c0d0ded4adedb9410614b9845b2ff99244 Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 11 Feb 2026 06:50:16 +0100 Subject: [PATCH 2/4] TEMP replace rabbitmq image --- api/go.mod | 2 ++ api/go.sum | 4 ++-- bindata/crds/crds.yaml | 4 ++++ .../rabbitmq.openstack.org_rabbitmqs.yaml | 22 +++++++++++++++++++ config/operator/default_images.yaml | 2 +- config/operator/manager_operator_images.yaml | 2 +- go.mod | 2 ++ go.sum | 4 ++-- hack/export_operator_related_images.sh | 2 +- hack/export_related_images.sh | 2 +- internal/openstack/version.go | 4 ++-- 11 files changed, 40 insertions(+), 10 deletions(-) diff --git a/api/go.mod b/api/go.mod index 1907ac0c5..ed047672d 100644 --- a/api/go.mod +++ b/api/go.mod @@ -143,3 +143,5 @@ replace k8s.io/code-generator => k8s.io/code-generator v0.31.14 //allow-merging replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging + +replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d diff --git a/api/go.sum b/api/go.sum index 70b615753..1ef83fe6a 100644 --- a/api/go.sum +++ b/api/go.sum @@ -90,6 +90,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d h1:kl+je19v7W85U+SlJxsnr8cwXH8qHl68vUOd1RDDBM0= +github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= @@ -126,8 +128,6 @@ github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20260224124345-771 github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20260224124345-771b1609979a/go.mod h1:oCU2YPu91BPMRN8a+gKcct3GRXGaIuBj9JAN73nO4dY= github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260223151854-36176307c2c1 h1:P+yf2BZz5dR5BW8eUHcNK1aQmnHviFZwa0A3D9WPM3g= github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260223151854-36176307c2c1/go.mod h1:rbJiGqYQIGdbfCLienv6qrzC2ve8pl8zhim7Atwe6wE= -github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260226150302-364bc9caac2c h1:JokgOl3nOi+GxYDHsw/Y1zKYFHFOfzLlhMtm39Jig4E= -github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260226150302-364bc9caac2c/go.mod h1:5hS/cVzc/HURwsbp4MMNwgqAl5bUqKvJdK+4irXeymE= github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260223140038-38453280e869 h1:YEBKRN4/vaCzg+jm/7MQwF1R7vsssbgGZIlU4GseF10= github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260223140038-38453280e869/go.mod h1:rwSopRg6m3xK0KVu8UZ7w3UXhInil/5W4qJMOoAH3VE= github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260226214115-ba279900835f h1:kww9uX/ai4jkYhH4zzVNqSp4ea5rt1YHJfNmZVUeeOo= diff --git a/bindata/crds/crds.yaml b/bindata/crds/crds.yaml index 0b90b4f9e..633587405 100644 --- a/bindata/crds/crds.yaml +++ b/bindata/crds/crds.yaml @@ -21461,6 +21461,8 @@ spec: properties: glanceWsgi: type: string + rabbitmqVersion: + type: string type: object type: object availableVersion: @@ -21896,6 +21898,8 @@ spec: properties: glanceWsgi: type: string + rabbitmqVersion: + type: string type: object trackedCustomImages: additionalProperties: diff --git a/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml b/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml index 6185003ec..855ad58a7 100644 --- a/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml +++ b/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml @@ -1940,6 +1940,12 @@ spec: - type type: object type: array + currentVersion: + description: |- + CurrentVersion - the currently deployed RabbitMQ version (e.g., "3.9", "4.2") + This is controller-managed and reflects the actual running version. + openstack-operator should use the "rabbitmq.openstack.org/target-version" annotation to request version changes. + type: string lastAppliedTopology: description: LastAppliedTopology - the last applied Topology properties: @@ -1963,6 +1969,13 @@ spec: the opentack-operator in the top-level CR (e.g. the ContainerImage) format: int64 type: integer + proxyRequired: + description: |- + ProxyRequired - tracks whether the AMQP proxy sidecar is required for this cluster. + Set to true when upgrading from RabbitMQ 3.x to 4.x with Quorum queues. + The proxy allows non-durable clients to work with quorum queues during the upgrade window. + Only cleared when the "rabbitmq.openstack.org/clients-reconfigured" annotation is set. + type: boolean queueType: description: QueueType - store whether default ha-all policy is present or not @@ -1975,6 +1988,15 @@ spec: type: string type: array x-kubernetes-list-type: atomic + upgradePhase: + description: |- + UpgradePhase - tracks the current phase of a version upgrade or migration + Valid values: + "" (no upgrade in progress) + "DeletingResources" (deleting ha-all policy and StatefulSet) + "WaitingForCluster" (waiting for cluster to become ready with new version) + This allows resuming upgrades that failed midway. + type: string type: object type: object served: true diff --git a/config/operator/default_images.yaml b/config/operator/default_images.yaml index 430bc00ce..218f6b9ab 100644 --- a/config/operator/default_images.yaml +++ b/config/operator/default_images.yaml @@ -174,7 +174,7 @@ spec: - name: RELATED_IMAGE_PLACEMENT_API_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-placement-api:current-podified - name: RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT - value: quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified + value: quay.io/lmiccini/openstack-rabbitmq:r42p - name: RELATED_IMAGE_SWIFT_ACCOUNT_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-swift-account:current-podified - name: RELATED_IMAGE_SWIFT_CONTAINER_IMAGE_URL_DEFAULT diff --git a/config/operator/manager_operator_images.yaml b/config/operator/manager_operator_images.yaml index bad5cfffe..590acc55a 100644 --- a/config/operator/manager_operator_images.yaml +++ b/config/operator/manager_operator_images.yaml @@ -26,7 +26,7 @@ spec: - name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL value: quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3 - name: RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL - value: quay.io/openstack-k8s-operators/infra-operator@sha256:e97889bd4dd6896d3272e1237f231c79ecc661730a8a757a527ec6c6716908e5 + value: quay.io/lmiccini/infra-operator@sha256:7e51d7addf6a922d0f308f658bd96c96ef4aa17298f94a8f61aa8a45065a4831 - name: RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL value: quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01 - name: RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL diff --git a/go.mod b/go.mod index 789e8bd96..263ae3ec0 100644 --- a/go.mod +++ b/go.mod @@ -181,3 +181,5 @@ replace k8s.io/code-generator => k8s.io/code-generator v0.31.14 //allow-merging replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging + +replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d diff --git a/go.sum b/go.sum index 2140090a7..3d5ca85c8 100644 --- a/go.sum +++ b/go.sum @@ -114,6 +114,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d h1:kl+je19v7W85U+SlJxsnr8cwXH8qHl68vUOd1RDDBM0= +github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= @@ -150,8 +152,6 @@ github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20260224124345-771 github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20260224124345-771b1609979a/go.mod h1:oCU2YPu91BPMRN8a+gKcct3GRXGaIuBj9JAN73nO4dY= github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260223151854-36176307c2c1 h1:P+yf2BZz5dR5BW8eUHcNK1aQmnHviFZwa0A3D9WPM3g= github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260223151854-36176307c2c1/go.mod h1:rbJiGqYQIGdbfCLienv6qrzC2ve8pl8zhim7Atwe6wE= -github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260226150302-364bc9caac2c h1:JokgOl3nOi+GxYDHsw/Y1zKYFHFOfzLlhMtm39Jig4E= -github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260226150302-364bc9caac2c/go.mod h1:5hS/cVzc/HURwsbp4MMNwgqAl5bUqKvJdK+4irXeymE= github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260223140038-38453280e869 h1:YEBKRN4/vaCzg+jm/7MQwF1R7vsssbgGZIlU4GseF10= github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260223140038-38453280e869/go.mod h1:rwSopRg6m3xK0KVu8UZ7w3UXhInil/5W4qJMOoAH3VE= github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260226214115-ba279900835f h1:kww9uX/ai4jkYhH4zzVNqSp4ea5rt1YHJfNmZVUeeOo= diff --git a/hack/export_operator_related_images.sh b/hack/export_operator_related_images.sh index 14041e78c..ea7d04ac5 100644 --- a/hack/export_operator_related_images.sh +++ b/hack/export_operator_related_images.sh @@ -6,7 +6,7 @@ export RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s- export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:81e43c058d9af1d3bc31704010c630bc2a574c2ee388aa0ffe8c7b9621a7d051 export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/heat-operator@sha256:ee642fcf655f9897d480460008cba2e98b497d3ffdf7ab1d48ea460eb20c2053 export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3 -export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/infra-operator@sha256:e97889bd4dd6896d3272e1237f231c79ecc661730a8a757a527ec6c6716908e5 +export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:7e51d7addf6a922d0f308f658bd96c96ef4aa17298f94a8f61aa8a45065a4831 export RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01 export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:9d723ab33964ee44704eed3223b64e828349d45dee04695434a6fcf4b6807d4c export RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/manila-operator@sha256:f1158ec4d879c4646eee4323bc501eba4d377beb2ad6fbe08ed30070c441ac26 diff --git a/hack/export_related_images.sh b/hack/export_related_images.sh index 52bbf16b7..493de788f 100755 --- a/hack/export_related_images.sh +++ b/hack/export_related_images.sh @@ -2,7 +2,7 @@ export OPENSTACK_RELEASE_VERSION=0.0.1-$(date +%s) export RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified -export RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified +export RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT=quay.io/lmiccini/openstack-rabbitmq:r42p export RELATED_IMAGE_KEYSTONE_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-keystone:current-podified export RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-mariadb:current-podified export RELATED_IMAGE_INFRA_MEMCACHED_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-memcached:current-podified diff --git a/internal/openstack/version.go b/internal/openstack/version.go index 16d4c5616..d04e2bde9 100644 --- a/internal/openstack/version.go +++ b/internal/openstack/version.go @@ -230,8 +230,8 @@ func InitializeOpenStackVersionServiceDefaults(ctx context.Context) *corev1beta1 trueString := "true" defaults.GlanceWsgi = &trueString // all new glance deployments use WSGI by default (FR3 and later) - versionString := "4.0" - defaults.RabbitmqVersion = &versionString // all new rabbitmq deployments will have rabbitm-server 4.0 (FR5) + versionString := "4.2" + defaults.RabbitmqVersion = &versionString // all new rabbitmq deployments will have rabbitm-server 4.2 (FR5) return defaults } From f390b73f52a9e942a5fb20d4acab0b2ccf90d15a Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 4 Mar 2026 20:31:36 +0100 Subject: [PATCH 3/4] make sure queuetype is preserved --- api/go.mod | 2 +- api/go.sum | 4 ++-- config/operator/manager_operator_images.yaml | 2 +- go.mod | 2 +- go.sum | 4 ++-- hack/export_operator_related_images.sh | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/go.mod b/api/go.mod index ed047672d..65fedecb0 100644 --- a/api/go.mod +++ b/api/go.mod @@ -144,4 +144,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging -replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d +replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 diff --git a/api/go.sum b/api/go.sum index 1ef83fe6a..af6821d8c 100644 --- a/api/go.sum +++ b/api/go.sum @@ -90,8 +90,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d h1:kl+je19v7W85U+SlJxsnr8cwXH8qHl68vUOd1RDDBM0= -github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= +github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 h1:mhjQVOAV9rr5iYmM2d3HumVCotRnontXvAMXioTTJc0= +github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= diff --git a/config/operator/manager_operator_images.yaml b/config/operator/manager_operator_images.yaml index 590acc55a..5cd1081b0 100644 --- a/config/operator/manager_operator_images.yaml +++ b/config/operator/manager_operator_images.yaml @@ -26,7 +26,7 @@ spec: - name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL value: quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3 - name: RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL - value: quay.io/lmiccini/infra-operator@sha256:7e51d7addf6a922d0f308f658bd96c96ef4aa17298f94a8f61aa8a45065a4831 + value: quay.io/lmiccini/infra-operator@sha256:6366284fe91e777b5a5b8d7aa375bdae0530285a41ce9264167ebfd92bb83eeb - name: RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL value: quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01 - name: RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL diff --git a/go.mod b/go.mod index 263ae3ec0..62c53df79 100644 --- a/go.mod +++ b/go.mod @@ -182,4 +182,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging -replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d +replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 diff --git a/go.sum b/go.sum index 3d5ca85c8..ee55dd78f 100644 --- a/go.sum +++ b/go.sum @@ -114,8 +114,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d h1:kl+je19v7W85U+SlJxsnr8cwXH8qHl68vUOd1RDDBM0= -github.com/lmiccini/infra-operator/apis v0.0.0-20260304160439-8d991250810d/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= +github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 h1:mhjQVOAV9rr5iYmM2d3HumVCotRnontXvAMXioTTJc0= +github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= diff --git a/hack/export_operator_related_images.sh b/hack/export_operator_related_images.sh index ea7d04ac5..875692511 100644 --- a/hack/export_operator_related_images.sh +++ b/hack/export_operator_related_images.sh @@ -6,7 +6,7 @@ export RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s- export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:81e43c058d9af1d3bc31704010c630bc2a574c2ee388aa0ffe8c7b9621a7d051 export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/heat-operator@sha256:ee642fcf655f9897d480460008cba2e98b497d3ffdf7ab1d48ea460eb20c2053 export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3 -export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:7e51d7addf6a922d0f308f658bd96c96ef4aa17298f94a8f61aa8a45065a4831 +export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:6366284fe91e777b5a5b8d7aa375bdae0530285a41ce9264167ebfd92bb83eeb export RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01 export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:9d723ab33964ee44704eed3223b64e828349d45dee04695434a6fcf4b6807d4c export RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/manila-operator@sha256:f1158ec4d879c4646eee4323bc501eba4d377beb2ad6fbe08ed30070c441ac26 From d377811e38d7c51a7adc884c6291ce3eea5dccf5 Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 11 Mar 2026 14:37:26 +0100 Subject: [PATCH 4/4] use spec instead of label --- ....openstack.org_openstackcontrolplanes.yaml | 3 +++ api/go.mod | 2 +- api/go.sum | 4 ++-- bindata/crds/crds.yaml | 3 +++ .../rabbitmq.openstack.org_rabbitmqs.yaml | 23 +++++++++++++------ ....openstack.org_openstackcontrolplanes.yaml | 3 +++ config/operator/manager_operator_images.yaml | 2 +- go.mod | 2 +- go.sum | 4 ++-- hack/export_operator_related_images.sh | 2 +- internal/openstack/rabbitmq.go | 9 +++----- 11 files changed, 36 insertions(+), 21 deletions(-) diff --git a/api/bases/core.openstack.org_openstackcontrolplanes.yaml b/api/bases/core.openstack.org_openstackcontrolplanes.yaml index 4a0ec3233..619ffff36 100644 --- a/api/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/api/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -14456,6 +14456,9 @@ spec: type: object skipPostDeploySteps: type: boolean + targetVersion: + pattern: ^\d+\.\d+(\.\d+)?$ + type: string terminationGracePeriodSeconds: default: 604800 format: int64 diff --git a/api/go.mod b/api/go.mod index 65fedecb0..f021f1603 100644 --- a/api/go.mod +++ b/api/go.mod @@ -144,4 +144,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging -replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 +replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260311162407-d0bc7fcc319c diff --git a/api/go.sum b/api/go.sum index af6821d8c..212f47fce 100644 --- a/api/go.sum +++ b/api/go.sum @@ -90,8 +90,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 h1:mhjQVOAV9rr5iYmM2d3HumVCotRnontXvAMXioTTJc0= -github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= +github.com/lmiccini/infra-operator/apis v0.0.0-20260311162407-d0bc7fcc319c h1:FWRBCFfW8sJK/OlKQZKKi8RQgnQ78Vof5dxUXnULNP8= +github.com/lmiccini/infra-operator/apis v0.0.0-20260311162407-d0bc7fcc319c/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= diff --git a/bindata/crds/crds.yaml b/bindata/crds/crds.yaml index 633587405..e09285ee2 100644 --- a/bindata/crds/crds.yaml +++ b/bindata/crds/crds.yaml @@ -14721,6 +14721,9 @@ spec: type: object skipPostDeploySteps: type: boolean + targetVersion: + pattern: ^\d+\.\d+(\.\d+)?$ + type: string terminationGracePeriodSeconds: default: 604800 format: int64 diff --git a/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml b/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml index 855ad58a7..baf43687a 100644 --- a/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml +++ b/bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml @@ -1804,6 +1804,14 @@ spec: Has no effect if the cluster only consists of one node. For more information, see https://www.rabbitmq.com/rabbitmq-queues.8.html#rebalance type: boolean + targetVersion: + description: |- + TargetVersion - the desired RabbitMQ version (e.g., "4.2", "3.13.1"). + When set to a version different from Status.CurrentVersion, the controller + will initiate a storage wipe and version upgrade. The controller updates + Status.CurrentVersion once the upgrade completes. + pattern: ^\d+\.\d+(\.\d+)?$ + type: string terminationGracePeriodSeconds: default: 604800 description: |- @@ -1944,7 +1952,7 @@ spec: description: |- CurrentVersion - the currently deployed RabbitMQ version (e.g., "3.9", "4.2") This is controller-managed and reflects the actual running version. - openstack-operator should use the "rabbitmq.openstack.org/target-version" annotation to request version changes. + Set Spec.TargetVersion to request a version change. type: string lastAppliedTopology: description: LastAppliedTopology - the last applied Topology @@ -1974,7 +1982,7 @@ spec: ProxyRequired - tracks whether the AMQP proxy sidecar is required for this cluster. Set to true when upgrading from RabbitMQ 3.x to 4.x with Quorum queues. The proxy allows non-durable clients to work with quorum queues during the upgrade window. - Only cleared when the "rabbitmq.openstack.org/clients-reconfigured" annotation is set. + Only cleared when the AnnotationClientsReconfigured annotation is set to "true". type: boolean queueType: description: QueueType - store whether default ha-all policy is present @@ -1990,13 +1998,14 @@ spec: x-kubernetes-list-type: atomic upgradePhase: description: |- - UpgradePhase - tracks the current phase of a version upgrade or migration - Valid values: - "" (no upgrade in progress) - "DeletingResources" (deleting ha-all policy and StatefulSet) - "WaitingForCluster" (waiting for cluster to become ready with new version) + UpgradePhase - tracks the current phase of a version upgrade or migration. This allows resuming upgrades that failed midway. type: string + wipeReason: + description: |- + WipeReason - tracks why the current storage wipe was initiated. + Persisted so that resumed upgrades use the correct handling path. + type: string type: object type: object served: true diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 4a0ec3233..619ffff36 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -14456,6 +14456,9 @@ spec: type: object skipPostDeploySteps: type: boolean + targetVersion: + pattern: ^\d+\.\d+(\.\d+)?$ + type: string terminationGracePeriodSeconds: default: 604800 format: int64 diff --git a/config/operator/manager_operator_images.yaml b/config/operator/manager_operator_images.yaml index 5cd1081b0..36a576915 100644 --- a/config/operator/manager_operator_images.yaml +++ b/config/operator/manager_operator_images.yaml @@ -26,7 +26,7 @@ spec: - name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL value: quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3 - name: RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL - value: quay.io/lmiccini/infra-operator@sha256:6366284fe91e777b5a5b8d7aa375bdae0530285a41ce9264167ebfd92bb83eeb + value: quay.io/lmiccini/infra-operator@sha256:6b6b90434b303d35970c38685df02d6b0a73d3bb21f530b5b301f4970f566653 - name: RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL value: quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01 - name: RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL diff --git a/go.mod b/go.mod index 62c53df79..5285864c2 100644 --- a/go.mod +++ b/go.mod @@ -182,4 +182,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging -replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 +replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260311162407-d0bc7fcc319c diff --git a/go.sum b/go.sum index ee55dd78f..8d424877f 100644 --- a/go.sum +++ b/go.sum @@ -114,8 +114,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 h1:mhjQVOAV9rr5iYmM2d3HumVCotRnontXvAMXioTTJc0= -github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= +github.com/lmiccini/infra-operator/apis v0.0.0-20260311162407-d0bc7fcc319c h1:FWRBCFfW8sJK/OlKQZKKi8RQgnQ78Vof5dxUXnULNP8= +github.com/lmiccini/infra-operator/apis v0.0.0-20260311162407-d0bc7fcc319c/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= diff --git a/hack/export_operator_related_images.sh b/hack/export_operator_related_images.sh index 875692511..dedc8193c 100644 --- a/hack/export_operator_related_images.sh +++ b/hack/export_operator_related_images.sh @@ -6,7 +6,7 @@ export RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s- export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:81e43c058d9af1d3bc31704010c630bc2a574c2ee388aa0ffe8c7b9621a7d051 export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/heat-operator@sha256:ee642fcf655f9897d480460008cba2e98b497d3ffdf7ab1d48ea460eb20c2053 export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3 -export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:6366284fe91e777b5a5b8d7aa375bdae0530285a41ce9264167ebfd92bb83eeb +export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:6b6b90434b303d35970c38685df02d6b0a73d3bb21f530b5b301f4970f566653 export RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01 export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:9d723ab33964ee44704eed3223b64e828349d45dee04695434a6fcf4b6807d4c export RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/manila-operator@sha256:f1158ec4d879c4646eee4323bc501eba4d377beb2ad6fbe08ed30070c441ac26 diff --git a/internal/openstack/rabbitmq.go b/internal/openstack/rabbitmq.go index d1b7d0732..e39cd60d4 100644 --- a/internal/openstack/rabbitmq.go +++ b/internal/openstack/rabbitmq.go @@ -277,14 +277,11 @@ func reconcileRabbitMQ( rabbitmq.Spec.TLS.CaSecretName = tlsCert rabbitmq.Spec.TLS.DisableNonTLSListeners = true } - // add annotation to store the target rabbitmq-server version - if rabbitmq.GetAnnotations() == nil { - rabbitmq.SetAnnotations(make(map[string]string)) - } + // set the target rabbitmq-server version in spec if version.Status.ServiceDefaults.RabbitmqVersion != nil { - rabbitmq.GetAnnotations()[rabbitmqv1.AnnotationTargetVersion] = *version.Status.ServiceDefaults.RabbitmqVersion + rabbitmq.Spec.TargetVersion = version.Status.ServiceDefaults.RabbitmqVersion } else { - rabbitmq.GetAnnotations()[rabbitmqv1.AnnotationTargetVersion] = "3.9" + rabbitmq.Spec.TargetVersion = ptr.To("3.9") } rabbitmq.Spec.ContainerImage = *version.Status.ContainerImages.RabbitmqImage