Allow passing in GOOGLE_APPLICATION_CREDENTIALS
Describe what this PR does restic expects GAC to hold the path to a json file w/ the actual credentials, but we didn't have a method to actually mount the json file into the container. This change makes it possible to supply the json file in the restic Secret under the GAC key name. VolSync then takes the value and mounts that in the container and sets up an appropriate env var to point to it.
Is there anything that requires special attention? The usage of the GAC env var is not what is contained in the restic docs (a filename), instead, it's the actual file's contents.
Related issues: Fixes #349
Codecov Report
Merging #407 (275fab9) into main (1b3e11e) will increase coverage by
0.1%. The diff coverage is100.0%.
Additional details and impacted files
@@ Coverage Diff @@
## main #407 +/- ##
=======================================
+ Coverage 64.2% 64.4% +0.1%
=======================================
Files 45 45
Lines 5242 5266 +24
=======================================
+ Hits 3370 3394 +24
Misses 1671 1671
Partials 201 201
| Impacted Files | Coverage Δ | |
|---|---|---|
| controllers/mover/restic/mover.go | 75.3% <100.0%> (+1.5%) |
:arrow_up: |
/retest
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
2.1% Duplication
/retest
/cherrypick release-0.5
@JohnStrunk: once the present PR merges, I will cherry-pick it on top of release-0.5 in a new PR and assign it to you.
In response to this:
/cherrypick release-0.5
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/test-infra repository.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: JohnStrunk, tesshuflower
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [JohnStrunk,tesshuflower]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest
/test e2e-openshift-helm
@JohnStrunk: #407 failed to apply on top of branch "release-0.5":
Applying: restic: Update docs for GOOGLE_APPLICATION_CREDENTIALS
Applying: restic: Mount GOOGLE_APPLICATION_CREDENTIALS as a file
Using index info to reconstruct a base tree...
M controllers/mover/restic/mover.go
M controllers/mover/restic/restic_test.go
Falling back to patching base and 3-way merge...
Auto-merging controllers/mover/restic/restic_test.go
CONFLICT (content): Merge conflict in controllers/mover/restic/restic_test.go
Auto-merging controllers/mover/restic/mover.go
CONFLICT (content): Merge conflict in controllers/mover/restic/mover.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 restic: Mount GOOGLE_APPLICATION_CREDENTIALS as a file
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to this:
/cherrypick release-0.5
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/test-infra repository.