From 932c49cdfd5ae2cad98894e7df4b45df6c48139d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 17 Nov 2026 13:02:36 -0500 Subject: [PATCH] Default MariadbVersion to 10.11 The default mariadb image (RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT, quay.io/openstack-s2i-containers/openstack-mariadb:master-latest) is now built on ubi10 and ships mariadb-server 10.11, so ServiceDefaults no longer needs to leave MariadbVersion unset. Set it to "10.11" so that Galera's TargetVersion is populated and the mariadb-operator's major version upgrade handling is engaged. Update the functional tests accordingly: the default case now expects TargetVersion "10.11", and the tagged-version propagation test uses a value distinct from the default so it still proves propagation. References: OSPRH-40772 Co-Authored-By: Claude Opus 5.5 --- internal/openstack/version.go | 13 ++++----- .../openstackoperator_controller_test.go | 28 +++++++++---------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/internal/openstack/version.go b/internal/openstack/version.go index e947a8fcc..5cab7a4ba 100644 --- a/internal/openstack/version.go +++ b/internal/openstack/version.go @@ -297,13 +297,12 @@ func InitializeOpenStackVersionServiceDefaults(ctx context.Context) *corev1beta1 defaults.NeutronWsgi = &trueString // enable WSGI (httpd/mod_wsgi + split neutron-rpc/neutron-worker Deployments) for neutron - // NOTE: MariadbVersion is deliberately left unset for now, which leaves - // Galera's TargetVersion empty (see reconcileGalera()). The mariadb image - // this build ships is still MariaDB 10.5, so declaring "10.11" here would - // stop every existing cluster once and then leave it permanently reporting - // MariaDBServerUpgradeReady=False/UpgradeVersionMismatch. Set this to - // "10.11" in the same change that moves - // RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT to a 10.11 image. + // MariadbVersion must match the MariaDB major.minor of the image in + // RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT; it becomes Galera's + // TargetVersion (see reconcileGalera()). The default mariadb image is + // RHEL 10 based and ships MariaDB 10.11. When the default image moves to + // a different MariaDB major.minor, update this value in the same change. + defaults.MariadbVersion = ptr.To("10.11") defaults.IronicInspectInterface = ptr.To("agent") diff --git a/test/functional/ctlplane/openstackoperator_controller_test.go b/test/functional/ctlplane/openstackoperator_controller_test.go index d03a5462b..6f2df6a3c 100644 --- a/test/functional/ctlplane/openstackoperator_controller_test.go +++ b/test/functional/ctlplane/openstackoperator_controller_test.go @@ -3526,11 +3526,8 @@ var _ = Describe("OpenStackOperator controller", func() { // // MariaDB major version upgrade (ServiceDefaults.MariadbVersion -> Galera TargetVersion) // - // ServiceDefaults.MariadbVersion is not defaulted yet: the mariadb image - // currently shipped is still 10.5, so nothing may be written to Galera's - // TargetVersion. The mariadb-operator folds TargetVersion into the - // ClusterProperties hash, so writing it where it was previously absent would - // trip StopRequired and stop a healthy cluster that is not being upgraded. + // ServiceDefaults.MariadbVersion is defaulted to the MariaDB major.minor of + // the default mariadb image, and is propagated to Galera's TargetVersion. When("A OpenStackControlPlane is created at the current OpenStack version", func() { BeforeEach(func() { spec := GetDefaultOpenStackControlPlaneSpec() @@ -3542,21 +3539,23 @@ var _ = Describe("OpenStackOperator controller", func() { ) }) - It("leaves the Galera TargetVersion empty while MariadbVersion is undefaulted", func() { + It("sets the Galera TargetVersion to the default MariadbVersion", func() { Eventually(func(g Gomega) { version := GetOpenStackVersion(names.OpenStackVersionName) - g.Expect(version.Status.ServiceDefaults.MariadbVersion).Should(BeNil()) + g.Expect(version.Status.ServiceDefaults.MariadbVersion).ShouldNot(BeNil()) + g.Expect(*version.Status.ServiceDefaults.MariadbVersion).To(Equal("10.11")) - g.Expect(mariadb.GetGalera(names.DBName).Spec.TargetVersion).To(Equal("")) - g.Expect(mariadb.GetGalera(names.DBCell1Name).Spec.TargetVersion).To(Equal("")) + g.Expect(mariadb.GetGalera(names.DBName).Spec.TargetVersion).To(Equal("10.11")) + g.Expect(mariadb.GetGalera(names.DBCell1Name).Spec.TargetVersion).To(Equal("10.11")) }, timeout, interval).Should(Succeed()) }) }) - // Guards the propagation itself, so that turning the default on later is a - // one-line change in InitializeOpenStackVersionServiceDefaults. + // Guards the propagation itself: a tagged version whose ServiceDefaults + // declare a MariadbVersion different from the current default must have + // that value propagated to the Galera CRs. When("A OpenStackControlPlane is created at a version declaring a MariadbVersion", func() { - const mariadbVersion = "10.11" + const mariadbVersion = "11.4" const taggedVersion = "0.0.0" BeforeEach(func() { @@ -3572,9 +3571,8 @@ var _ = Describe("OpenStackOperator controller", func() { k8s_corev1.ConditionTrue, ) - // record a version whose ServiceDefaults declare a MariadbVersion, as - // InitializeOpenStackVersionServiceDefaults will once a 10.11 mariadb - // image ships + // record a tagged version whose ServiceDefaults declare a + // MariadbVersion distinct from the current default Eventually(func(g Gomega) { version := GetOpenStackVersion(names.OpenStackVersionName) version.Status.ContainerImageVersionDefaults[taggedVersion] =