Skip to content

Revert "Adapt ToSystemAffinity calls to new Velero API signature (#20…#2115

Open
mpryc wants to merge 3 commits intooadp-1.6from
revert-2096-oadp-1.6
Open

Revert "Adapt ToSystemAffinity calls to new Velero API signature (#20…#2115
mpryc wants to merge 3 commits intooadp-1.6from
revert-2096-oadp-1.6

Conversation

@mpryc
Copy link
Contributor

@mpryc mpryc commented Mar 10, 2026

…96)"

This reverts commit 6b2eff5.

Why the changes were made

How to test the changes made

Summary by CodeRabbit

  • API Changes
    • Removed the deprecated caCertRef field from backup storage configuration schemas in DataProtectionApplication and DataProtectionTest custom resources.
    • Updated CA certificate field descriptions to remove deprecation notices and clarify usage for TLS connection verification.

@mpryc mpryc closed this Mar 10, 2026
@sseago sseago reopened this Mar 10, 2026
@sseago sseago changed the base branch from oadp-dev to oadp-1.6 March 10, 2026 13:40
sseago
sseago previously approved these changes Mar 10, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 625a3762-2c65-4de7-b3e9-5ff6709c464b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The changes remove the deprecated caCertRef field from DataProtectionApplication and DataProtectionTest CRD schemas while simplifying the caCert field description. Go module dependencies are updated with version adjustments across multiple packages. NodeAgent and Velero controller affinity construction logic is refactored to consolidate conversion steps.

Changes

Cohort / File(s) Summary
CRD Schema Updates
bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml, bundle/manifests/oadp.openshift.io_dataprotectiontests.yaml, config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml, config/crd/bases/oadp.openshift.io_dataprotectiontests.yaml
Removed caCertRef field from BackupStorageLocation and DataProtectionTest objectStorage schemas. Updated caCert field descriptions to remove deprecation notes and simplify language to "CACert defines a CA bundle to use when verifying TLS connections to the provider."
Go Module Dependencies
go.mod
Updated dependency versions across cloud.google.com/go/storage, Azure SDK modules (azcore, azidentity, azblob), AWS SDK v2 modules, and transitive dependencies (testify, google.golang.org/api, Kubernetes, protobuf, gRPC, OpenTelemetry, and others). No public API changes.
Controller Affinity Logic Refactoring
internal/controller/nodeagent.go, internal/controller/velero.go
Simplified NodeAgent and Velero reconciler affinity construction by consolidating per-item LoadAffinity conversion into a single slice conversion via kube.ToSystemAffinity, eliminating manual NodeSelectorTerms assembly and reducing intermediate variables.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely incomplete. While it identifies the reverted commit hash, both required template sections ('Why the changes were made' and 'How to test the changes made') contain only placeholder comments with no actual content. Fill in both required sections with substantive content: explain why the revert is necessary and provide clear testing instructions to verify the revert was successful.
Title check ❓ Inconclusive The title is incomplete and truncated, ending with '#20…' without providing full context. While it indicates a revert operation, the truncation makes it unclear and non-specific about what is being reverted. Complete the pull request title to clearly specify the full commit or PR number being reverted, e.g., 'Revert "Adapt ToSystemAffinity calls to new Velero API signature (#2096)"'.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed This pull request does not modify any test files (*_test.go). The seven files changed are manifest files (YAML), the go.mod dependency file, and implementation files (nodeagent.go and velero.go). Since no Ginkgo test names are being added or modified in this PR, the "Stable and Deterministic Test Names" check is not applicable.
Test Structure And Quality ✅ Passed The PR modifies only CRD YAML manifests, go.mod dependencies, and controller implementation files; no test files are included, making this check not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-2096-oadp-1.6

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
internal/controller/velero.go (1)

282-291: Please add regression coverage for loadAffinity edge cases.

This switches from manual term assembly to direct affinity assignment, so a small test matrix for nil, [], and multi-entry loadAffinity would help lock down the intended scheduling behavior here and in the mirrored NodeAgent path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/controller/velero.go` around lines 282 - 291, Add regression tests
exercising the new affinity assignment for Velero by covering the edge cases:
nil LoadAffinityConfig, empty slice, and multi-entry LoadAffinityConfig;
specifically write tests that construct a DPA with
dpa.Spec.Configuration.Velero.LoadAffinityConfig set to nil, [] and a slice with
multiple entries, call the code path that builds veleroAffinityStruct and
invokes kube.ToSystemAffinity, and assert
veleroDeployment.Spec.Template.Spec.Affinity is nil for nil/empty cases and
matches the expected combined affinity for multi-entry cases; also add the same
matrix of tests for the mirrored NodeAgent path to ensure parity (use test names
like TestVeleroLoadAffinity_Nil/Empty/Multi and
TestNodeAgentLoadAffinity_Nil/Empty/Multi and reference kube.LoadAffinity,
kube.ToSystemAffinity, veleroDeployment.Spec.Template.Spec.Affinity and the
NodeAgent affinity assembly code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml`:
- Around line 178-181: You removed the deprecated caCertRef field from the
served v1alpha1 CRD schema (leaving only caCert), which breaks compatibility;
restore caCertRef in the served OpenAPI schema for v1alpha1 (keep it marked
deprecated in the description and optional) so existing DPA manifests aren't
rejected or pruned, and ensure its type/format matches the prior definition
(e.g., string/reference) and validation remains permissive—add the caCertRef
property back alongside caCert in the schema for v1alpha1 (and do not remove it
until a documented migration path is provided).

In `@bundle/manifests/oadp.openshift.io_dataprotectiontests.yaml`:
- Around line 135-139: The served DataProtectionTest CRD currently removes the
deprecated field spec.backupLocationSpec.objectStorage.caCertRef (previously
represented as caCert in the schema), which breaks v1alpha1 manifests; restore
the deprecated caCert/caCertRef entry back into the served schema for
DataProtectionTest (and its v1alpha1 schema) and mark it as deprecated/nullable,
ensure its type/format matches the prior definition (string, format: byte) and
add a clear deprecation description; keep the conversion/migration behavior
unchanged (or wire into existing conversion logic in any conversion webhook) so
older manifests remain accepted until explicit removal is staged and documented.

In `@config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml`:
- Around line 178-181: The CRD change removed the deprecated field caCertRef
from the DataProtectionApplication schema which is a breaking change; restore
caCertRef into the served/stored v1alpha1 schema (alongside the new caCert) and
mark it as deprecated (include a deprecation description and/or
x-kubernetes-deprecation message) so existing manifests won’t be dropped during
apply/upgrade; ensure the field name caCertRef appears with the correct type
(string/objectRef form used previously), nullable if previously allowed, and
keep both caCert and caCertRef present until a documented migration/conversion
plan is implemented.

In `@config/crd/bases/oadp.openshift.io_dataprotectiontests.yaml`:
- Around line 135-139: The CRD removed the deprecated caCertRef which breaks
round-trip compatibility for DataProtectionTest in the v1alpha1 schema; restore
caCertRef as a deprecated field alongside caCert (keep its name caCertRef and
mark as deprecated) in the served/storage schema for DataProtectionTest so older
manifests retain their CA reference on update, and include the same
type/format/description semantics as the original deprecated field so it remains
readable by existing clients while preventing its use going forward.

---

Nitpick comments:
In `@internal/controller/velero.go`:
- Around line 282-291: Add regression tests exercising the new affinity
assignment for Velero by covering the edge cases: nil LoadAffinityConfig, empty
slice, and multi-entry LoadAffinityConfig; specifically write tests that
construct a DPA with dpa.Spec.Configuration.Velero.LoadAffinityConfig set to
nil, [] and a slice with multiple entries, call the code path that builds
veleroAffinityStruct and invokes kube.ToSystemAffinity, and assert
veleroDeployment.Spec.Template.Spec.Affinity is nil for nil/empty cases and
matches the expected combined affinity for multi-entry cases; also add the same
matrix of tests for the mirrored NodeAgent path to ensure parity (use test names
like TestVeleroLoadAffinity_Nil/Empty/Multi and
TestNodeAgentLoadAffinity_Nil/Empty/Multi and reference kube.LoadAffinity,
kube.ToSystemAffinity, veleroDeployment.Spec.Template.Spec.Affinity and the
NodeAgent affinity assembly code).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa927a6e-a96c-4892-a801-5aeea79021bb

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8a3f1 and 9fae5cc.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml
  • bundle/manifests/oadp.openshift.io_dataprotectiontests.yaml
  • config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml
  • config/crd/bases/oadp.openshift.io_dataprotectiontests.yaml
  • go.mod
  • internal/controller/nodeagent.go
  • internal/controller/velero.go

Comment on lines 178 to 181
caCert:
description: |-
CACert defines a CA bundle to use when verifying TLS connections to the provider.
Deprecated: Use CACertRef instead.
description: CACert defines a CA bundle to use when verifying TLS connections to the provider.
format: byte
type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This turns caCertRef removal into a served-API break.

The description tweak is fine, but this schema update also drops the deprecated caCertRef field from v1alpha1. Existing DPA manifests or stored objects that still send that key will start failing validation or get pruned on the next write, and I don't see a migration/compatibility path in this PR. Please keep the deprecated field in the served schema until consumers have a documented upgrade path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml` around
lines 178 - 181, You removed the deprecated caCertRef field from the served
v1alpha1 CRD schema (leaving only caCert), which breaks compatibility; restore
caCertRef in the served OpenAPI schema for v1alpha1 (keep it marked deprecated
in the description and optional) so existing DPA manifests aren't rejected or
pruned, and ensure its type/format matches the prior definition (e.g.,
string/reference) and validation remains permissive—add the caCertRef property
back alongside caCert in the schema for v1alpha1 (and do not remove it until a
documented migration path is provided).

Comment on lines 135 to 139
caCert:
description: |-
CACert defines a CA bundle to use when verifying TLS connections to the provider.
Deprecated: Use CACertRef instead.
description: CACert defines a CA bundle to use when verifying
TLS connections to the provider.
format: byte
type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This removes a deprecated field from the served DataProtectionTest API too early.

As shipped, this CRD no longer accepts spec.backupLocationSpec.objectStorage.caCertRef in v1alpha1. That breaks older DPT manifests with no visible conversion or migration story here. Please preserve the deprecated field in the served schema until the removal is explicitly staged and documented.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bundle/manifests/oadp.openshift.io_dataprotectiontests.yaml` around lines 135
- 139, The served DataProtectionTest CRD currently removes the deprecated field
spec.backupLocationSpec.objectStorage.caCertRef (previously represented as
caCert in the schema), which breaks v1alpha1 manifests; restore the deprecated
caCert/caCertRef entry back into the served schema for DataProtectionTest (and
its v1alpha1 schema) and mark it as deprecated/nullable, ensure its type/format
matches the prior definition (string, format: byte) and add a clear deprecation
description; keep the conversion/migration behavior unchanged (or wire into
existing conversion logic in any conversion webhook) so older manifests remain
accepted until explicit removal is staged and documented.

Comment on lines 178 to 181
caCert:
description: |-
CACert defines a CA bundle to use when verifying TLS connections to the provider.
Deprecated: Use CACertRef instead.
description: CACert defines a CA bundle to use when verifying TLS connections to the provider.
format: byte
type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Preserve caCertRef until you have a migration path.

This schema change also removes caCertRef from a served/stored v1alpha1 API. That is a breaking compatibility change for existing DataProtectionApplication manifests and live objects that still rely on the deprecated field: the next apply/update can silently drop it. Please keep caCertRef in the CRD as deprecated until there is a versioned migration/conversion plan, or document and test the upgrade explicitly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml` around
lines 178 - 181, The CRD change removed the deprecated field caCertRef from the
DataProtectionApplication schema which is a breaking change; restore caCertRef
into the served/stored v1alpha1 schema (alongside the new caCert) and mark it as
deprecated (include a deprecation description and/or x-kubernetes-deprecation
message) so existing manifests won’t be dropped during apply/upgrade; ensure the
field name caCertRef appears with the correct type (string/objectRef form used
previously), nullable if previously allowed, and keep both caCert and caCertRef
present until a documented migration/conversion plan is implemented.

Comment on lines 135 to 139
caCert:
description: |-
CACert defines a CA bundle to use when verifying TLS connections to the provider.
Deprecated: Use CACertRef instead.
description: CACert defines a CA bundle to use when verifying
TLS connections to the provider.
format: byte
type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Keep caCertRef deprecated instead of removing it from the v1alpha1 schema.

DataProtectionTest has the same compatibility problem: removing caCertRef from the served/storage schema makes older manifests non-round-trippable and can drop the configured CA reference on update. This should stay in the CRD until you ship a clear migration/versioning story.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/crd/bases/oadp.openshift.io_dataprotectiontests.yaml` around lines 135
- 139, The CRD removed the deprecated caCertRef which breaks round-trip
compatibility for DataProtectionTest in the v1alpha1 schema; restore caCertRef
as a deprecated field alongside caCert (keep its name caCertRef and mark as
deprecated) in the served/storage schema for DataProtectionTest so older
manifests retain their CA reference on update, and include the same
type/format/description semantics as the original deprecated field so it remains
readable by existing clients while preventing its use going forward.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
@mpryc
Copy link
Contributor Author

mpryc commented Mar 10, 2026

/ok-to-test

@mpryc
Copy link
Contributor Author

mpryc commented Mar 10, 2026

/retest

@mpryc
Copy link
Contributor Author

mpryc commented Mar 10, 2026

/test unit-test

@openshift-ci openshift-ci bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 10, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

@mpryc: No presubmit jobs available for openshift/oadp-operator@oadp-1.6

Details

In response to this:

/test unit-test

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-ci
Copy link

openshift-ci bot commented Mar 10, 2026

@mpryc: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/unit-test 9fae5cc link true /test unit-test

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mpryc

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

1 similar comment
@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mpryc

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

@mpryc
Copy link
Contributor Author

mpryc commented Mar 10, 2026

/test unit-test

@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

@mpryc: No presubmit jobs available for openshift/oadp-operator@oadp-1.6

Details

In response to this:

/test unit-test

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.

@mpryc
Copy link
Contributor Author

mpryc commented Mar 10, 2026

/test unit-test

@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

@mpryc: No presubmit jobs available for openshift/oadp-operator@oadp-1.6

Details

In response to this:

/test unit-test

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.

@kaovilai
Copy link
Member

/test all

@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

@kaovilai: No presubmit jobs available for openshift/oadp-operator@oadp-1.6

Details

In response to this:

/test all

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants