diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index f2577719b..a9e9391f0 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -4373,8 +4373,6 @@ spec: type: object type: object type: object - pvc: - type: string replicas: default: 1 format: int32 @@ -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: @@ -4443,7 +4446,6 @@ spec: type: string required: - containerImage - - storageRequest type: object type: object imageCache: @@ -4506,10 +4508,15 @@ 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 @@ -4517,7 +4524,6 @@ spec: - keystoneEndpoint - memcachedInstance - secret - - storageRequest type: object type: object heat: diff --git a/apis/go.mod b/apis/go.mod index 771fcbb00..b2497579f 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -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 diff --git a/apis/go.sum b/apis/go.sum index dbd375f02..e53176581 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -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= diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index f2577719b..a9e9391f0 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -4373,8 +4373,6 @@ spec: type: object type: object type: object - pvc: - type: string replicas: default: 1 format: int32 @@ -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: @@ -4443,7 +4446,6 @@ spec: type: string required: - containerImage - - storageRequest type: object type: object imageCache: @@ -4506,10 +4508,15 @@ 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 @@ -4517,7 +4524,6 @@ spec: - keystoneEndpoint - memcachedInstance - secret - - storageRequest type: object type: object heat: diff --git a/config/samples/core_v1beta1_openstackcontrolplane.yaml b/config/samples/core_v1beta1_openstackcontrolplane.yaml index ea73797a7..abc222eb6 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane.yaml @@ -56,8 +56,9 @@ spec: template: secret: osp-secret databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G keystoneEndpoint: default glanceAPIs: default: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml index 38dd371d6..ea63a0487 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml @@ -46,8 +46,9 @@ spec: template: secret: osp-secret databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G keystoneEndpoint: default glanceAPIs: default: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml index 343263083..78ab13cde 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml @@ -54,8 +54,9 @@ spec: template: secret: osp-secret databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G keystoneEndpoint: default glanceAPIs: default: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml index 740d89be3..55520e60a 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml @@ -53,8 +53,9 @@ spec: glance: template: databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G secret: osp-secret keystoneEndpoint: default glanceAPIs: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml index 5994f1bd5..87440d2ed 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml @@ -55,8 +55,9 @@ spec: route: {} template: databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G secret: osp-secret keystoneEndpoint: default glanceAPIs: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml index ee8758833..5a19f6bc3 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml @@ -77,8 +77,9 @@ spec: route: {} template: databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G secret: osp-secret keystoneEndpoint: default glanceAPIs: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas_only_default_enabled_services.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas_only_default_enabled_services.yaml index f6aebd416..6c3be36ba 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas_only_default_enabled_services.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas_only_default_enabled_services.yaml @@ -77,8 +77,9 @@ spec: route: {} template: databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G secret: osp-secret keystoneEndpoint: default glanceAPIs: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml index b3c778b59..b3273d0c3 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml @@ -77,8 +77,9 @@ spec: route: {} template: databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G secret: osp-secret keystoneEndpoint: default glanceAPIs: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml index e2174cf23..d33366f9f 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml @@ -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: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_tls_public_endpoint.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_tls_public_endpoint.yaml index b5843a59b..fb6a1c924 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_tls_public_endpoint.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_tls_public_endpoint.yaml @@ -80,8 +80,9 @@ spec: route: {} template: databaseInstance: openstack - storageClass: "" - storageRequest: 10G + storage: + storageClass: "" + storageRequest: 10G secret: osp-secret keystoneEndpoint: default glanceAPIs: diff --git a/go.mod b/go.mod index 4fdd491f9..f956f1db2 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index bb3ea3a72..9b075a0b8 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/openstack/glance.go b/pkg/openstack/glance.go index e30f66ad5..aed3dffa4 100644 --- a/pkg/openstack/glance.go +++ b/pkg/openstack/glance.go @@ -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 {