[b/r] Add OpenStackBackupConfig controller and backup/restore labeling#1868
[b/r] Add OpenStackBackupConfig controller and backup/restore labeling#1868stuggi wants to merge 2 commits intoopenstack-k8s-operators:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
OpenStackControlPlane CRD Size Report
Threshold reference
|
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/dd57c92b72a04ef0929c08fe0728effe ❌ openstack-k8s-operators-content-provider FAILURE in 9m 19s |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/fe53444e267b46bfab002d52d844e719 ❌ openstack-k8s-operators-content-provider FAILURE in 7m 42s |
2e3227a to
ddaf0cb
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/b224d61474934085ac7a999c8bb3f7a1 ❌ openstack-k8s-operators-content-provider FAILURE in 8m 02s |
dccad21 to
3c0c72e
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/baec74827fef49899c7ef7d9c71c34a7 ❌ openstack-k8s-operators-content-provider FAILURE in 7m 42s |
3c0c72e to
378a2cb
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/d108ae22d2ac4105b454c6997c44c2ad ❌ openstack-k8s-operators-content-provider FAILURE in 7m 49s |
|
/retest |
378a2cb to
a0ec96e
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ed602d0559ba42829787fa1571d0dbc3 ❌ openstack-k8s-operators-content-provider FAILURE in 7m 55s |
a0ec96e to
d101e85
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/c733c0866b64471cb1201d4ae9f38243 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 20m 31s |
747ffba to
7ae2e1f
Compare
| // Note: watches for CRD instance types are only registered at setup time, | ||
| // so CR instance changes won't trigger reconciliation in this case. |
There was a problem hiding this comment.
And we don't need to watch for CRD changes during runtime, because new CRDs would only be added during an update, in which case a new OpenStack operator is created (which re-inits the cache). Is that true?
There was a problem hiding this comment.
yes correct. with an update we get a new openstack-op image which has the new CRDs and the operator/controllers get restarted with the new version
Add the BackupConfig CRD, API types, controller, RBAC, samples, and envtests for the backup/restore labeling feature. The controller watches CRD instances across operators and labels resources (secrets, configmaps, NADs) with backup.openstack.org labels for backup/restore integration. Supports annotation overrides on individual resources to customize restore ordering or exclude from backup. Custom Issuer labeling is handled by the ControlPlane controller in ca.go, not by the BackupConfig controller. Jira: OSPRH-22912 Jira: OSPRH-22913 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
7ae2e1f to
d0ed142
Compare
Wire the BackupConfig reconciliation into the ControlPlane controller with proper condition handling (OpenStackControlPlaneBackupConfigReady). Add backup/restore labels to CA cert secrets via SecretTemplate, and restore=false labels to internal service cert requests. Add the ReconcileBackupConfig call, secret watch with annotation change predicate, and RBAC for openstackbackupconfigs. Set BackupConfig spec defaults in the CreateOrPatch mutate function. Label custom Issuers for backup/restore in addIssuerLabelAnnotation after removeIssuerLabel so the MatchingLabels query only uses CA selector labels. Remove getCertSecretBackupLabels wrapper, call backup.GetCertSecretBackupLabels directly. Return error from GetCertSecretBackupLabels for non-NotFound errors. Rename GetConfig parameter from gvk to crdName. Jira: OSPRH-22912 Jira: OSPRH-22913 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
d0ed142 to
4aa477c
Compare
| # Target namespace to watch for resources | ||
| targetNamespace: openstack |
There was a problem hiding this comment.
| # Target namespace to watch for resources | |
| targetNamespace: openstack |
There was a problem hiding this comment.
It seems this field doesn't exist. I'm guessing you just use the metadata.Namespace instead.
There was a problem hiding this comment.
Is there only supposed to be one OpenStackBackupConfig per namespace? If so, should we add a validation webhook to block creating one if one already exists? Also if so, maybe in the case that the user creates the OpenStackBackupConfig first, the OpenStackControlPlane webhook should block creating an OpenStackControlPlane that doesn't have the same name as OpenStackBackupConfig (and I guess we would need to take OpenStackVersion into consideration too, since its name also has to be the same)?
Commit 1: [b/r] Add OpenStackBackupConfig controller
Introduces the backup.openstack.org/v1beta1 API group with the OpenStackBackupConfig CRD. The controller:
Commit 2: [b/r] Add backup/restore labels to ControlPlane controller
Integrates backup/restore into the existing ControlPlane reconciliation:
Jira: OSPRH-22912
Jira: OSPRH-22913
Jira: OSPRH-26645
Depends-On: openstack-k8s-operators/lib-common#680
Depends-On: openstack-k8s-operators/lib-common#684
Depends-On: openstack-k8s-operators/lib-common#685