Skip to content

[oadp-1.6] OADP-6540: Skip restore of k8s RBAC system rolebindings#403

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift:oadp-1.6from
openshift-cherrypick-robot:cherry-pick-402-to-oadp-1.6
Jun 8, 2026
Merged

[oadp-1.6] OADP-6540: Skip restore of k8s RBAC system rolebindings#403
openshift-merge-bot[bot] merged 3 commits into
openshift:oadp-1.6from
openshift-cherrypick-robot:cherry-pick-402-to-oadp-1.6

Conversation

@openshift-cherrypick-robot

@openshift-cherrypick-robot openshift-cherrypick-robot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This is an automated cherry-pick of #402

Problem

When restoring with namespace mapping (e.g. ns-ans-b), pods in the target namespace fail with ErrImagePull because OpenShift auto-creates system:image-pullers with subjects pointing to the correct target namespace (system:serviceaccounts:ns-b), but Velero also restores the backed-up rbac.authorization.k8s.io/v1/RoleBinding which overwrites it with subjects still pointing to the source namespace (system:serviceaccounts:ns-a). Service accounts in ns-b then lack pull permissions.

PR #311 fixed this for authorization.openshift.io rolebindings, but not for rbac.authorization.k8s.io — both API groups are backed up because rolebindings is not in Velero's cohabitating resources dedup list.

Fix

Skip the same three system rolebindings (system:image-pullers, system:image-builders, system:deployers) for the rbac.authorization.k8s.io API group. OpenShift creates these automatically with correct subject namespace references when a project is created.

Verification

Tested with OADP 1.6.0 downstream build on OCP 5.0 (arm64):

  • FBC: quay.io/redhat-user-workloads/ocp-art-tenant/art-fbc:v5.0__operator_nvr__oadp-operator-container-1.6.0-202606041057.p2.g747216b.assembly.stream.el9
  • Plugin override: quay.io/tkaovila/openshift-velero-plugin:[OADP-6540](https://redhat.atlassian.net/browse/OADP-6540) via DPA unsupportedOverrides.openshiftPluginImageFqin

Both rbac.authorization.k8s.io and authorization.openshift.io system rolebindings now skipped. Subjects in target namespace correctly reference system:serviceaccounts:test-rb-target.

Cherry-picks to other branches:

Fixes: https://issues.redhat.com/browse/OADP-6540

/assign kaovilai

kaovilai and others added 2 commits June 8, 2026 17:20
PR openshift#311 added skip logic for system rolebindings (system:image-pullers,
system:image-builders, system:deployers) but only for the
authorization.openshift.io API group. OpenShift stores these as
rbac.authorization.k8s.io objects and exposes them via both API groups.
Velero backs up both variants since rolebindings are not in Velero's
cohabitating resources dedup list.

During restore with namespace mapping, the k8s RBAC variants were
restored with stale subject references (old namespace), overwriting
the correct auto-created rolebindings and causing ErrImagePull.

Add a new RestoreItemAction for rolebindings (rbac.authorization.k8s.io)
that skips the same system rolebindings, letting OpenShift create them
with correct namespace references.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@openshift-ci-robot

openshift-ci-robot commented Jun 8, 2026

Copy link
Copy Markdown

@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: OADP-6540

Details

In response to this:

This is an automated cherry-pick of #402

/assign kaovilai

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

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: Enterprise

Run ID: ab5b1bf7-14ee-4c0b-85dd-579e1f0fb16c

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 Jun 8, 2026
@kaovilai

kaovilai commented Jun 8, 2026

Copy link
Copy Markdown
Member

Verification

Fix verified with OADP 1.6.0 downstream build on OCP 5.0 (arm64):

  • FBC: quay.io/redhat-user-workloads/ocp-art-tenant/art-fbc:v5.0__operator_nvr__oadp-operator-container-1.6.0-202606041057.p2.g747216b.assembly.stream.el9
  • Plugin override: quay.io/tkaovila/openshift-velero-plugin:[OADP-6540](https://redhat.atlassian.net/browse/OADP-6540) via DPA unsupportedOverrides.openshiftPluginImageFqin

Both rbac.authorization.k8s.io and authorization.openshift.io system rolebindings now skipped during restore with namespace mapping. Subjects in target namespace correctly reference the new namespace.

Cherry-picks:

Note

Responses generated with Claude

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 8, 2026

Copy link
Copy Markdown

@openshift-cherrypick-robot: This pull request references OADP-6540 which is a valid jira issue.

Details

In response to this:

This is an automated cherry-pick of #402

Summary

  • Add K8sRestorePlugin for rolebindings (rbac.authorization.k8s.io) that skips system rolebindings (system:image-pullers, system:image-builders, system:deployers)
  • Fixes namespace mapping restore causing ErrImagePull due to stale subject references

Verification

Tested with OADP 1.6.0 downstream build on OCP 5.0 (arm64):

  • FBC: quay.io/redhat-user-workloads/ocp-art-tenant/art-fbc:v5.0__operator_nvr__oadp-operator-container-1.6.0-202606041057.p2.g747216b.assembly.stream.el9
  • Plugin override: quay.io/tkaovila/openshift-velero-plugin:[OADP-6540](https://redhat.atlassian.net/browse/OADP-6540) via DPA unsupportedOverrides.openshiftPluginImageFqin

Both rbac.authorization.k8s.io and authorization.openshift.io system rolebindings now skipped. Subjects in target namespace correctly reference test-rb-target.

Cherry-picks to other branches:

Fixes: https://issues.redhat.com/browse/OADP-6540

/assign kaovilai

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2026
TestGetRegistryEnvsForLocation was hitting real S3 to determine
bucket region, causing CI failures when no AWS credentials are
available. Mock GetBucketRegionFunc like s3_test.go and
registry_test.go already do.

Also fix wantErrString to match the full wrapped error from
GetRegistryEnvsForLocation.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai kaovilai force-pushed the cherry-pick-402-to-oadp-1.6 branch from 7bde02b to 89e04ef Compare June 8, 2026 18:06
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

@openshift-cherrypick-robot: all tests passed!

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.

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2026
@sseago

sseago commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, shubham-pampattiwar, sseago

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:
  • OWNERS [shubham-pampattiwar,sseago]

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

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 51c2cda into openshift:oadp-1.6 Jun 8, 2026
4 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants