Skip to content

Commit ff7c3f6

Browse files
committed
Add support for multiple Cinder Backups configuration
This patch integrates CinderBackups support into OpenStackControlPlane CRD and adds the corresponding logic. It enables configuration of multiple Cinder Backup services and deprecates the existing interface [1]. [1] openstack-k8s-operators/cinder-operator#575 Signed-off-by: Francesco Pantano <fpantano@redhat.com>
1 parent 0b7b865 commit ff7c3f6

14 files changed

+374
-34
lines changed

api/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,70 @@ spec:
877877
type: string
878878
type: object
879879
type: object
880+
cinderBackups:
881+
additionalProperties:
882+
properties:
883+
customServiceConfig:
884+
type: string
885+
customServiceConfigSecrets:
886+
items:
887+
type: string
888+
type: array
889+
networkAttachments:
890+
items:
891+
type: string
892+
type: array
893+
nodeSelector:
894+
additionalProperties:
895+
type: string
896+
type: object
897+
replicas:
898+
default: 1
899+
format: int32
900+
minimum: 0
901+
type: integer
902+
resources:
903+
properties:
904+
claims:
905+
items:
906+
properties:
907+
name:
908+
type: string
909+
request:
910+
type: string
911+
required:
912+
- name
913+
type: object
914+
type: array
915+
x-kubernetes-list-map-keys:
916+
- name
917+
x-kubernetes-list-type: map
918+
limits:
919+
additionalProperties:
920+
anyOf:
921+
- type: integer
922+
- type: string
923+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
924+
x-kubernetes-int-or-string: true
925+
type: object
926+
requests:
927+
additionalProperties:
928+
anyOf:
929+
- type: integer
930+
- type: string
931+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
932+
x-kubernetes-int-or-string: true
933+
type: object
934+
type: object
935+
topologyRef:
936+
properties:
937+
name:
938+
type: string
939+
namespace:
940+
type: string
941+
type: object
942+
type: object
943+
type: object
880944
cinderScheduler:
881945
properties:
882946
customServiceConfig:

api/core/v1beta1/openstackcontrolplane_webhook.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
316316
maps.Keys(r.Spec.Cinder.Template.CinderVolumes),
317317
cinderv1.GetCrMaxLengthCorrection(cinderName)) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
318318
errors = append(errors, errs...)
319-
errors = append(errors, r.Spec.Cinder.Template.ValidateCreate(basePath.Child("cinder").Child("template"), r.Namespace)...)
319+
warns, errs := r.Spec.Cinder.Template.ValidateCreate(basePath.Child("cinder").Child("template"), r.Namespace)
320+
errors = append(errors, errs...)
321+
warnings = append(warnings, warns...)
320322
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Cinder.APIOverride.Route, basePath.Child("cinder").Child("apiOverride").Child("route"))...)
321323
}
322324

@@ -501,7 +503,9 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
501503
maps.Keys(r.Spec.Cinder.Template.CinderVolumes),
502504
cinderv1.GetCrMaxLengthCorrection(cinderName)) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
503505
errors = append(errors, errs...)
504-
errors = append(errors, r.Spec.Cinder.Template.ValidateUpdate(*old.Cinder.Template, basePath.Child("cinder").Child("template"), r.Namespace)...)
506+
warns, errs := r.Spec.Cinder.Template.ValidateUpdate(*old.Cinder.Template, basePath.Child("cinder").Child("template"), r.Namespace)
507+
errors = append(errors, errs...)
508+
warnings = append(warnings, warns...)
505509
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Cinder.APIOverride.Route, basePath.Child("cinder").Child("apiOverride").Child("route"))...)
506510
}
507511

api/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ go 1.24.4
55
require (
66
github.com/cert-manager/cert-manager v1.16.5
77
github.com/go-playground/validator/v10 v10.28.0
8-
github.com/onsi/ginkgo/v2 v2.27.2
9-
github.com/onsi/gomega v1.38.2
8+
github.com/onsi/ginkgo/v2 v2.27.3
9+
github.com/onsi/gomega v1.38.3
1010
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20251125115107-f489fa5ceb3c
11-
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251204132059-3dda695e96ae
11+
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251215101145-f9d7fba7522e
1212
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20251203145024-0f6b7a8e7dc5
1313
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20251203100349-4a406668b8c7
1414
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20251125115646-26b110b9f3e7
1515
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20251125145341-8bc80a35f9c5
16-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96
16+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251206161943-786269345f99
1717
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20251203164336-97b491f161c0
1818
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20251128160419-8b3a77972a77
1919
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251122131503-b76943960b6c

api/go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd
108108
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
109109
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
110110
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
111-
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
112-
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
113-
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
114-
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
111+
github.com/onsi/ginkgo/v2 v2.27.3 h1:ICsZJ8JoYafeXFFlFAG75a7CxMsJHwgKwtO+82SE9L8=
112+
github.com/onsi/ginkgo/v2 v2.27.3/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
113+
github.com/onsi/gomega v1.38.3 h1:eTX+W6dobAYfFeGC2PV6RwXRu/MyT+cQguijutvkpSM=
114+
github.com/onsi/gomega v1.38.3/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
115115
github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e h1:E1OdwSpqWuDPCedyUt0GEdoAE+r5TXy7YS21yNEo+2U=
116116
github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
117117
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20251125115107-f489fa5ceb3c h1:cQRQbyBmYfS4Ubj/0hwj5IVs0AAZqMyhqA1i50r4oTI=
118118
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20251125115107-f489fa5ceb3c/go.mod h1:HURjuNEy1OrE7bn2snCYMzk148bHaD7u7JleEu9h5ws=
119-
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251204132059-3dda695e96ae h1:KNfIrxh4nfNvh6PC8pekXefNtQgvWuAGpUefqRW9XUU=
120-
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251204132059-3dda695e96ae/go.mod h1:IrtEtP+mjH2pHLQvk9ZzKebtjMW50HKG0IhooZgmmDw=
119+
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251215101145-f9d7fba7522e h1:7ycLZrIuoBkeWo2gX1Qm2cYRrBnpYAEpBNYG/qD+HGY=
120+
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251215101145-f9d7fba7522e/go.mod h1:9z03RzMVCjIHeL94YeDHFoFbU69NGMiFQFXNPS9QZ1E=
121121
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20251203145024-0f6b7a8e7dc5 h1:iUSQ+Goc3KAjL+H41mf1Dqi+L8cxvTU3ooFESVSyDZw=
122122
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20251203145024-0f6b7a8e7dc5/go.mod h1:n5EzCMhTH/Y0YmTMrOpLUyaE94N183c6kNI8oOWsHsk=
123123
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20251203100349-4a406668b8c7 h1:ClmWHUH41VsMru9cD4IciyRJuw1bXXMBjt19JYRON/8=
@@ -126,8 +126,8 @@ github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20251125115646-26b
126126
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20251125115646-26b110b9f3e7/go.mod h1:ABIb9YiV6nmcGC4h49X8eJIeqmnG/6j77eIiYQGWrUc=
127127
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20251125145341-8bc80a35f9c5 h1:VxWuwuIbNmexcpL2JpLaWAj1aFR0v1BfehIKpbCwIfY=
128128
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20251125145341-8bc80a35f9c5/go.mod h1:NHffNXXDFrfJx/+htPjd8WvDRMPqddRJThBqujwlFc8=
129-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96 h1:hPgCcrbRHBPfngaEPe6coaCtcauMolI71lfcLdinrKI=
130-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96/go.mod h1:ZuglN7IqXfIo75WcJwe0NLHhu82Fs3k/5IXptqnO1H4=
129+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251206161943-786269345f99 h1:J9SzxfFmQQEMpfoCtpKUd87LtQXLWGZORL+6nBdtP+w=
130+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251206161943-786269345f99/go.mod h1:UgaMi5mHTvaGYLdPKwewSnYiSm75P+vowRqbqknHlbw=
131131
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20251203164336-97b491f161c0 h1:Dw3Fr0GW9mlrhbSe12ZEadPZA18HuGt3l1GT/EgeYSU=
132132
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20251203164336-97b491f161c0/go.mod h1:O0wyWPhcAxsdvbXikS9KFmE9EB2SLSC5oWdMw6PHUXI=
133133
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20251128160419-8b3a77972a77 h1:XzVPjfzxDJwgW8sNGv9K577Ui2mb6Mp3sDItuDmTv9E=

bindata/crds/cinder.openstack.org_cinderapis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ spec:
6060
description: |-
6161
CustomServiceConfig - customize the service config using this parameter to change service defaults,
6262
or overwrite rendered information using raw OpenStack config format. The content gets added to
63-
to /etc/<service>/<service>.conf.d directory as a custom config file.
63+
the /etc/<service>/<service>.conf.d directory as a custom config file.
6464
type: string
6565
customServiceConfigSecrets:
6666
description: |-

bindata/crds/cinder.openstack.org_cinderbackups.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ spec:
6060
description: |-
6161
CustomServiceConfig - customize the service config using this parameter to change service defaults,
6262
or overwrite rendered information using raw OpenStack config format. The content gets added to
63-
to /etc/<service>/<service>.conf.d directory as a custom config file.
63+
the /etc/<service>/<service>.conf.d directory as a custom config file.
6464
type: string
6565
customServiceConfigSecrets:
6666
description: |-

0 commit comments

Comments
 (0)