Skip to content

Commit d97f179

Browse files
committed
use spec instead of label
1 parent f390b73 commit d97f179

10 files changed

Lines changed: 33 additions & 21 deletions

api/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14456,6 +14456,9 @@ spec:
1445614456
type: object
1445714457
skipPostDeploySteps:
1445814458
type: boolean
14459+
targetVersion:
14460+
pattern: ^\d+\.\d+(\.\d+)?$
14461+
type: string
1445914462
terminationGracePeriodSeconds:
1446014463
default: 604800
1446114464
format: int64

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging
144144

145145
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
146146

147-
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870
147+
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260311130826-075b190bff83

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
9090
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
9191
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
9292
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
93-
github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 h1:mhjQVOAV9rr5iYmM2d3HumVCotRnontXvAMXioTTJc0=
94-
github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU=
93+
github.com/lmiccini/infra-operator/apis v0.0.0-20260311130826-075b190bff83 h1:LQEM+2QDCui0/26ecGh0Cp+UY4A2VNBbZ1CGCZzn/oY=
94+
github.com/lmiccini/infra-operator/apis v0.0.0-20260311130826-075b190bff83/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU=
9595
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
9696
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
9797
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=

bindata/crds/rabbitmq.openstack.org_rabbitmqs.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,14 @@ spec:
18041804
Has no effect if the cluster only consists of one node.
18051805
For more information, see https://www.rabbitmq.com/rabbitmq-queues.8.html#rebalance
18061806
type: boolean
1807+
targetVersion:
1808+
description: |-
1809+
TargetVersion - the desired RabbitMQ version (e.g., "4.2", "3.13.1").
1810+
When set to a version different from Status.CurrentVersion, the controller
1811+
will initiate a storage wipe and version upgrade. The controller updates
1812+
Status.CurrentVersion once the upgrade completes.
1813+
pattern: ^\d+\.\d+(\.\d+)?$
1814+
type: string
18071815
terminationGracePeriodSeconds:
18081816
default: 604800
18091817
description: |-
@@ -1944,7 +1952,7 @@ spec:
19441952
description: |-
19451953
CurrentVersion - the currently deployed RabbitMQ version (e.g., "3.9", "4.2")
19461954
This is controller-managed and reflects the actual running version.
1947-
openstack-operator should use the "rabbitmq.openstack.org/target-version" annotation to request version changes.
1955+
Set Spec.TargetVersion to request a version change.
19481956
type: string
19491957
lastAppliedTopology:
19501958
description: LastAppliedTopology - the last applied Topology
@@ -1974,7 +1982,7 @@ spec:
19741982
ProxyRequired - tracks whether the AMQP proxy sidecar is required for this cluster.
19751983
Set to true when upgrading from RabbitMQ 3.x to 4.x with Quorum queues.
19761984
The proxy allows non-durable clients to work with quorum queues during the upgrade window.
1977-
Only cleared when the "rabbitmq.openstack.org/clients-reconfigured" annotation is set.
1985+
Only cleared when the AnnotationClientsReconfigured annotation is set to "true".
19781986
type: boolean
19791987
queueType:
19801988
description: QueueType - store whether default ha-all policy is present
@@ -1990,13 +1998,14 @@ spec:
19901998
x-kubernetes-list-type: atomic
19911999
upgradePhase:
19922000
description: |-
1993-
UpgradePhase - tracks the current phase of a version upgrade or migration
1994-
Valid values:
1995-
"" (no upgrade in progress)
1996-
"DeletingResources" (deleting ha-all policy and StatefulSet)
1997-
"WaitingForCluster" (waiting for cluster to become ready with new version)
2001+
UpgradePhase - tracks the current phase of a version upgrade or migration.
19982002
This allows resuming upgrades that failed midway.
19992003
type: string
2004+
wipeReason:
2005+
description: |-
2006+
WipeReason - tracks why the current storage wipe was initiated.
2007+
Persisted so that resumed upgrades use the correct handling path.
2008+
type: string
20002009
type: object
20012010
type: object
20022011
served: true

config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14456,6 +14456,9 @@ spec:
1445614456
type: object
1445714457
skipPostDeploySteps:
1445814458
type: boolean
14459+
targetVersion:
14460+
pattern: ^\d+\.\d+(\.\d+)?$
14461+
type: string
1445914462
terminationGracePeriodSeconds:
1446014463
default: 604800
1446114464
format: int64

config/operator/manager_operator_images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
- name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL
2727
value: quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3
2828
- name: RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL
29-
value: quay.io/lmiccini/infra-operator@sha256:6366284fe91e777b5a5b8d7aa375bdae0530285a41ce9264167ebfd92bb83eeb
29+
value: quay.io/lmiccini/infra-operator@sha256:ed548eff6372714dfda24875013bca0070d2277f2d103b66ceea47370c5fbfd7
3030
- name: RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL
3131
value: quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01
3232
- name: RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging
182182

183183
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
184184

185-
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870
185+
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260311130826-075b190bff83

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
114114
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
115115
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
116116
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
117-
github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870 h1:mhjQVOAV9rr5iYmM2d3HumVCotRnontXvAMXioTTJc0=
118-
github.com/lmiccini/infra-operator/apis v0.0.0-20260305115943-c7249ce98870/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU=
117+
github.com/lmiccini/infra-operator/apis v0.0.0-20260311130826-075b190bff83 h1:LQEM+2QDCui0/26ecGh0Cp+UY4A2VNBbZ1CGCZzn/oY=
118+
github.com/lmiccini/infra-operator/apis v0.0.0-20260311130826-075b190bff83/go.mod h1:XsEbK1LxXg8beKXRf8s1OQanE82hCuGtkO1URg7uezU=
119119
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
120120
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
121121
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=

hack/export_operator_related_images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-
66
export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:81e43c058d9af1d3bc31704010c630bc2a574c2ee388aa0ffe8c7b9621a7d051
77
export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/heat-operator@sha256:ee642fcf655f9897d480460008cba2e98b497d3ffdf7ab1d48ea460eb20c2053
88
export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:114c0dee0bab1d453890e9dcc7727de749055bdbea049384d5696e7ac8d78fe3
9-
export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:6366284fe91e777b5a5b8d7aa375bdae0530285a41ce9264167ebfd92bb83eeb
9+
export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:ed548eff6372714dfda24875013bca0070d2277f2d103b66ceea47370c5fbfd7
1010
export RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/ironic-operator@sha256:e41dfadd2c3bbcae29f8c43cd2feea6724a48cdef127d65d1d37816bb9945a01
1111
export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:9d723ab33964ee44704eed3223b64e828349d45dee04695434a6fcf4b6807d4c
1212
export RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/manila-operator@sha256:f1158ec4d879c4646eee4323bc501eba4d377beb2ad6fbe08ed30070c441ac26

internal/openstack/rabbitmq.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,11 @@ func reconcileRabbitMQ(
277277
rabbitmq.Spec.TLS.CaSecretName = tlsCert
278278
rabbitmq.Spec.TLS.DisableNonTLSListeners = true
279279
}
280-
// add annotation to store the target rabbitmq-server version
281-
if rabbitmq.GetAnnotations() == nil {
282-
rabbitmq.SetAnnotations(make(map[string]string))
283-
}
280+
// set the target rabbitmq-server version in spec
284281
if version.Status.ServiceDefaults.RabbitmqVersion != nil {
285-
rabbitmq.GetAnnotations()[rabbitmqv1.AnnotationTargetVersion] = *version.Status.ServiceDefaults.RabbitmqVersion
282+
rabbitmq.Spec.TargetVersion = version.Status.ServiceDefaults.RabbitmqVersion
286283
} else {
287-
rabbitmq.GetAnnotations()[rabbitmqv1.AnnotationTargetVersion] = "3.9"
284+
rabbitmq.Spec.TargetVersion = ptr.To("3.9")
288285
}
289286

290287
rabbitmq.Spec.ContainerImage = *version.Status.ContainerImages.RabbitmqImage

0 commit comments

Comments
 (0)