From 0a5b349595d2e53c396910a92a8cda8b66fc8999 Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Sat, 2 Dec 2023 07:30:01 +0100 Subject: [PATCH] Add list of glanceAPI support This change aligns the openstack-operator with the work done in the glance-operator to support the deployment of an arbitrary number of glanceAPI(s). The logic has been improved to support the new CRD and the Glance reconcile logic has been revisited as well. Signed-off-by: Francesco Pantano --- ....openstack.org_openstackcontrolplanes.yaml | 427 +++++++++--------- .../v1beta1/openstackcontrolplane_types.go | 2 +- apis/core/v1beta1/zz_generated.deepcopy.go | 8 +- apis/go.mod | 10 +- apis/go.sum | 20 +- ....openstack.org_openstackcontrolplanes.yaml | 427 +++++++++--------- ...nstack-operator.clusterserviceversion.yaml | 4 +- .../core_v1beta1_openstackcontrolplane.yaml | 8 +- ..._openstackcontrolplane_collapsed_cell.yaml | 8 +- ..._v1beta1_openstackcontrolplane_galera.yaml | 8 +- ...penstackcontrolplane_galera_3replicas.yaml | 8 +- ...controlplane_galera_network_isolation.yaml | 32 +- ...ne_galera_network_isolation_3replicas.yaml | 37 +- ...enstackcontrolplane_network_isolation.yaml | 32 +- ...ckcontrolplane_network_isolation_ceph.yaml | 30 +- go.mod | 10 +- go.sum | 20 +- hack/pin-bundle-images.sh | 3 + pkg/openstack/glance.go | 62 ++- .../common/assert-sample-deployment.yaml | 5 +- .../collapsed/01-assert-collapsed-cell.yaml | 5 +- .../01-assert-galera-3replicas.yaml | 5 +- .../tests/galera-basic/01-assert-galera.yaml | 5 +- 23 files changed, 623 insertions(+), 553 deletions(-) diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 26e53a568..a5b2a39d9 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -3555,25 +3555,85 @@ spec: type: object glance: properties: - apiOverride: - properties: - route: - properties: - metadata: - properties: - annotations: - additionalProperties: + apiOverrides: + additionalProperties: + properties: + route: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + alternateBackends: + items: + properties: + kind: + enum: + - Service + - "" + type: string + name: + type: string + weight: + format: int32 + maximum: 256 + minimum: 0 + type: integer + type: object + maxItems: 3 + type: array + host: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string - type: object - labels: - additionalProperties: + path: + pattern: ^/ type: string - type: object - type: object - spec: - properties: - alternateBackends: - items: + port: + properties: + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - targetPort + type: object + subdomain: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + tls: + properties: + caCertificate: + type: string + certificate: + type: string + destinationCACertificate: + type: string + insecureEdgeTerminationPolicy: + type: string + key: + type: string + termination: + enum: + - edge + - reencrypt + - passthrough + type: string + required: + - termination + type: object + to: properties: kind: enum: @@ -3588,78 +3648,20 @@ spec: minimum: 0 type: integer type: object - maxItems: 3 - type: array - host: - maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ - type: string - path: - pattern: ^/ - type: string - port: - properties: - targetPort: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - targetPort - type: object - subdomain: - maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ - type: string - tls: - properties: - caCertificate: - type: string - certificate: - type: string - destinationCACertificate: - type: string - insecureEdgeTerminationPolicy: - type: string - key: - type: string - termination: - enum: - - edge - - reencrypt - - passthrough - type: string - required: - - termination - type: object - to: - properties: - kind: - enum: - - Service - - "" - type: string - name: - type: string - weight: - format: int32 - maximum: 256 - minimum: 0 - type: integer - type: object - wildcardPolicy: - enum: - - None - - Subdomain - - "" - type: string - type: object - type: object - tls: - properties: - secretName: - type: string - type: object + wildcardPolicy: + enum: + - None + - Subdomain + - "" + type: string + type: object + type: object + tls: + properties: + secretName: + type: string + type: object + type: object type: object enabled: default: true @@ -4444,137 +4446,143 @@ spec: - extraVol type: object type: array - glanceAPI: - properties: - containerImage: - type: string - customServiceConfig: - type: string - customServiceConfigSecrets: - items: - type: string - type: array - debug: - properties: - service: - default: false - type: boolean - type: object - networkAttachments: - items: + glanceAPIs: + additionalProperties: + properties: + containerImage: type: string - type: array - nodeSelector: - additionalProperties: + customServiceConfig: type: string - type: object - override: - properties: - service: - additionalProperties: - properties: - endpointURL: - type: string - metadata: - properties: - annotations: - additionalProperties: + customServiceConfigSecrets: + items: + type: string + type: array + debug: + properties: + service: + default: false + type: boolean + type: object + networkAttachments: + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: type: string - type: object - labels: - additionalProperties: + externalTrafficPolicy: type: string - type: object - type: object - spec: - properties: - externalName: - type: string - externalTrafficPolicy: - type: string - internalTrafficPolicy: - type: string - ipFamilyPolicy: - type: string - loadBalancerClass: - type: string - loadBalancerSourceRanges: - items: + internalTrafficPolicy: type: string - type: array - sessionAffinity: - type: string - sessionAffinityConfig: - properties: - clientIP: - properties: - timeoutSeconds: - format: int32 - type: integer - type: object - type: object - type: - type: string - type: object + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object type: object - type: object - type: object - pvc: - type: string - replicas: - default: 1 - format: int32 - maximum: 32 - minimum: 0 - type: integer - resources: - properties: - claims: - items: - properties: - name: - type: string - required: + type: object + pvc: + type: string + replicas: + default: 1 + format: int32 + maximum: 32 + minimum: 0 + type: integer + resources: + properties: + claims: + items: + properties: + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - storageClass: - type: string - storageRequest: - type: string - type: - default: split - enum: - - split - - single - type: string - required: - - containerImage - - storageRequest + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + storageClass: + type: string + storageRequest: + type: string + type: + default: split + enum: + - split + - single + - edge + type: string + required: + - containerImage + - storageRequest + type: object type: object imageCacheSize: default: "" type: string + keystoneEndpoint: + default: "" + type: string nodeSelector: additionalProperties: type: string @@ -4626,8 +4634,9 @@ spec: required: - containerImage - databaseInstance - - glanceAPI + - glanceAPIs - imageCacheSize + - keystoneEndpoint - secret - storageRequest type: object diff --git a/apis/core/v1beta1/openstackcontrolplane_types.go b/apis/core/v1beta1/openstackcontrolplane_types.go index 26d5a5bac..7ba77678e 100644 --- a/apis/core/v1beta1/openstackcontrolplane_types.go +++ b/apis/core/v1beta1/openstackcontrolplane_types.go @@ -302,7 +302,7 @@ type GlanceSection struct { // +kubebuilder:validation:Optional // +operator-sdk:csv:customresourcedefinitions:type=spec // APIOverride, provides the ability to override the generated manifest of several child resources. - APIOverride Override `json:"apiOverride,omitempty"` + APIOverride map[string]Override `json:"apiOverrides,omitempty"` } // CinderSection defines the desired state of Cinder service diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index 7675c7300..b6058d9d9 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -126,7 +126,13 @@ func (in *GaleraSection) DeepCopy() *GaleraSection { func (in *GlanceSection) DeepCopyInto(out *GlanceSection) { *out = *in in.Template.DeepCopyInto(&out.Template) - in.APIOverride.DeepCopyInto(&out.APIOverride) + if in.APIOverride != nil { + in, out := &in.APIOverride, &out.APIOverride + *out = make(map[string]Override, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlanceSection. diff --git a/apis/go.mod b/apis/go.mod index 0ea7c5e8a..7f6e2143d 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -13,8 +13,8 @@ require ( github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20231127063959-58a687bf0bb4 github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20231206173636-5eb2ad7769a7 github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231127105109-2a854ad66b54 - github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231128185906-0b4579c3dadf - github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231207110546-628604e7579b + github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231208104910-f8433c1c9399 + github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231208084806-7d16c97927fe github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231205160200-1f061113c717 github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20231205003453-c971bdd03386 github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20231206091318-5f09d2fd3c1b @@ -67,8 +67,8 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/openshift/api v3.9.0+incompatible // indirect - github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231207110546-628604e7579b //indirect - github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231207110546-628604e7579b + github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231208084806-7d16c97927fe //indirect + github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231208084806-7d16c97927fe github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect @@ -113,3 +113,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202304141430 // Bump golang.org/x/net to avoid Rapid Reset CVE replace golang.org/x/net => golang.org/x/net v0.18.0 //allow-merging + +replace github.com/openstack-k8s-operators/glance-operator/api => github.com/fmount/glance-operator/api v0.1.2-0.20231209200728-562e74a308d5 diff --git a/apis/go.sum b/apis/go.sum index 109d0ca78..f439f7dee 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -33,6 +33,8 @@ github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCv github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fmount/glance-operator/api v0.1.2-0.20231209200728-562e74a308d5 h1:LGzTac1yKI3gF0mxVCeWHu4ZThyMP9O1KXJNlbwsaj0= +github.com/fmount/glance-operator/api v0.1.2-0.20231209200728-562e74a308d5/go.mod h1:3mSRS6E0MojTjGjavytRUa+IH2qPujvdrImEFu5sxFM= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -136,8 +138,6 @@ github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20231201071704-3 github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20231201071704-3a2ff9dc56b5/go.mod h1:mNVvmXLe21A6Ap9qqCcvtuYefLRm7E5cA4YalHV89oI= github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20231205132751-b5000faad819 h1:QyKf2ifup+JTMth0lbufMjR3daAMKP71PeODqzWMG6g= github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20231205132751-b5000faad819/go.mod h1:Wn+GO3Kddf7C5wM2vLNo2Ub1KRmy6qCuTwdyJlxXUuc= -github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20231205140622-00b25ab16e6f h1:rje+Sf0hNSOTQtQrehUs227tz7zfNs5T1k8eneDnKRc= -github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20231205140622-00b25ab16e6f/go.mod h1:iLnnFaUIxRCsmVs/emy4C6H/1HHh6dreMH4gvZ3jFuI= github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20231207082400-31f934b84cfc h1:lTHRGYXf3uqjdWVcBoDFU//W9w6IPyqQ2wuin08N6GI= github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20231207082400-31f934b84cfc/go.mod h1:+14IrrCmRMiY4RxqnAgRi5wzeC8TlPPbE/QvWYf5n7E= github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20231127063959-58a687bf0bb4 h1:XQ2SLbJoGpIjUsV1VT/ktFKFjsyey1QOwLrP0lGGoVo= @@ -146,14 +146,14 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20231206173636-5 github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20231206173636-5eb2ad7769a7/go.mod h1:aEtxvVQO2zI7+bSh5alZWgK98FT71gwitAkeb9WOWUs= github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231127105109-2a854ad66b54 h1:feWz7K3XIqZOZenySzfei4rsCrdgpS30kInXokX06YA= github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231127105109-2a854ad66b54/go.mod h1:H6BuZ52u+Dq/vWJgpGIJLttRTnPPH3xdVeqhI99QE/k= -github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231128185906-0b4579c3dadf h1:Omn04tJTZlNOXIszGurB8XfpbsGf+6LIn86BaN9XRDs= -github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231128185906-0b4579c3dadf/go.mod h1:kDtQ2LCkf28F7xgK8GBFAMPDhXnL6iRb8NztHhrYaO0= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231207110546-628604e7579b h1:xXWByZ9fpR5IR+RIUQrJ9hKyzABuiy6XGFQReQwkjxc= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231207110546-628604e7579b/go.mod h1:9n2nMFDiV5hGZHKr81aTAOHUoAxvEKivHeWCXFRJEZ4= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231207110546-628604e7579b h1:YXL6GK03FiyirGZt35/DSssHfn9t4DTD5ZHpAY2Q2/Q= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231207110546-628604e7579b/go.mod h1:SfdtKhpn1MGom0ZEOsgY27QFu+7SdDhO/LiuDe5cDXk= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231207110546-628604e7579b h1:YrSbxQnM1jFK4ADqN9sTAoogIQNNV62H8kJAxdMhizg= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231207110546-628604e7579b/go.mod h1:cZDEOHUMdjWrYlxxF7a4iE30GYEVSGwJYc76FJk/znY= +github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231208104910-f8433c1c9399 h1:Te7JSPGGUhkzjig/1CjlPmQgMpHT0+yHWoTxbVJGJ74= +github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231208104910-f8433c1c9399/go.mod h1:kDtQ2LCkf28F7xgK8GBFAMPDhXnL6iRb8NztHhrYaO0= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231208084806-7d16c97927fe h1:5Fk8+kZ8nVwBZv7QHH+NLlzsdgGS1Rn+bxx+90h8Zx8= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231208084806-7d16c97927fe/go.mod h1:9n2nMFDiV5hGZHKr81aTAOHUoAxvEKivHeWCXFRJEZ4= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231208084806-7d16c97927fe h1:3Ji78ik8bkstaoLOPMUv6X5728uvQIFArHQ3xGwpKps= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231208084806-7d16c97927fe/go.mod h1:SfdtKhpn1MGom0ZEOsgY27QFu+7SdDhO/LiuDe5cDXk= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231208084806-7d16c97927fe h1:0zoZaYBxzbsfVOwuur/WmgQMv+70eZnOriTXuxuKDmo= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231208084806-7d16c97927fe/go.mod h1:cZDEOHUMdjWrYlxxF7a4iE30GYEVSGwJYc76FJk/znY= github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231205160200-1f061113c717 h1:sgVrbr7S2U3O2c+UpZtVZtRRv3tHfeweBr4g2f+ZOc4= github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231205160200-1f061113c717/go.mod h1:zxkLJiNomToJs6K0dICg78vTvv/NQRW7EeblG1sg3rE= github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20231205003453-c971bdd03386 h1:d+rwNT9RK6zuGIV1OJbiyiDQxKnIktzEZiDvWhQGAf8= diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 26e53a568..a5b2a39d9 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -3555,25 +3555,85 @@ spec: type: object glance: properties: - apiOverride: - properties: - route: - properties: - metadata: - properties: - annotations: - additionalProperties: + apiOverrides: + additionalProperties: + properties: + route: + properties: + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + alternateBackends: + items: + properties: + kind: + enum: + - Service + - "" + type: string + name: + type: string + weight: + format: int32 + maximum: 256 + minimum: 0 + type: integer + type: object + maxItems: 3 + type: array + host: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ type: string - type: object - labels: - additionalProperties: + path: + pattern: ^/ type: string - type: object - type: object - spec: - properties: - alternateBackends: - items: + port: + properties: + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - targetPort + type: object + subdomain: + maxLength: 253 + pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ + type: string + tls: + properties: + caCertificate: + type: string + certificate: + type: string + destinationCACertificate: + type: string + insecureEdgeTerminationPolicy: + type: string + key: + type: string + termination: + enum: + - edge + - reencrypt + - passthrough + type: string + required: + - termination + type: object + to: properties: kind: enum: @@ -3588,78 +3648,20 @@ spec: minimum: 0 type: integer type: object - maxItems: 3 - type: array - host: - maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ - type: string - path: - pattern: ^/ - type: string - port: - properties: - targetPort: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - targetPort - type: object - subdomain: - maxLength: 253 - pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ - type: string - tls: - properties: - caCertificate: - type: string - certificate: - type: string - destinationCACertificate: - type: string - insecureEdgeTerminationPolicy: - type: string - key: - type: string - termination: - enum: - - edge - - reencrypt - - passthrough - type: string - required: - - termination - type: object - to: - properties: - kind: - enum: - - Service - - "" - type: string - name: - type: string - weight: - format: int32 - maximum: 256 - minimum: 0 - type: integer - type: object - wildcardPolicy: - enum: - - None - - Subdomain - - "" - type: string - type: object - type: object - tls: - properties: - secretName: - type: string - type: object + wildcardPolicy: + enum: + - None + - Subdomain + - "" + type: string + type: object + type: object + tls: + properties: + secretName: + type: string + type: object + type: object type: object enabled: default: true @@ -4444,137 +4446,143 @@ spec: - extraVol type: object type: array - glanceAPI: - properties: - containerImage: - type: string - customServiceConfig: - type: string - customServiceConfigSecrets: - items: - type: string - type: array - debug: - properties: - service: - default: false - type: boolean - type: object - networkAttachments: - items: + glanceAPIs: + additionalProperties: + properties: + containerImage: type: string - type: array - nodeSelector: - additionalProperties: + customServiceConfig: type: string - type: object - override: - properties: - service: - additionalProperties: - properties: - endpointURL: - type: string - metadata: - properties: - annotations: - additionalProperties: + customServiceConfigSecrets: + items: + type: string + type: array + debug: + properties: + service: + default: false + type: boolean + type: object + networkAttachments: + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + type: object + override: + properties: + service: + additionalProperties: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: type: string - type: object - labels: - additionalProperties: + externalTrafficPolicy: type: string - type: object - type: object - spec: - properties: - externalName: - type: string - externalTrafficPolicy: - type: string - internalTrafficPolicy: - type: string - ipFamilyPolicy: - type: string - loadBalancerClass: - type: string - loadBalancerSourceRanges: - items: + internalTrafficPolicy: type: string - type: array - sessionAffinity: - type: string - sessionAffinityConfig: - properties: - clientIP: - properties: - timeoutSeconds: - format: int32 - type: integer - type: object - type: object - type: - type: string - type: object + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object type: object - type: object - type: object - pvc: - type: string - replicas: - default: 1 - format: int32 - maximum: 32 - minimum: 0 - type: integer - resources: - properties: - claims: - items: - properties: - name: - type: string - required: + type: object + pvc: + type: string + replicas: + default: 1 + format: int32 + maximum: 32 + minimum: 0 + type: integer + resources: + properties: + claims: + items: + properties: + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - storageClass: - type: string - storageRequest: - type: string - type: - default: split - enum: - - split - - single - type: string - required: - - containerImage - - storageRequest + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + storageClass: + type: string + storageRequest: + type: string + type: + default: split + enum: + - split + - single + - edge + type: string + required: + - containerImage + - storageRequest + type: object type: object imageCacheSize: default: "" type: string + keystoneEndpoint: + default: "" + type: string nodeSelector: additionalProperties: type: string @@ -4626,8 +4634,9 @@ spec: required: - containerImage - databaseInstance - - glanceAPI + - glanceAPIs - imageCacheSize + - keystoneEndpoint - secret - storageRequest type: object diff --git a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml index e96e98785..e60aa2aa2 100644 --- a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml @@ -119,10 +119,10 @@ spec: - description: APIOverride, provides the ability to override the generated manifest of several child resources. displayName: APIOverride - path: glance.apiOverride + path: glance.apiOverrides - description: TLS - overrides tls parameters for public endpoint displayName: TLS - path: glance.apiOverride.tls + path: glance.apiOverrides.tls - description: Enabled - Whether Glance service should be deployed and managed displayName: Enabled path: glance.enabled diff --git a/config/samples/core_v1beta1_openstackcontrolplane.yaml b/config/samples/core_v1beta1_openstackcontrolplane.yaml index a1fcca643..5af50cdff 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane.yaml @@ -71,9 +71,11 @@ spec: databaseInstance: openstack storageClass: "" storageRequest: 10G - glanceAPI: - type: single - replicas: 1 + keystoneEndpoint: default + glanceAPIs: + default: + type: single + replicas: 1 cinder: template: databaseInstance: openstack diff --git a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml index 136ab94c6..c76711731 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml @@ -48,9 +48,11 @@ spec: databaseInstance: openstack storageClass: "" storageRequest: 10G - glanceAPI: - replicas: 1 - type: single + keystoneEndpoint: default + glanceAPIs: + default: + replicas: 1 + type: single cinder: template: databaseInstance: openstack diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml index 7b5dc99e2..f51278b14 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml @@ -64,9 +64,11 @@ spec: databaseInstance: openstack storageClass: "" storageRequest: 10G - glanceAPI: - type: single - replicas: 1 + keystoneEndpoint: default + glanceAPIs: + default: + type: single + replicas: 1 cinder: template: databaseInstance: openstack diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml index 110fffa64..803f1b3e3 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml @@ -64,9 +64,11 @@ spec: storageClass: "" storageRequest: 10G secret: osp-secret - glanceAPI: - replicas: 1 - type: single + keystoneEndpoint: default + glanceAPIs: + default: + replicas: 1 + type: single cinder: template: databaseInstance: openstack diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml index ac7332188..c7c430cd3 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml @@ -63,21 +63,23 @@ spec: storageClass: "" storageRequest: 10G secret: osp-secret - glanceAPI: - type: single - replicas: 1 - override: - service: - internal: - metadata: - annotations: - metallb.universe.tf/address-pool: internalapi - metallb.universe.tf/allow-shared-ip: internalapi - metallb.universe.tf/loadBalancerIPs: 172.17.0.80 - spec: - type: LoadBalancer - networkAttachments: - - storage + keystoneEndpoint: default + glanceAPIs: + default: + type: single + replicas: 1 + override: + service: + internal: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + networkAttachments: + - storage keystone: apiOverride: route: {} 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 d32eab4f3..5d8602d01 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml @@ -78,28 +78,31 @@ spec: barbicanKeystoneListener: replicas: 1 glance: - apiOverride: - route: {} + apiOverrides: + default: + route: {} template: databaseInstance: openstack storageClass: "" storageRequest: 10G secret: osp-secret - glanceAPI: - type: single - replicas: 1 - override: - service: - internal: - metadata: - annotations: - metallb.universe.tf/address-pool: internalapi - metallb.universe.tf/allow-shared-ip: internalapi - metallb.universe.tf/loadBalancerIPs: 172.17.0.80 - spec: - type: LoadBalancer - networkAttachments: - - storage + keystoneEndpoint: default + glanceAPIs: + default: + type: single + replicas: 1 + override: + service: + internal: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + networkAttachments: + - storage keystone: apiOverride: route: {} diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml index 9ea67b525..dc5286913 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml @@ -85,21 +85,23 @@ spec: storageClass: "" storageRequest: 10G secret: osp-secret - glanceAPI: - type: single - replicas: 1 - override: - service: - internal: - metadata: - annotations: - metallb.universe.tf/address-pool: internalapi - metallb.universe.tf/allow-shared-ip: internalapi - metallb.universe.tf/loadBalancerIPs: 172.17.0.80 - spec: - type: LoadBalancer - networkAttachments: - - storage + keystoneEndpoint: default + glanceAPIs: + default: + type: single + replicas: 1 + override: + service: + internal: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + networkAttachments: + - storage keystone: apiOverride: route: {} diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml index 3c5d096ba..2bbe6e0b6 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml @@ -124,20 +124,22 @@ spec: storageClass: "" storageRequest: 10G secret: osp-secret - glanceAPI: - replicas: 1 - override: - service: - internal: - metadata: - annotations: - metallb.universe.tf/address-pool: internalapi - metallb.universe.tf/allow-shared-ip: internalapi - metallb.universe.tf/loadBalancerIPs: 172.17.0.80 - spec: - type: LoadBalancer - networkAttachments: - - storage + keystoneEndpoint: default + glanceAPIs: + default: + replicas: 1 + override: + service: + internal: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + networkAttachments: + - storage keystone: apiOverride: route: {} diff --git a/go.mod b/go.mod index 281e6527b..f8a4ab291 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,9 @@ require ( github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20231127063959-58a687bf0bb4 github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20231206173636-5eb2ad7769a7 github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231127105109-2a854ad66b54 - github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231128185906-0b4579c3dadf + github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231208104910-f8433c1c9399 github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.0.0-20231207110546-628604e7579b - github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231207110546-628604e7579b + github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231208084806-7d16c97927fe github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20231207110546-628604e7579b github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231205160200-1f061113c717 github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20231205003453-c971bdd03386 @@ -83,8 +83,8 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/openshift/api v3.9.0+incompatible - github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231207110546-628604e7579b //indirect - github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231207110546-628604e7579b //indirect + github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231208084806-7d16c97927fe //indirect + github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231208084806-7d16c97927fe //indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect @@ -131,3 +131,5 @@ replace github.com/openstack-k8s-operators/openstack-operator/apis => ./apis // mschuppert: map to latest commit from release-4.13 tag // must consistent within modules and service operators replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging + +replace github.com/openstack-k8s-operators/glance-operator/api => github.com/fmount/glance-operator/api v0.1.2-0.20231209200728-562e74a308d5 diff --git a/go.sum b/go.sum index 80afa6626..3c2ee2137 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,8 @@ github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCv github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/fmount/glance-operator/api v0.1.2-0.20231209200728-562e74a308d5 h1:LGzTac1yKI3gF0mxVCeWHu4ZThyMP9O1KXJNlbwsaj0= +github.com/fmount/glance-operator/api v0.1.2-0.20231209200728-562e74a308d5/go.mod h1:3mSRS6E0MojTjGjavytRUa+IH2qPujvdrImEFu5sxFM= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -149,8 +151,6 @@ github.com/openstack-k8s-operators/dataplane-operator/api v0.3.1-0.2023120710274 github.com/openstack-k8s-operators/dataplane-operator/api v0.3.1-0.20231207102743-0c28ce13c243/go.mod h1:NuM5pNxE6bVNrAAYNkfJL1la8USbvfuvzBDs1D1qreE= github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20231205132751-b5000faad819 h1:QyKf2ifup+JTMth0lbufMjR3daAMKP71PeODqzWMG6g= github.com/openstack-k8s-operators/designate-operator/api v0.0.0-20231205132751-b5000faad819/go.mod h1:Wn+GO3Kddf7C5wM2vLNo2Ub1KRmy6qCuTwdyJlxXUuc= -github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20231205140622-00b25ab16e6f h1:rje+Sf0hNSOTQtQrehUs227tz7zfNs5T1k8eneDnKRc= -github.com/openstack-k8s-operators/glance-operator/api v0.3.1-0.20231205140622-00b25ab16e6f/go.mod h1:iLnnFaUIxRCsmVs/emy4C6H/1HHh6dreMH4gvZ3jFuI= github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20231207082400-31f934b84cfc h1:lTHRGYXf3uqjdWVcBoDFU//W9w6IPyqQ2wuin08N6GI= github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20231207082400-31f934b84cfc/go.mod h1:+14IrrCmRMiY4RxqnAgRi5wzeC8TlPPbE/QvWYf5n7E= github.com/openstack-k8s-operators/horizon-operator/api v0.3.1-0.20231127063959-58a687bf0bb4 h1:XQ2SLbJoGpIjUsV1VT/ktFKFjsyey1QOwLrP0lGGoVo= @@ -159,16 +159,16 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20231206173636-5 github.com/openstack-k8s-operators/infra-operator/apis v0.3.1-0.20231206173636-5eb2ad7769a7/go.mod h1:aEtxvVQO2zI7+bSh5alZWgK98FT71gwitAkeb9WOWUs= github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231127105109-2a854ad66b54 h1:feWz7K3XIqZOZenySzfei4rsCrdgpS30kInXokX06YA= github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231127105109-2a854ad66b54/go.mod h1:H6BuZ52u+Dq/vWJgpGIJLttRTnPPH3xdVeqhI99QE/k= -github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231128185906-0b4579c3dadf h1:Omn04tJTZlNOXIszGurB8XfpbsGf+6LIn86BaN9XRDs= -github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231128185906-0b4579c3dadf/go.mod h1:kDtQ2LCkf28F7xgK8GBFAMPDhXnL6iRb8NztHhrYaO0= +github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231208104910-f8433c1c9399 h1:Te7JSPGGUhkzjig/1CjlPmQgMpHT0+yHWoTxbVJGJ74= +github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231208104910-f8433c1c9399/go.mod h1:kDtQ2LCkf28F7xgK8GBFAMPDhXnL6iRb8NztHhrYaO0= github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.0.0-20231207110546-628604e7579b h1:H/jqvU815akhwqtx2MJi8GzLcsDfjOtYrATU0yjpKqI= github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.0.0-20231207110546-628604e7579b/go.mod h1:lCQ60fMiHSFhIDAkTF7YVLNtHGpxP65xshyRv2ivLSQ= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231207110546-628604e7579b h1:xXWByZ9fpR5IR+RIUQrJ9hKyzABuiy6XGFQReQwkjxc= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231207110546-628604e7579b/go.mod h1:9n2nMFDiV5hGZHKr81aTAOHUoAxvEKivHeWCXFRJEZ4= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231207110546-628604e7579b h1:YXL6GK03FiyirGZt35/DSssHfn9t4DTD5ZHpAY2Q2/Q= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231207110546-628604e7579b/go.mod h1:SfdtKhpn1MGom0ZEOsgY27QFu+7SdDhO/LiuDe5cDXk= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231207110546-628604e7579b h1:YrSbxQnM1jFK4ADqN9sTAoogIQNNV62H8kJAxdMhizg= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231207110546-628604e7579b/go.mod h1:cZDEOHUMdjWrYlxxF7a4iE30GYEVSGwJYc76FJk/znY= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231208084806-7d16c97927fe h1:5Fk8+kZ8nVwBZv7QHH+NLlzsdgGS1Rn+bxx+90h8Zx8= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231208084806-7d16c97927fe/go.mod h1:9n2nMFDiV5hGZHKr81aTAOHUoAxvEKivHeWCXFRJEZ4= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231208084806-7d16c97927fe h1:3Ji78ik8bkstaoLOPMUv6X5728uvQIFArHQ3xGwpKps= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231208084806-7d16c97927fe/go.mod h1:SfdtKhpn1MGom0ZEOsgY27QFu+7SdDhO/LiuDe5cDXk= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231208084806-7d16c97927fe h1:0zoZaYBxzbsfVOwuur/WmgQMv+70eZnOriTXuxuKDmo= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231208084806-7d16c97927fe/go.mod h1:cZDEOHUMdjWrYlxxF7a4iE30GYEVSGwJYc76FJk/znY= github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20231207110546-628604e7579b h1:V2sDqQ651iGsIZN5/gqLRmg20ZHgGYykb8C0cfYFa9M= github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20231207110546-628604e7579b/go.mod h1:4y3C/fzrxIaxJU2tFTCdTi7Zmdlo/i7xEqL1sIw1kN4= github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231205160200-1f061113c717 h1:sgVrbr7S2U3O2c+UpZtVZtRRv3tHfeweBr4g2f+ZOc4= diff --git a/hack/pin-bundle-images.sh b/hack/pin-bundle-images.sh index 1e64787ea..03d48b15f 100755 --- a/hack/pin-bundle-images.sh +++ b/hack/pin-bundle-images.sh @@ -46,6 +46,9 @@ for MOD_PATH in $(go list -mod=readonly -m -json all | jq -r '. | select(.Path | REPO_CURL_URL="https://${CURL_REGISTRY}/api/v1/repository/${IMAGENAMESPACE}" fi else + # HACK TO MAKE THE BUILD PHASE PASS AND POINT TO THE IMAGE BUILT IN + # THE REPLACE DIRECTIVE GIVEN THAT GITHUB_USER != QUAY USER + GITHUB_USER=fpantano REPO_CURL_URL="https://${CURL_REGISTRY}/api/v1/repository/${GITHUB_USER}" REPO_URL="${CURL_REGISTRY}/${GITHUB_USER}" fi diff --git a/pkg/openstack/glance.go b/pkg/openstack/glance.go index c4b18f720..4e183a733 100644 --- a/pkg/openstack/glance.go +++ b/pkg/openstack/glance.go @@ -41,16 +41,18 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl } // add selector to service overrides - for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} { - if instance.Spec.Glance.Template.GlanceAPI.Override.Service == nil { - instance.Spec.Glance.Template.GlanceAPI.Override.Service = map[service.Endpoint]service.RoutedOverrideSpec{} + for name, glanceAPI := range instance.Spec.Glance.Template.GlanceAPIs { + var currentAPI glancev1.GlanceAPITemplate + for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} { + if glanceAPI.Override.Service == nil { + currentAPI = instance.Spec.Glance.Template.GlanceAPIs[name] + currentAPI.Override.Service = map[service.Endpoint]service.RoutedOverrideSpec{} + } + instance.Spec.Glance.Template.GlanceAPIs[name] = currentAPI + currentAPI.Override.Service[endpointType] = AddServiceComponentLabel( + currentAPI.Override.Service[endpointType], glance.Name) } - instance.Spec.Glance.Template.GlanceAPI.Override.Service[endpointType] = - AddServiceComponentLabel( - instance.Spec.Manila.Template.ManilaAPI.Override.Service[endpointType], - glance.Name) } - // When component services got created check if there is the need to create a route if err := helper.GetClient().Get(ctx, types.NamespacedName{Name: "glance", Namespace: instance.Namespace}, glance); err != nil { if !k8s_errors.IsNotFound(err) { @@ -68,22 +70,38 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl if err != nil { return ctrl.Result{}, err } + // initialize the main APIOverride struct + if instance.Spec.Glance.APIOverride == nil { + instance.Spec.Glance.APIOverride = map[string]corev1beta1.Override{} + } var ctrlResult reconcile.Result - instance.Spec.Glance.Template.GlanceAPI.Override.Service, ctrlResult, err = EnsureEndpointConfig( - ctx, - instance, - helper, - glance, - svcs, - instance.Spec.Glance.Template.GlanceAPI.Override.Service, - instance.Spec.Glance.APIOverride, - corev1beta1.OpenStackControlPlaneExposeGlanceReadyCondition, - ) - if err != nil { - return ctrlResult, err - } else if (ctrlResult != ctrl.Result{}) { - return ctrlResult, nil + var changed bool = false + for name, glanceAPI := range instance.Spec.Glance.Template.GlanceAPIs { + if _, ok := instance.Spec.Glance.APIOverride[name]; ok { + instance.Spec.Glance.APIOverride[name] = corev1beta1.Override{} + } + _, ctrlResult, err = EnsureEndpointConfig( + ctx, + instance, + helper, + glance, + svcs, + glanceAPI.Override.Service, + instance.Spec.Glance.APIOverride[name], + corev1beta1.OpenStackControlPlaneExposeGlanceReadyCondition, + ) + if err != nil { + return ctrlResult, err + } + // let's keep track of changes here + if (ctrlResult != ctrl.Result{}) { + changed = true + //return ctrlResult, nil + } + } + if changed { + return ctrl.Result{}, nil } } diff --git a/tests/kuttl/common/assert-sample-deployment.yaml b/tests/kuttl/common/assert-sample-deployment.yaml index f134336cf..80525300e 100644 --- a/tests/kuttl/common/assert-sample-deployment.yaml +++ b/tests/kuttl/common/assert-sample-deployment.yaml @@ -44,8 +44,9 @@ spec: databaseInstance: openstack storageRequest: 10G secret: osp-secret - glanceAPI: - replicas: 1 + glanceAPIs: + default: + replicas: 1 cinder: template: databaseInstance: openstack diff --git a/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml b/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml index 0e6cd2d3f..a45c0461d 100644 --- a/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml +++ b/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml @@ -28,8 +28,9 @@ spec: template: databaseInstance: openstack storageRequest: 10G - glanceAPI: - replicas: 1 + glanceAPIs: + default: + replicas: 1 cinder: template: databaseInstance: openstack diff --git a/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml b/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml index fb8cc8d88..c225fe968 100644 --- a/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml +++ b/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml @@ -44,8 +44,9 @@ spec: template: databaseInstance: openstack storageRequest: 10G - glanceAPI: - replicas: 1 + glanceAPIs: + default: + replicas: 1 cinder: template: databaseInstance: openstack diff --git a/tests/kuttl/tests/galera-basic/01-assert-galera.yaml b/tests/kuttl/tests/galera-basic/01-assert-galera.yaml index b40029991..05895f5a8 100644 --- a/tests/kuttl/tests/galera-basic/01-assert-galera.yaml +++ b/tests/kuttl/tests/galera-basic/01-assert-galera.yaml @@ -44,8 +44,9 @@ spec: template: databaseInstance: openstack storageRequest: 10G - glanceAPI: - replicas: 1 + glanceAPIs: + default: + replicas: 1 cinder: template: databaseInstance: openstack