-
Notifications
You must be signed in to change notification settings - Fork 51
Allow to deploy a list of cinder-backup services #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to deploy a list of cinder-backup services #575
Conversation
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/5ea7fa0f4d434279a80fd4e6cd36cbbf ❌ openstack-k8s-operators-content-provider FAILURE in 15m 04s |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/a38a3e318c41409680618133777e485d ❌ openstack-k8s-operators-content-provider FAILURE in 16m 12s |
e243cc8 to
509169b
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/33cc53b9ac1a4719a218f31c19de4790 ❌ openstack-k8s-operators-content-provider FAILURE in 16m 40s |
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>
|
/test cinder-operator-build-deploy-tempest |
|
/test cinder-operator-build-deploy-kuttl |
|
recheck |
1 similar comment
|
recheck |
|
Tested locally with Ceph:
Everything continue to work fine, and users can transition to the new interface by using
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. |
ratailor
left a comment
There was a problem hiding this 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.
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/203f4d9ea8b643a2b9826dc1345fdce1 Warning: |
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>
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/0604ef23b4ad46208a4a79144fc7925b ❌ openstack-k8s-operators-content-provider FAILURE in 14m 18s |
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>
|
recheck |
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>
|
This change depends on a change that failed to merge. Change openstack-k8s-operators/openstack-operator#1714 is needed. |
|
recheck |
|
We also have green results from the As a side note, in a follow up patch we will focus on providing documentation for the user to transition their @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.
[1] https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4833959b05de4f98b77f540924708af2 |
| // 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 | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8ff520446eee4e57aa8a538fa4cd8f88 Warning: |
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>
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/6c20dca5be2c4259aa373fcc4e419c9e Warning: |
|
recheck |
|
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. |
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>
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>
|
recheck |
|
@stuggi @abays : definitely not for today but I rebased this patch and re-enabled the 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 |
stuggi
left a comment
There was a problem hiding this 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/override ci/prow/precommit-check |
|
@stuggi: Overrode contexts on behalf of stuggi: ci/prow/precommit-check DetailsIn response to this:
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. |
f9d7fba
into
openstack-k8s-operators:main
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>
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>
This change introduces a new
APIparameter 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
cinderBackupAPIparameter is now deprecated, and it shouldn't be used anymore.Jira: https://issues.redhat.com/browse/OSPRH-22021