Skip to content

Conversation

@fmount
Copy link
Contributor

@fmount fmount commented Nov 17, 2025

This change introduces a new API parameter to allow deploying a list of backup services, following the same pattern of cinder-volume deployment.
Each backup service can now be configured with its own dedicated backend config. The existing cinderBackup API parameter is now deprecated, and it shouldn't be used anymore.

Jira: https://issues.redhat.com/browse/OSPRH-22021

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/5ea7fa0f4d434279a80fd4e6cd36cbbf

openstack-k8s-operators-content-provider FAILURE in 15m 04s
⚠️ cinder-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)
⚠️ cinder-operator-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/a38a3e318c41409680618133777e485d

openstack-k8s-operators-content-provider FAILURE in 16m 12s
⚠️ cinder-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)
⚠️ cinder-operator-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)

@fmount fmount force-pushed the cback_listd branch 2 times, most recently from e243cc8 to 509169b Compare November 29, 2025 14:03
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/33cc53b9ac1a4719a218f31c19de4790

openstack-k8s-operators-content-provider FAILURE in 16m 40s
⚠️ cinder-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)
⚠️ cinder-operator-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)

fmount added a commit to fmount/openstack-operator that referenced this pull request Nov 30, 2025
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>
@fmount
Copy link
Contributor Author

fmount commented Dec 1, 2025

/test cinder-operator-build-deploy-tempest

@fmount
Copy link
Contributor Author

fmount commented Dec 1, 2025

/test cinder-operator-build-deploy-kuttl

@fmount
Copy link
Contributor Author

fmount commented Dec 1, 2025

recheck

1 similar comment
@fmount
Copy link
Contributor Author

fmount commented Dec 1, 2025

recheck

@fmount
Copy link
Contributor Author

fmount commented Dec 1, 2025

Tested locally with Ceph:

  1. If cinderBackup is enabled via the old interface, a warning is raised on both create or update:
Warning: The 'cinderBackup' field is deprecated and will be removed in a future release. Please migrate to 'cinderBackups'.
openstackcontrolplane.core.openstack.org/openstack-galera created

Everything continue to work fine, and users can transition to the new interface by using cinderBackups with the same pattern adopted for cinder-volume.

  1. If cinderBackups is used, webhooks will prevent users to deploy this service using the old interface.
# openstackcontrolplanes.core.openstack.org "openstack-galera" was not valid:
# * spec.cinder.template: Invalid value: "cinderBackup": Usage of the deprecated 'cinderBackup' is forbidden when the new 'cinderBackups' API is used.

This means that if the new interface is used to deploy either an existing cinderBackup or a new instance, the human operator must transition into the new model.

Old deployments (brownfield, for minor updates scenarios) work as the old interface is not removed and the operator is still able to manage them.

@fmount fmount requested a review from abays December 1, 2025 17:45
Copy link
Contributor

@ratailor ratailor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits, otherwise lgtm.

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/203f4d9ea8b643a2b9826dc1345fdce1

Warning:
Dependency cycle detected and project openstack-k8s-operators/openstack-operator doesn't allow circular dependencies

fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 2, 2025
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>
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/0604ef23b4ad46208a4a79144fc7925b

openstack-k8s-operators-content-provider FAILURE in 14m 18s
⚠️ cinder-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)
⚠️ cinder-operator-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)

fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 2, 2025
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>
@fmount
Copy link
Contributor Author

fmount commented Dec 2, 2025

recheck

fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 2, 2025
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>
@softwarefactory-project-zuul
Copy link

This change depends on a change that failed to merge.

Change openstack-k8s-operators/openstack-operator#1714 is needed.

@fmount
Copy link
Contributor Author

fmount commented Dec 2, 2025

recheck

@fmount
Copy link
Contributor Author

fmount commented Dec 3, 2025

We also have green results from the openstack-operator patch where the new API is integrated [1][2].
In addition to my previous comment, which I'm quoting here, I locally tested a minor update scenario to make sure the new operators (openstack-operator, cinder-operator) do not break any existing deployment.

As a side note, in a follow up patch we will focus on providing documentation for the user to transition their cinder-backup instance to the new interface, but I'd like to have the feature in first, and then working on minor (focused) refinements that will serve for documentation and general enhancement purposes.

@stuggi @abays @ratailor are you ok with this patch or do we have any concern from a deployment perspective?

Let's wait to get some feedback from the storage folks also.

Tested locally with Ceph:

1. If cinderBackup is enabled via the old interface, a warning is raised on both create or update:
Warning: The 'cinderBackup' field is deprecated and will be removed in a future release. Please migrate to 'cinderBackups'.
openstackcontrolplane.core.openstack.org/openstack-galera created

Everything continue to work fine, and users can transition to the new interface by using cinderBackups with the same pattern adopted for cinder-volume.

2. If `cinderBackups` is used, webhooks will prevent users to deploy this service using the old interface.
# openstackcontrolplanes.core.openstack.org "openstack-galera" was not valid:
# * spec.cinder.template: Invalid value: "cinderBackup": Usage of the deprecated 'cinderBackup' is forbidden when the new 'cinderBackups' API is used.

This means that if the new interface is used to deploy either an existing cinderBackup or a new instance, the human operator must transition into the new model.

Old deployments (brownfield, for minor updates scenarios) work as the old interface is not removed and the operator is still able to manage them.

[1] https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4833959b05de4f98b77f540924708af2
[2] openstack-k8s-operators/openstack-operator#1714

@fmount fmount requested review from ASBishop and eharney December 3, 2025 16:07
Comment on lines +465 to +510
// TODO: Remove this function when refactoring CinderSpec to include CinderSpecCore
func (spec *CinderSpec) ValidateCinderBackup(basePath *field.Path) ([]string, field.ErrorList) {
var allErrs field.ErrorList
var allWarns []string

// Check if the deprecated field is configured
isDeprecatedUsed := spec.CinderBackup.Replicas != nil && *spec.CinderBackup.Replicas > 0
// Check if CinderBackup list is configured
isCinderBackupListUsed := spec.CinderBackups != nil && len(*spec.CinderBackups) > 0

// Fail if both cinderBackup (the deprecated field) and cinderBackups (the new list)
// are used together
if isDeprecatedUsed && isCinderBackupListUsed {
errMsg := "Usage of the deprecated 'cinderBackup' is forbidden when 'cinderBackups' is defined."
allErrs = append(allErrs, field.Invalid(basePath, "cinderBackup", errMsg))
}
// Append a warning depending on the cinderBackup field usage
if isDeprecatedUsed {
warningMsg := "The 'cinderBackup' field is deprecated and will be removed in a future release. Please migrate to 'cinderBackups'."
allWarns = append(allWarns, warningMsg)
}
return allWarns, allErrs
}

func (spec *CinderSpecCore) ValidateCinderBackup(basePath *field.Path)([]string, field.ErrorList) {
var allErrs field.ErrorList
var allWarns []string

// Check if the deprecated field is configured
isDeprecatedUsed := spec.CinderBackup.Replicas != nil && *spec.CinderBackup.Replicas > 0
// Check if CinderBackup list is configured
isCinderBackupListUsed := spec.CinderBackups != nil && len(*spec.CinderBackups) > 0

// Fail if both cinderBackup (the deprecated field) and cinderBackups (the new list)
// are used together
if isDeprecatedUsed && isCinderBackupListUsed {
errMsg := "Usage of the deprecated 'cinderBackup' is forbidden when the new 'cinderBackups' API is used."
allErrs = append(allErrs, field.Invalid(basePath, "cinderBackup", errMsg))
}
// Append a warning depending on the cinderBackup field usage
if isDeprecatedUsed {
warningMsg := "The 'cinderBackup' field is deprecated and will be removed in a future release. Please migrate to 'cinderBackups'."
allWarns = append(allWarns, warningMsg)
}
return allWarns, allErrs
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this isn't DRY, seems fine for now if we're going to soon refactor the API and clean this up anyhow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, it is planned as a follow up (I don't remember the exact Jira ticket), so the duplication is to temporarily satisfy the interface dependencies and to test it with local webhooks based on CinderSpec.

This change introduces a new API parameter to allow deploying a list of backup
services, following the same pattern as cinder-volume deployment.
Each backup service can now be configured with its own dedicated backend config.
The existing "cinderBackup" API parameter is now deprecated, and it
shouldn't be used anymore.

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8ff520446eee4e57aa8a538fa4cd8f88

Warning:
Dependency cycle detected and project openstack-k8s-operators/openstack-operator doesn't allow circular dependencies

This patch ensures both cbak interfaces are not used. It adds
deprecation warning at webhooks level as well as it forbids
users to deploy cbak using both the provided APIs.
EnvTest are added to verify that the validation is called and
returns the expected error.

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/6c20dca5be2c4259aa373fcc4e419c9e

Warning:
Dependency cycle detected and project openstack-k8s-operators/openstack-operator doesn't allow circular dependencies

@fmount
Copy link
Contributor Author

fmount commented Dec 12, 2025

recheck

@softwarefactory-project-zuul
Copy link

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/openstack-k8s-operators/openstack-operator for 1714,5631e8f3e2fe6b1591541b2bc7ae7b1cf41bcb5b

fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 12, 2025
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>
fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 12, 2025
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>
@fmount
Copy link
Contributor Author

fmount commented Dec 12, 2025

recheck

@fmount
Copy link
Contributor Author

fmount commented Dec 12, 2025

@stuggi @abays : definitely not for today but I rebased this patch and re-enabled the crc-schema related check.
We did additional validation on a bundle based on [1] that includes both this patch and the openstack-operator one, and I'd like to land this change Monday after we do a rebase on the usual weekly bump.

Both the test and the configuration for this new feature can be found in [2], and I would land this next week to move the focus on [3] and conclude this series.

[1] quay.io/fpantano/openstack-operator-index:v0.5.1
[2] https://issues.redhat.com/browse/OSPRH-23020
[3] openstack-k8s-operators/openstack-operator#1714

Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

} else {
// Clean up cinder-backup if there are no replicas
err = r.backupCleanupDeployment(ctx, instance)
err = r.backupCleanupDeployment(ctx, instance, crName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this PR, iiuc we delete the deployment if you set 0 replicas for the component, right? is there a reason why we do this, instead of leaving it with 0 replicas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason behind this is usually related to the fact that we want to clean up at some point the service list within the cinder database, but I think that requires a follow up like I did in manila [1] to have a proper cleanup when the entry is entirely deleted from the CR.

[1] openstack-k8s-operators/manila-operator#337

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, but I guess that should only happen when e.g. the cinder-volume definition was deleted, not just when you scale it down to 0, right?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmount, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@stuggi
Copy link
Contributor

stuggi commented Dec 15, 2025

/override ci/prow/precommit-check

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 15, 2025

@stuggi: Overrode contexts on behalf of stuggi: ci/prow/precommit-check

Details

In response to this:

/override ci/prow/precommit-check

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit f9d7fba into openstack-k8s-operators:main Dec 15, 2025
6 checks passed
fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 15, 2025
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>
fmount added a commit to fmount/openstack-operator that referenced this pull request Dec 15, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants