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 17, 2024
1 parent 82a2f29 commit 64d3e84
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 52 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
2 changes: 1 addition & 1 deletion apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240603141403-1ad477d065a2
github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240612161940-604036e71c7f
github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240611223414-c013696ad9cc
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240616104609-e296d336e2d0
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240617143817-90d7bb77c86c
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240614091021-67d1c605b0e8
github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20240604091541-cdb648f9a7ac
github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20240604144138-996e41d1af19
Expand Down
4 changes: 2 additions & 2 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240612161940-6
github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240612161940-604036e71c7f/go.mod h1:8Wn6ZAPaJshxozJVPI7uq4qrcUXZmECGAPJK7Ed+uGQ=
github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240611223414-c013696ad9cc h1:+O8EHGrJ1KNU6abPCkUkl2RQe/MHCGCgpH2t7kPT2iU=
github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240611223414-c013696ad9cc/go.mod h1:u53p2KRT083miTWA5oQlU4zITB4FXJOzI/eao51CkbE=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240616104609-e296d336e2d0 h1:Wx4xa5Jh/Wa9pAsoCYROJKycesBAy3RBjf/2WnG1Da8=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240616104609-e296d336e2d0/go.mod h1:fYNG/9X9HbQTZkaPo+YLqPu/94dNftw15S58OpQjcZE=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240617143817-90d7bb77c86c h1:QuF1kEWBdCgDy6wqcLXMYzK7nUko/uA1S9I1uvhoKpg=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240617143817-90d7bb77c86c/go.mod h1:fYNG/9X9HbQTZkaPo+YLqPu/94dNftw15S58OpQjcZE=
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240614091021-67d1c605b0e8 h1:vwvO/6RAzy6kd+AElRaMF3E7C+lZ3HUd8cRx3gfe3l0=
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240614091021-67d1c605b0e8/go.mod h1:h7k9mJ8F9Imch6bqXdKB1I6IlF+N7RM2yyOSlFBWMVA=
github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20240604091541-cdb648f9a7ac h1:PefPL9dy16A47TmEsjlGbJcM9tmXA75qAxh9jxQ/Vx4=
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: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240603141403-1ad477d065a2
github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240612161940-604036e71c7f
github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240611223414-c013696ad9cc
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240616104609-e296d336e2d0
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240617143817-90d7bb77c86c
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240614091021-67d1c605b0e8
github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20240604091541-cdb648f9a7ac
github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20240604144138-996e41d1af19
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240612161940-6
github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240612161940-604036e71c7f/go.mod h1:8Wn6ZAPaJshxozJVPI7uq4qrcUXZmECGAPJK7Ed+uGQ=
github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240611223414-c013696ad9cc h1:+O8EHGrJ1KNU6abPCkUkl2RQe/MHCGCgpH2t7kPT2iU=
github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20240611223414-c013696ad9cc/go.mod h1:u53p2KRT083miTWA5oQlU4zITB4FXJOzI/eao51CkbE=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240616104609-e296d336e2d0 h1:Wx4xa5Jh/Wa9pAsoCYROJKycesBAy3RBjf/2WnG1Da8=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240616104609-e296d336e2d0/go.mod h1:fYNG/9X9HbQTZkaPo+YLqPu/94dNftw15S58OpQjcZE=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240617143817-90d7bb77c86c h1:QuF1kEWBdCgDy6wqcLXMYzK7nUko/uA1S9I1uvhoKpg=
github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20240617143817-90d7bb77c86c/go.mod h1:fYNG/9X9HbQTZkaPo+YLqPu/94dNftw15S58OpQjcZE=
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240614091021-67d1c605b0e8 h1:vwvO/6RAzy6kd+AElRaMF3E7C+lZ3HUd8cRx3gfe3l0=
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240614091021-67d1c605b0e8/go.mod h1:h7k9mJ8F9Imch6bqXdKB1I6IlF+N7RM2yyOSlFBWMVA=
github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20240604091541-cdb648f9a7ac h1:PefPL9dy16A47TmEsjlGbJcM9tmXA75qAxh9jxQ/Vx4=
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 64d3e84

Please sign in to comment.