Skip to content

Commit

Permalink
migrate from databaseUsername to databaseAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzeek committed Feb 27, 2024
1 parent 03044dd commit a2e8bb5
Show file tree
Hide file tree
Showing 34 changed files with 271 additions and 162 deletions.
10 changes: 3 additions & 7 deletions api/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: glance
type: string
databaseHostname:
type: string
extraMounts:
items:
properties:
Expand Down Expand Up @@ -881,12 +881,8 @@ spec:
type: object
passwordSelectors:
default:
database: GlanceDatabasePassword
service: GlancePassword
properties:
database:
default: GlanceDatabasePassword
type: string
service:
default: GlancePassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions api/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ spec:
items:
type: string
type: array
databaseInstance:
type: string
databaseUser:
databaseAccount:
default: glance
type: string
databaseInstance:
type: string
dbPurge:
properties:
age:
Expand Down Expand Up @@ -980,12 +980,8 @@ spec:
type: object
passwordSelectors:
default:
database: GlanceDatabasePassword
service: GlancePassword
properties:
database:
default: GlanceDatabasePassword
type: string
service:
default: GlancePassword
type: string
Expand Down
19 changes: 9 additions & 10 deletions api/v1beta1/glance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ type GlanceSpec struct {

// +kubebuilder:validation:Optional
// +kubebuilder:default=glance
// DatabaseUser - optional username used for glance DB, defaults to glance
// TODO: -> implement needs work in mariadb-operator, right now only glance
DatabaseUser string `json:"databaseUser"`
// DatabaseAccount - name of MariaDBAccount which will be used to connect.
// As an interim solution, glance-controller will
// generate the MariaDBAccount object of the given name if it's not
// present in the cluster. Later, openstack-operator will perform this
// generation and also populate this field for the Glance objects it creates
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Required
// Secret containing OpenStack password information for glance GlanceDatabasePassword
// Secret containing OpenStack password information for glance's keystone
// password; no longer used for database password
Secret string `json:"secret"`

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

Expand Down Expand Up @@ -134,11 +138,6 @@ type GlanceSpec struct {

// PasswordSelector to identify the DB and AdminUser password from the Secret
type PasswordSelector struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="GlanceDatabasePassword"
// Database - Selector to get the glance database user password from the Secret
// TODO: not used, need change in mariadb-operator
Database string `json:"database"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="GlancePassword"
// Service - Selector to get the glance service password from the Secret
Expand Down
7 changes: 3 additions & 4 deletions api/v1beta1/glanceapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@ type GlanceAPISpec struct {

// +kubebuilder:validation:Optional
// +kubebuilder:default=glance
// DatabaseUser - optional username used for glance DB, defaults to glance
// TODO: -> implement needs work in mariadb-operator, right now only glance
DatabaseUser string `json:"databaseUser"`
// DatabaseAccount - name of MariaDBAccount which will be used to connect.
DatabaseAccount string `json:"databaseAccount"`

// +kubebuilder:validation:Required
// Secret containing OpenStack password information for glance AdminPassword
Secret string `json:"secret"`

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

Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ spec:
items:
type: string
type: array
databaseHostname:
type: string
databaseUser:
databaseAccount:
default: glance
type: string
databaseHostname:
type: string
extraMounts:
items:
properties:
Expand Down Expand Up @@ -881,12 +881,8 @@ spec:
type: object
passwordSelectors:
default:
database: GlanceDatabasePassword
service: GlancePassword
properties:
database:
default: GlanceDatabasePassword
type: string
service:
default: GlancePassword
type: string
Expand Down
10 changes: 3 additions & 7 deletions config/crd/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ spec:
items:
type: string
type: array
databaseInstance:
type: string
databaseUser:
databaseAccount:
default: glance
type: string
databaseInstance:
type: string
dbPurge:
properties:
age:
Expand Down Expand Up @@ -980,12 +980,8 @@ spec:
type: object
passwordSelectors:
default:
database: GlanceDatabasePassword
service: GlancePassword
properties:
database:
default: GlanceDatabasePassword
type: string
service:
default: GlancePassword
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@ spec:
displayName: Glance API
kind: GlanceAPI
name: glanceapis.glance.openstack.org
specDescriptors:
- description: TLS - Parameters related to the TLS
displayName: TLS
path: tls
version: v1beta1
- description: Glance is the Schema for the glances API
displayName: Glance
kind: Glance
name: glances.glance.openstack.org
specDescriptors:
- description: TLS - Parameters related to the TLS
displayName: TLS
path: glanceAPIs.tls
version: v1beta1
description: Glance Operator
displayName: Glance Operator
Expand Down
2 changes: 1 addition & 1 deletion config/samples/backends/ceph/ceph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
rbd_store_pool = images
rbd_store_user = openstack
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
secret: osp-secret
storageClass: ""
storageRequest: 1G
Expand Down
2 changes: 1 addition & 1 deletion config/samples/backends/multistore/multistore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
swift_store_user = service:glance
swift_store_endpoint_type = internalURL
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
glanceAPIs:
default:
preserveJobs: false
Expand Down
2 changes: 1 addition & 1 deletion config/samples/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
debug = true
enabled_backends=foo:bar,foo1:bar1
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
2 changes: 1 addition & 1 deletion config/samples/glance_v1beta1_glanceapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
here-foo-config
[foo1]
here-foo1-config
databaseUser: glance
databaseAccount: glance
databaseHostname: glance
preserveJobs: false
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion config/samples/image_cache/image-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
store_description = "RBD backend"
rbd_store_pool = images
rbd_store_user = openstack
databaseUser: glance
databaseAccount: glance
glanceAPIs:
default:
preserveJobs: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
[image_conversion]
output_format = raw
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
glanceAPI:
preserveJobs: false
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
[image_import_opts]
image_import_plugins = [image_decompression]
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
glanceAPI:
preserveJobs: false
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
ignore_user_roles = admin,user1
inject = "property1":"value1","property2":"value2"
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
glanceAPI:
preserveJobs: false
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion config/samples/layout/base/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
debug = true
enabled_backends=foo:bar
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
2 changes: 1 addition & 1 deletion config/samples/layout/edge/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
[DEFAULT]
debug = true
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
keystoneEndpoint: central
glanceAPIs:
central:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/layout/multiple/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
[DEFAULT]
debug = true
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
keystoneEndpoint: api1
glanceAPIs:
api1:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/layout/single/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
serviceUser: glance
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
keystoneEndpoint: default
customServiceConfig: |
[DEFAULT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
serviceUser: glance
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
keystoneEndpoint: default
customServiceConfig: |
[DEFAULT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
enforce_scope=true
enforce_new_defaults=true
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
glanceAPI:
preserveJobs: false
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion config/samples/quotas/glance_v1beta1_glance_quota.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
serviceUser: glance
databaseInstance: openstack
databaseUser: glance
databaseAccount: glance
keystoneEndpoint: default
glanceAPIs:
default:
Expand Down
Loading

0 comments on commit a2e8bb5

Please sign in to comment.