diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 8f2888f1e..9815dd2ad 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -414,11 +414,11 @@ spec: type: object customServiceConfig: type: string - databaseInstance: - type: string - databaseUser: + databaseAccount: default: barbican type: string + databaseInstance: + type: string defaultConfigOverwrite: additionalProperties: type: string @@ -429,13 +429,9 @@ spec: type: object passwordSelectors: default: - database: BarbicanDatabasePassword service: BarbicanPassword simplecryptokek: BarbicanSimpleCryptoKEK properties: - database: - default: BarbicanDatabasePassword - type: string service: default: BarbicanPassword type: string diff --git a/apis/go.mod b/apis/go.mod index f69f9c1a0..70ab32353 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/onsi/ginkgo/v2 v2.16.0 github.com/onsi/gomega v1.31.1 - github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240305211912-95cf5d93d585 + github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240306133639-c2e243349b80 github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240306213520-073a542389ea github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240306142853-6b5d6005953d diff --git a/apis/go.sum b/apis/go.sum index 1aef8eb9a..bb7836845 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -73,8 +73,8 @@ github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7/go.mod h1:ctXNyWanKEjGj8sss1KjjHQ3ENKFm33FFnS5BKaIPh4= -github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240305211912-95cf5d93d585 h1:QAIvORdCcZ+Nbg3Jy0TAg8AR1xoEWTC8IwISGD4wdWc= -github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240305211912-95cf5d93d585/go.mod h1:BJoXL5gDpxJ4qCPKwfCjg6TG3Gm9cjeVA8qoDSFVBNI= +github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e h1:bTwe7Vd6efGG5bQtVCcg5Vx+cI0PUcNQjeg0vOR28dk= +github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e/go.mod h1:/cGtVPIqIZY31DvNLVJGIDTn7q0mySia1H9+/uOyKxI= github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240306133639-c2e243349b80 h1:+rlsahNUHVjM3XvhqVtbIvfuU7Dgh8qRWSoRR0CUpkI= github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240306133639-c2e243349b80/go.mod h1:j+ZW/9p2FGrVpo92t8KNTEVy4wWoVwVfTpVZxHRF/to= github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240306213520-073a542389ea h1:6E5uL2bqgsOxKuV0K58w5L98PoNVg+iExgTzsfZfP8s= diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 8f2888f1e..9815dd2ad 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -414,11 +414,11 @@ spec: type: object customServiceConfig: type: string - databaseInstance: - type: string - databaseUser: + databaseAccount: default: barbican type: string + databaseInstance: + type: string defaultConfigOverwrite: additionalProperties: type: string @@ -429,13 +429,9 @@ spec: type: object passwordSelectors: default: - database: BarbicanDatabasePassword service: BarbicanPassword simplecryptokek: BarbicanSimpleCryptoKEK properties: - database: - default: BarbicanDatabasePassword - type: string service: default: BarbicanPassword type: string diff --git a/go.mod b/go.mod index fee71ce06..44119235e 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/onsi/ginkgo/v2 v2.16.0 github.com/onsi/gomega v1.31.1 github.com/openshift/api v3.9.0+incompatible - github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240305211912-95cf5d93d585 + github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240306133639-c2e243349b80 github.com/openstack-k8s-operators/dataplane-operator/api v0.3.1-0.20240307144346-fdd88ea71261 github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240306213520-073a542389ea diff --git a/go.sum b/go.sum index ec6367807..82ba79b66 100644 --- a/go.sum +++ b/go.sum @@ -85,8 +85,8 @@ github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7/go.mod h1:ctXNyWanKEjGj8sss1KjjHQ3ENKFm33FFnS5BKaIPh4= -github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240305211912-95cf5d93d585 h1:QAIvORdCcZ+Nbg3Jy0TAg8AR1xoEWTC8IwISGD4wdWc= -github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240305211912-95cf5d93d585/go.mod h1:BJoXL5gDpxJ4qCPKwfCjg6TG3Gm9cjeVA8qoDSFVBNI= +github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e h1:bTwe7Vd6efGG5bQtVCcg5Vx+cI0PUcNQjeg0vOR28dk= +github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e/go.mod h1:/cGtVPIqIZY31DvNLVJGIDTn7q0mySia1H9+/uOyKxI= github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240306133639-c2e243349b80 h1:+rlsahNUHVjM3XvhqVtbIvfuU7Dgh8qRWSoRR0CUpkI= github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240306133639-c2e243349b80/go.mod h1:j+ZW/9p2FGrVpo92t8KNTEVy4wWoVwVfTpVZxHRF/to= github.com/openstack-k8s-operators/dataplane-operator/api v0.3.1-0.20240307144346-fdd88ea71261 h1:XNwnizDNHIg/RsBRXcK8rU1hCfkzymUW+PoRXISZuw0= diff --git a/pkg/openstack/barbican.go b/pkg/openstack/barbican.go index 9af4b3e0e..c5bf4a558 100644 --- a/pkg/openstack/barbican.go +++ b/pkg/openstack/barbican.go @@ -99,6 +99,10 @@ func ReconcileBarbican(ctx context.Context, instance *corev1beta1.OpenStackContr op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), barbican, func() error { instance.Spec.Barbican.Template.DeepCopyInto(&barbican.Spec) + // FIXME: barbican webhooks are not setting this correctly yet + if barbican.Spec.DatabaseAccount == "" { + barbican.Spec.DatabaseAccount = "barbican" + } if barbican.Spec.Secret == "" { barbican.Spec.Secret = instance.Spec.Secret }