diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 24cfe746..a2d2a851 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -157,12 +157,6 @@ rules: - mariadbaccounts/finalizers verbs: - update -- apiGroups: - - mariadb.openstack.org - resources: - - mariadbaccounts/finalizers - verbs: - - update - apiGroups: - mariadb.openstack.org resources: diff --git a/controllers/octavia_controller.go b/controllers/octavia_controller.go index e9fdf647..71a7288a 100644 --- a/controllers/octavia_controller.go +++ b/controllers/octavia_controller.go @@ -705,7 +705,7 @@ func (r *OctaviaReconciler) generateServiceConfigMaps( // or end-user YAML declaration) databaseAccount, dbSecret, err := mariadbv1.EnsureMariaDBAccount( ctx, h, instance.Spec.DatabaseAccount, - instance.Namespace, false, + instance.Namespace, false, "", ) if err != nil { diff --git a/go.mod b/go.mod index 43eeb792..6c770715 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240220135139-2dc967b0f6de github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240224182407-3b6c02b195f6 github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20240224182407-3b6c02b195f6 - github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240222094307-76fef735f093 + github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240303091826-438dde8600d3 github.com/openstack-k8s-operators/octavia-operator/api v0.0.0-00010101000000-000000000000 github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240221131248-e97a8e5ca98f go.uber.org/zap v1.26.0 @@ -88,5 +88,3 @@ replace github.com/openstack-k8s-operators/octavia-operator/api => ./api // mschuppert: map to latest commit from release-4.13 tag // must consistent within modules and service operators replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging - -replace github.com/openstack-k8s-operators/mariadb-operator/api => github.com/zzzeek/mariadb-operator/api v0.3.1-0.20240222195117-de879c4be63a //allow-merging diff --git a/go.sum b/go.sum index e37a4a64..8fcd6fbf 100644 --- a/go.sum +++ b/go.sum @@ -86,6 +86,8 @@ github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.2024022418 github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240224182407-3b6c02b195f6/go.mod h1:oB0Lc1U5wiJZBdT3lSMkZfG/LhHR6z/SJ0Tp7Y/GUkg= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20240224182407-3b6c02b195f6 h1:u03dfqrO8ml0gShw11Mm+vmqOsSXbY9pv+4sfo2HaTQ= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20240224182407-3b6c02b195f6/go.mod h1:K1FWWDoDOvMkeyz26x2dNKFJMOad041AXhTL2S8JAlA= +github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240303091826-438dde8600d3 h1:fwb+GvvnN9Mhkgg5pBksZ8W5+hLCcNOorHsUTQYA1Lg= +github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240303091826-438dde8600d3/go.mod h1:f9IIyWeoskWoeWaDFF3qmAJ2Kqyovfi0Ar/QUfk3qag= github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240221131248-e97a8e5ca98f h1:iacJjeV8yVUE0ZD27PjrbLTgQlaAUF5s+fPczQg/Yqc= github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240221131248-e97a8e5ca98f/go.mod h1:m/5jovuZ3Y1/Uy2af8RqxWhe3+bWn7QIFXH4amKBdmY= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -110,8 +112,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zzzeek/mariadb-operator/api v0.3.1-0.20240222195117-de879c4be63a h1:eVtZZAIwgoyOGv1BdNsjy1WRsosdvK13NeYhyXikOIo= -github.com/zzzeek/mariadb-operator/api v0.3.1-0.20240222195117-de879c4be63a/go.mod h1:f9IIyWeoskWoeWaDFF3qmAJ2Kqyovfi0Ar/QUfk3qag= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= diff --git a/pkg/octavia/initcontainer.go b/pkg/octavia/initcontainer.go index 17ea7f11..a8a632ed 100644 --- a/pkg/octavia/initcontainer.go +++ b/pkg/octavia/initcontainer.go @@ -50,7 +50,7 @@ func InitContainer(init APIDetails) []corev1.Container { envVars := map[string]env.Setter{} envVars["DatabaseHost"] = env.SetValue(init.DatabaseHost) - envVars["DatabaseUser"] = env.SetValue(init.DatabaseAccount) + envVars["DatabaseAccount"] = env.SetValue(init.DatabaseAccount) envVars["DatabaseName"] = env.SetValue(init.DatabaseName) envs := []corev1.EnvVar{ diff --git a/templates/octavia/bin/init.sh b/templates/octavia/bin/init.sh index 1b780314..d70b21c3 100755 --- a/templates/octavia/bin/init.sh +++ b/templates/octavia/bin/init.sh @@ -21,7 +21,7 @@ set -ex # Secrets are obtained from ENV variables. export PASSWORD=${AdminPassword:?"Please specify a AdminPassword variable."} export DBHOST=${DatabaseHost:?"Please specify a DatabaseHost variable."} -export DBUSER=${DatabaseUser:?"Please specify a DatabaseUser variable."} +export DBUSER=${DatabaseAccount:?"Please specify a DatabaseAccount variable."} export DBPASSWORD=${DatabasePassword:?"Please specify a DatabasePassword variable."} export DB=${DatabaseName:-"octavia"} export TRANSPORTURL=${TransportURL:-""} diff --git a/templates/octaviaamphoracontroller/bin/init.sh b/templates/octaviaamphoracontroller/bin/init.sh index 37cd6ac4..f380cfbc 100755 --- a/templates/octaviaamphoracontroller/bin/init.sh +++ b/templates/octaviaamphoracontroller/bin/init.sh @@ -21,7 +21,7 @@ set -ex # Secrets are obtained from ENV variables. export PASSWORD=${AdminPassword:?"Please specify a AdminPassword variable."} export DBHOST=${DatabaseHost:?"Please specify a DatabaseHost variable."} -export DBUSER=${DatabaseUser:?"Please specify a DatabaseUser variable."} +export DBUSER=${DatabaseAccount:?"Please specify a DatabaseAccount variable."} export DBPASSWORD=${DatabasePassword:?"Please specify a DatabasePassword variable."} export DB=${DatabaseName:-"octavia"} export TRANSPORTURL=${TransportURL:-""} diff --git a/tests/kuttl/common/assert_sample_deployment.yaml b/tests/kuttl/common/assert_sample_deployment.yaml index a133c1ea..dda97324 100644 --- a/tests/kuttl/common/assert_sample_deployment.yaml +++ b/tests/kuttl/common/assert_sample_deployment.yaml @@ -10,8 +10,6 @@ apiVersion: octavia.openstack.org/v1beta1 kind: Octavia metadata: - finalizers: - - Octavia name: octavia spec: customServiceConfig: | @@ -71,9 +69,6 @@ spec: database: OctaviaDatabasePassword secret: osp-secret serviceUser: octavia -status: - databaseHostname: openstack.octavia-kuttl-tests.svc - apireadyCount: 1 --- apiVersion: apps/v1 kind: Deployment @@ -174,7 +169,7 @@ spec: key: transport_url name: rabbitmq-transport-url-octavia-octavia-transport - name: DatabaseHost - value: openstack + value: openstack.octavia-kuttl-tests.svc - name: DatabaseName value: octavia - name: databaseAccount