Skip to content

Commit

Permalink
Merge pull request #107 from zzzeek/integrate_oo_accounts
Browse files Browse the repository at this point in the history
migrate from databaseUsername to databaseAccount and fully use MariaDBAccount
  • Loading branch information
openshift-merge-bot[bot] committed Mar 10, 2024
2 parents 95cf5d9 + 0aadf0b commit 5124bc8
Show file tree
Hide file tree
Showing 24 changed files with 272 additions and 183 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ PROC_CMD = --procs ${PROCS}

.PHONY: test
test: manifests generate fmt vet envtest ginkgo ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) --trace --cover --coverpkg=../../pkg/barbican,../../controllers,../../api/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/...
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" \
OPERATOR_TEMPLATES="$(shell pwd)/templates" \
$(GINKGO) --trace --cover --coverpkg=../../pkg/barbican,../../controllers,../../api/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/...

##@ Build

Expand Down
20 changes: 7 additions & 13 deletions api/bases/barbican.openstack.org_barbicanapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ spec:
items:
type: string
type: array
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseHostname:
description: DatabaseHostname - Barbican Database Hostname
type: string
Expand All @@ -62,11 +67,6 @@ spec:
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -269,17 +269,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
20 changes: 7 additions & 13 deletions api/bases/barbican.openstack.org_barbicankeystonelisteners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ spec:
items:
type: string
type: array
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseHostname:
type: string
databaseInstance:
description: 'MariaDB instance name TODO(dmendiza): Is this comment
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -91,17 +91,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
20 changes: 7 additions & 13 deletions api/bases/barbican.openstack.org_barbicans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,16 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseInstance:
description: 'MariaDB instance name TODO(dmendiza): Is this comment
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -601,17 +601,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
20 changes: 7 additions & 13 deletions api/bases/barbican.openstack.org_barbicanworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ spec:
items:
type: string
type: array
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseHostname:
type: string
databaseInstance:
description: 'MariaDB instance name TODO(dmendiza): Is this comment
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -89,17 +89,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
4 changes: 2 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/openstack-k8s-operators/barbican-operator/api
go 1.20

require (
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240216173409-86913e6d5885
k8s.io/api v0.28.3
k8s.io/apimachinery v0.28.3
Expand Down
8 changes: 4 additions & 4 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY=
github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240216173409-86913e6d5885 h1:o7KZaxKt8Dr97ZJIBPW0P482gLyFEURKF89fizcJCBQ=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240216173409-86913e6d5885/go.mod h1:bQwzyQtWCR9F0+IvWZ30J9d1lB6tcX3CNJ0Ten1smDw=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
12 changes: 4 additions & 8 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type BarbicanTemplate struct {

// +kubebuilder:validation:Optional
// +kubebuilder:default=barbican
// DatabaseUser - optional username used for barbican DB, defaults to barbican
DatabaseUser string `json:"databaseUser"`
// DatabaseAccount - optional MariaDBAccount CR name used for barbican DB, defaults to barbican
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Required
// +kubebuilder:default=rabbitmq
Expand All @@ -42,8 +42,8 @@ type BarbicanTemplate struct {
Secret string `json:"secret"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={database: BarbicanDatabasePassword, service: BarbicanPassword, simplecryptokek: BarbicanSimpleCryptoKEK}
// PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret
// +kubebuilder:default={service: BarbicanPassword, simplecryptokek: BarbicanSimpleCryptoKEK}
// PasswordSelectors - Selectors to identify the ServiceUser password from the Secret
PasswordSelectors PasswordSelector `json:"passwordSelectors"`

// +kubebuilder:validation:Optional
Expand Down Expand Up @@ -103,10 +103,6 @@ type BarbicanComponentTemplate struct {

// PasswordSelector to identify the DB and AdminUser password from the Secret
type PasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="BarbicanDatabasePassword"
// Database - Selector to get the barbican database user password from the Secret
Database string `json:"database"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="BarbicanPassword"
// Service - Selector to get the barbican service user password from the Secret
Expand Down
20 changes: 7 additions & 13 deletions config/crd/bases/barbican.openstack.org_barbicanapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ spec:
items:
type: string
type: array
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseHostname:
description: DatabaseHostname - Barbican Database Hostname
type: string
Expand All @@ -62,11 +67,6 @@ spec:
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand Down Expand Up @@ -269,17 +269,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ spec:
items:
type: string
type: array
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseHostname:
type: string
databaseInstance:
description: 'MariaDB instance name TODO(dmendiza): Is this comment
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -91,17 +91,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
20 changes: 7 additions & 13 deletions config/crd/bases/barbican.openstack.org_barbicans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,16 @@ spec:
added to to /etc/<service>/<service>.conf.d directory as custom.conf
file.
type: string
databaseAccount:
default: barbican
description: DatabaseAccount - optional MariaDBAccount CR name used
for barbican DB, defaults to barbican
type: string
databaseInstance:
description: 'MariaDB instance name TODO(dmendiza): Is this comment
right? Right now required by the maridb-operator to get the credentials
from the instance to create the DB Might not be required in future'
type: string
databaseUser:
default: barbican
description: DatabaseUser - optional username used for barbican DB,
defaults to barbican
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
Expand All @@ -601,17 +601,11 @@ spec:
type: object
passwordSelectors:
default:
database: BarbicanDatabasePassword
service: BarbicanPassword
simplecryptokek: BarbicanSimpleCryptoKEK
description: PasswordSelectors - Selectors to identify the DB and
ServiceUser password from the Secret
description: PasswordSelectors - Selectors to identify the ServiceUser
password from the Secret
properties:
database:
default: BarbicanDatabasePassword
description: Database - Selector to get the barbican database
user password from the Secret
type: string
service:
default: BarbicanPassword
description: Service - Selector to get the barbican service user
Expand Down
Loading

0 comments on commit 5124bc8

Please sign in to comment.