Skip to content

Commit

Permalink
Bump Glance with the new storage interface
Browse files Browse the repository at this point in the history
We currently provide both StorageClass and StorageRequest that can be
propagated to the Glance underlying instances.
However, it might be possible that operators use extraMounts to plug a
NFS share mapped to /var/lib/glance/os_staging_store.
In this case, the API should be updated to not provision any PVC and
let the human operator to take care about it using the extraMounts
interface.
This patch updates the Glance bits to reflect the new behavior
introduced in the glance-operator.

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Jun 14, 2024
1 parent 9d256e9 commit 7276f70
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 46 deletions.
30 changes: 18 additions & 12 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4373,8 +4373,6 @@ spec:
type: object
type: object
type: object
pvc:
type: string
replicas:
default: 1
format: int32
Expand Down Expand Up @@ -4412,10 +4410,15 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
tls:
properties:
api:
Expand Down Expand Up @@ -4443,7 +4446,6 @@ spec:
type: string
required:
- containerImage
- storageRequest
type: object
type: object
imageCache:
Expand Down Expand Up @@ -4506,18 +4508,22 @@ spec:
serviceUser:
default: glance
type: string
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
required:
- databaseInstance
- glanceAPIs
- imageCache
- keystoneEndpoint
- memcachedInstance
- secret
- storageRequest
type: object
type: object
heat:
Expand Down
30 changes: 18 additions & 12 deletions config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4373,8 +4373,6 @@ spec:
type: object
type: object
type: object
pvc:
type: string
replicas:
default: 1
format: int32
Expand Down Expand Up @@ -4412,10 +4410,15 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
tls:
properties:
api:
Expand Down Expand Up @@ -4443,7 +4446,6 @@ spec:
type: string
required:
- containerImage
- storageRequest
type: object
type: object
imageCache:
Expand Down Expand Up @@ -4506,18 +4508,22 @@ spec:
serviceUser:
default: glance
type: string
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
required:
- databaseInstance
- glanceAPIs
- imageCache
- keystoneEndpoint
- memcachedInstance
- secret
- storageRequest
type: object
type: object
heat:
Expand Down
5 changes: 3 additions & 2 deletions config/samples/core_v1beta1_openstackcontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ spec:
template:
secret: osp-secret
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
keystoneEndpoint: default
glanceAPIs:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ spec:
template:
secret: osp-secret
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
keystoneEndpoint: default
glanceAPIs:
default:
Expand Down
5 changes: 3 additions & 2 deletions config/samples/core_v1beta1_openstackcontrolplane_galera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ spec:
template:
secret: osp-secret
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
keystoneEndpoint: default
glanceAPIs:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ spec:
glance:
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ spec:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ spec:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ spec:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ spec:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ spec:
store_description = "RBD backend"
rbd_store_pool = images
rbd_store_user = openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ spec:
route: {}
template:
databaseInstance: openstack
storageClass: ""
storageRequest: 10G
storage:
storageClass: ""
storageRequest: 10G
secret: osp-secret
keystoneEndpoint: default
glanceAPIs:
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202304141430

// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.6.0_patches_tag)
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240612145157-629e537392b3 //allow-merging

replace github.com/openstack-k8s-operators/glance-operator/api => github.com/fmount/glance-operator/api v0.0.0-20240614060531-8f314f258e12 //allow-merging
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRr
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
github.com/fmount/glance-operator/api v0.0.0-20240614060531-8f314f258e12 h1:jliwtCaxG3k9DiSQuqCuD7rvfpRA1GGD+FWCYSC4i6k=
github.com/fmount/glance-operator/api v0.0.0-20240614060531-8f314f258e12/go.mod h1:67lzyETgcPlb0qqmES+Cc/VLuC5yPscFeutezT9AEWo=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
Expand Down
4 changes: 2 additions & 2 deletions pkg/openstack/glance.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl
if glance.Spec.DatabaseInstance == "" {
glance.Spec.DatabaseInstance = "openstack"
}
if glance.Spec.StorageClass == "" {
glance.Spec.StorageClass = instance.Spec.StorageClass
if glance.Spec.Storage.StorageClass == "" {
glance.Spec.Storage.StorageClass = instance.Spec.StorageClass
}
// Append globally defined extraMounts to the service's own list.
for _, ev := range instance.Spec.ExtraMounts {
Expand Down

0 comments on commit 7276f70

Please sign in to comment.