Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate from databaseUsername to databaseAccount and fully use MariaDBAccount #107

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading