Skip to content

[oadp-1.6] CNTRLPLANE-3167: support STS/IRSA credentials and standalone Velero - #297

Open
kaovilai wants to merge 5 commits into
openshift:oadp-1.6from
kaovilai:cherry-pick-247-oadp-1.6
Open

[oadp-1.6] CNTRLPLANE-3167: support STS/IRSA credentials and standalone Velero#297
kaovilai wants to merge 5 commits into
openshift:oadp-1.6from
kaovilai:cherry-pick-247-oadp-1.6

Conversation

@kaovilai

@kaovilai kaovilai commented Jul 21, 2026

Copy link
Copy Markdown
Member

Cherry-pick of #247 to oadp-1.6.

Original commits:

go.mod/go.sum/vendor conflicts resolved via go mod tidy + go mod vendor against the oadp-1.6 dependency baseline. go build ./... and go test ./pkg/... pass.

Note

Responses generated with Claude

jparrill and others added 5 commits July 20, 2026 20:18
…or etcd backup/restore

Add support for AWS STS/IRSA credential detection and pre-signing, and
handle standalone Velero deployments (no DPA) where the BSL has no
explicit credential reference.

- Add ParseAWSCredentialData to auto-detect credential type (static,
  bare ARN, INI with role_arn) and STSClient for AssumeRoleWithWebIdentity
  without AWS SDK dependency
- Detect OADP+DPA vs standalone Velero at plugin init via DPA CRD check
- Fall back to well-known cloud-credentials secret when BSL has no
  .spec.credential (ARO with WI, future ROSA without DPA)
- Preserve original secret key alongside "credentials" in copied secret
  so the HCPEtcdBackup controller can auto-detect credential type
- Refactor copyCredentialSecret to accept resolved SecretKeySelector

Ref: openshift/hypershift#8368

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
(cherry picked from commit e8b5f4a)
The HyperShift hcpetcdbackup controller sets the CR name as a label
value on the Job and Pod template. Kubernetes label values are capped
at 63 bytes (RFC 1123). Schedule-triggered backups produce names that
exceed this limit, causing Job creation to fail.

Truncate the backup name portion of the CR name so the total never
exceeds 63 bytes, and trim any trailing hyphens left by truncation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit a554423)
…tore

Adds Service SAS (account key) and User Delegation SAS (AAD) signing
for Azure Blob Storage snapshot URLs during OADP restore, matching the
existing S3 pre-signing capability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit eefaab8)
When using the etcdSnapshot backup method, the etcd StatefulSet was
being restored by Velero with a stale RESTORE_URL_ETCD environment
variable baked into its pod template from a previous backup/restore
cycle. The StatefulSet controller would create etcd pods with the wrong
snapshot URL before the HyperShift operator could reconcile the correct
URL from the HCP spec, causing etcd to restore data from the wrong
snapshot.

Skip restoring the etcd StatefulSet when etcdBackupMethod is
etcdSnapshot, matching the existing pattern for etcd Pods and PVCs.
The control plane operator creates the StatefulSet fresh with the
correct RESTORE_URL_ETCD derived from the RestoreSnapshotURL already
injected into the HCP spec by this plugin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0537002)
…rt to STS

- Add context.Context to STSClient.AssumeRoleWithWebIdentity for cancellation support
- Define STSAssumeRoler interface and inject into RestorePlugin for testability
- Centralize credential fallback logic into common.ResolveCredentialRef()
- Extract signSnapshotURL() dispatcher to eliminate duplicate s3/azblob dispatch
- Extract fetchBSLCredentials() to consolidate BSL+secret fetch pattern
- Add missing test for AAD token acquisition failure path
- Replace custom contains/searchSubstring with strings.Contains in sts_test.go

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
(cherry picked from commit 9eb63b5)
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 21, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 21, 2026

Copy link
Copy Markdown

@kaovilai: This pull request references CNTRLPLANE-3167 which is a valid jira issue.

Details

In response to this:

Cherry-pick of #247 to oadp-1.6.

Original commits:

go.mod/go.sum/vendor conflicts resolved via go mod tidy + go mod vendor against the oadp-1.6 dependency baseline. go build ./... and go test ./pkg/... pass.

[!Note]
Responses generated with Claude

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 Jul 21, 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: 388019c4-c2b3-44cf-b1f0-7b0fbef6c1a6

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.

@openshift-ci
openshift-ci Bot requested review from devguyio and muraee July 21, 2026 00:22
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai

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

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

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

@kaovilai: 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.

@kaovilai

Copy link
Copy Markdown
Member Author

/cc @mgencur

@openshift-ci
openshift-ci Bot requested a review from mgencur July 21, 2026 00:38
@kaovilai

Copy link
Copy Markdown
Member Author

/cc @jparrill

@openshift-ci
openshift-ci Bot requested a review from jparrill July 22, 2026 17:33
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants