volsync icon indicating copy to clipboard operation
volsync copied to clipboard

Allow passing in GOOGLE_APPLICATION_CREDENTIALS

Open JohnStrunk opened this issue 3 years ago • 3 comments

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

JohnStrunk avatar Aug 31 '22 19:08 JohnStrunk

Codecov Report

Merging #407 (275fab9) into main (1b3e11e) will increase coverage by 0.1%. The diff coverage is 100.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:

codecov[bot] avatar Sep 01 '22 14:09 codecov[bot]

/retest

JohnStrunk avatar Sep 07 '22 17:09 JohnStrunk

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.1% 2.1% Duplication

sonarqubecloud[bot] avatar Sep 21 '22 13:09 sonarqubecloud[bot]

/retest

JohnStrunk avatar Sep 21 '22 16:09 JohnStrunk

/cherrypick release-0.5

JohnStrunk avatar Oct 04 '22 18:10 JohnStrunk

@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

Needs approval from an approver in each of these files:
  • ~~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

openshift-ci[bot] avatar Oct 04 '22 19:10 openshift-ci[bot]

/retest

tesshuflower avatar Oct 04 '22 20:10 tesshuflower

/test e2e-openshift-helm

tesshuflower avatar Oct 05 '22 12:10 tesshuflower

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