Skip to content

restic optional env vars - only use if in secret#2033

Open
tesshuflower wants to merge 1 commit into
backube:mainfrom
tesshuflower:issue-2032-azure-workload-identity
Open

restic optional env vars - only use if in secret#2033
tesshuflower wants to merge 1 commit into
backube:mainfrom
tesshuflower:issue-2032-azure-workload-identity

Conversation

@tesshuflower

Copy link
Copy Markdown
Contributor

Describe what this PR does

Restic mover:

For optional env vars, rather than simply setting in the job/pod, with a mount that is optional, only set them if the var/key exists in the secret. We already have the secret loaded before reconciling the job.

Related issues:

Fixes: #2032

Prevents env vars such as AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_FEDERATED_TOKEN_FILE from overrwriting env vars that may already be present or injected into the pod when the user doesn't explicitly set them in the restic secret.

For optional env vars, rather than simply setting in the job/pod,
with a mount that is optional, only set them if the var/key exists
in the secret. We already have the secret loaded before reconciling
the job.

Fixes: backube#2032

Signed-off-by: Tesshu Flower <tflower@redhat.com>
@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tesshuflower

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

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.7%. Comparing base (2006e35) to head (a628a2d).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2033     +/-   ##
=======================================
- Coverage   68.8%   68.7%   -0.2%     
=======================================
  Files         58      58             
  Lines       6097    6056     -41     
=======================================
- Hits        4199    4164     -35     
+ Misses      1584    1581      -3     
+ Partials     314     311      -3     
Files with missing lines Coverage Δ
internal/controller/mover/restic/mover.go 79.6% <100.0%> (-2.2%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure Workload Identity no longer working

1 participant