Skip to content

Commit ca95e47

Browse files
committed
Add support for multiple Cinder Backups configuration
This patch integrates CinderBackup 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 3aa569b commit ca95e47

18 files changed

+436
-46
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20251127153827-e055abae3b33
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.20251124130651-1ff40691b66d
16+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96
1717
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20251125165311-d458faac6271
1818
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20251125151441-4c2def1dda9b
1919
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251122131503-b76943960b6c
@@ -81,7 +81,6 @@ require (
8181
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
8282
github.com/openshift/api v3.9.0+incompatible // indirect
8383
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251103072528-9eb684fef4ef // indirect
84-
github.com/openstack-k8s-operators/lib-common/modules/test v0.6.1-0.20251122131503-b76943960b6c // indirect
8584
github.com/pkg/errors v0.9.1 // indirect
8685
github.com/prometheus/client_golang v1.22.0 // indirect
8786
github.com/prometheus/client_model v0.6.2 // indirect
@@ -144,3 +143,5 @@ replace k8s.io/code-generator => k8s.io/code-generator v0.31.13 //allow-merging
144143
replace k8s.io/component-base => k8s.io/component-base v0.31.13 //allow-merging
145144

146145
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
146+
147+
replace github.com/openstack-k8s-operators/cinder-operator/api => github.com/fmount/cinder-operator/api v0.1.1-0.20251212090128-387a4717706b

api/go.sum

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb
1616
github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
1717
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
1818
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
19+
github.com/fmount/cinder-operator/api v0.1.1-0.20251212090128-387a4717706b h1:cq4fQg7w9t9S4xx/SB4/BVSL+v1CFZ9JPLn2/txinFU=
1920
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
2021
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
2122
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
@@ -116,8 +117,6 @@ github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e h1:E1OdwSpqWuDPCedyU
116117
github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
117118
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20251125115107-f489fa5ceb3c h1:cQRQbyBmYfS4Ubj/0hwj5IVs0AAZqMyhqA1i50r4oTI=
118119
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.20251125143015-0548029d9df0 h1:BfTkwCr4sP5PlsQu65CHO8ZTIDNK7BfB0UWbFTRh730=
120-
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20251125143015-0548029d9df0/go.mod h1:IrtEtP+mjH2pHLQvk9ZzKebtjMW50HKG0IhooZgmmDw=
121120
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20251125143014-f2b7132f2963 h1:oMTI+YjFMxX2b2Ac9J/YSdpkB1egfSdFDype9sD2y2E=
122121
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20251125143014-f2b7132f2963/go.mod h1:qzxe5RJalpItYbD3+pDIGMrPer/P5M50LQQyuusU7lI=
123122
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20251127153827-e055abae3b33 h1:QwYA2HJKLxOsVBjtGURvhnx2m0yQUB0fN/7IPK1yI74=
@@ -126,8 +125,7 @@ github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20251125115646-26b
126125
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20251125115646-26b110b9f3e7/go.mod h1:ABIb9YiV6nmcGC4h49X8eJIeqmnG/6j77eIiYQGWrUc=
127126
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20251125145341-8bc80a35f9c5 h1:VxWuwuIbNmexcpL2JpLaWAj1aFR0v1BfehIKpbCwIfY=
128127
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.20251124130651-1ff40691b66d h1:5513vDczN+/Sc/vNIVus+M/Li61oP5/sQzSiPRCmUSA=
130-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251124130651-1ff40691b66d/go.mod h1:U6fKKmnazlF/il/jP5DQdKzkh0QX3Z95Pau46KoeTMo=
128+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96 h1:hPgCcrbRHBPfngaEPe6coaCtcauMolI71lfcLdinrKI=
131129
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20251125165311-d458faac6271 h1:ExfEekNT07SmCYx0S8daR8ZyWKTxj9jgV3LKNlUvYvw=
132130
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20251125165311-d458faac6271/go.mod h1:383ooOUA0DHtaeR9etcM7oKiTz5s8QMzrAZRunzZUrY=
133131
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20251125151441-4c2def1dda9b h1:GXiVcoycSi4CM+4FVKmhtlELgG15kZ4O4lG3qfi/iXc=
@@ -138,8 +136,6 @@ github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.2025110
138136
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251103072528-9eb684fef4ef/go.mod h1:yf13jWb60XV26eA7A8o86ZCXNWBLNK9dPkTSWFaTPCw=
139137
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251122131503-b76943960b6c h1:dVIaDL5BeIdJjERGaN/XlcvZVplfkzh0uUfiVUHj/6Q=
140138
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251122131503-b76943960b6c/go.mod h1:fy1lvz3uuzzh01DKKdgroXvmJgMpJBsvl2r9eTtAll0=
141-
github.com/openstack-k8s-operators/lib-common/modules/test v0.6.1-0.20251122131503-b76943960b6c h1:YdTv3RXKfFg2QHXtLJSnKaPruslyp1Fd+ArcsxLcy6k=
142-
github.com/openstack-k8s-operators/lib-common/modules/test v0.6.1-0.20251122131503-b76943960b6c/go.mod h1:lgYyrXEYA2BPsq4Kg6dqa+QsHgOjMPyOsEYrvyYW3jk=
143139
github.com/openstack-k8s-operators/manila-operator/api v0.6.1-0.20251125175220-eb6712fd5b15 h1:Pt/W7/Pc69Itr/gGeSpgBv8nQ0/EBpJoSNwD1cJDBgA=
144140
github.com/openstack-k8s-operators/manila-operator/api v0.6.1-0.20251125175220-eb6712fd5b15/go.mod h1:ehpkS5rMt0za5S+Fvjk8UOzV3l8C0Do9Mp63mrHlINA=
145141
github.com/openstack-k8s-operators/mariadb-operator/api v0.6.1-0.20251125174936-3989cc50de31 h1:pcxorrSN8YlCad3RgJWfMOdhlYtiT6ztYs+oTIYsxxc=

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)