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/api/go.mod b/api/go.mod index 1907ac0c5..65fedecb0 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-20260305115943-c7249ce98870 diff --git a/api/go.sum b/api/go.sum index 70b615753..af6821d8c 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-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= @@ -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/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/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..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/openstack-k8s-operators/infra-operator@sha256:e97889bd4dd6896d3272e1237f231c79ecc661730a8a757a527ec6c6716908e5 + 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 789e8bd96..62c53df79 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-20260305115943-c7249ce98870 diff --git a/go.sum b/go.sum index 2140090a7..ee55dd78f 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-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= @@ -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..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/openstack-k8s-operators/infra-operator@sha256:e97889bd4dd6896d3272e1237f231c79ecc661730a8a757a527ec6c6716908e5 +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 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/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..d04e2bde9 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.2" + defaults.RabbitmqVersion = &versionString // all new rabbitmq deployments will have rabbitm-server 4.2 (FR5) + return defaults }