Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cork: add --json-key to create and download #239

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Oct 4, 2021

In this PR, we add the --json-key flag to create and download subcommands from cork. It allows a user to pass a GCS credential file path to cork in order to download from a private GCS bucket.

update command use the flags from the creation flags set, so no need to update this part:

updateCmd.Flags().AddFlagSet(creationFlags)

Testing done

$ ./bin/cork create --verbose --sdk-url-path "/flatcar-jenkins/sdk"
2021-10-04T16:11:35Z cli: Started logging at level INFO
2021-10-04T16:11:35Z cork: Detecting SDK version
2021-10-04T16:11:36Z cork: Found SDK version 3005.0.0 from remote repo
2021-10-04T16:11:36Z cork: Downloading SDK version 3005.0.0
2021-10-04T16:11:36Z sdk: Downloading https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/3005.0.0/flatcar-sdk-amd64-3005.0.0.tar.bz2 to /home/mathieu/go/src/github.com/kinvolk/mantle/.cache/sdks/flatcar-sdk-amd64-3005.0.0.tar.bz2
2021-10-04T16:11:41Z cork: Download failed: 403 Forbidden: https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/3005.0.0/flatcar-sdk-amd64-3005.0.0.tar.bz2
$ ./bin/cork create --json-key=$HOME/.gce/release.json --verbose
2021-10-04T16:05:55Z cli: Started logging at level INFO
2021-10-04T16:05:55Z cork: Detecting SDK version
2021-10-04T16:05:56Z cork: Found SDK version 3005.0.0 from remote repo
2021-10-04T16:05:56Z cork: Downloading SDK version 3005.0.0
2021-10-04T16:05:56Z sdk: Downloading https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/3005.0.0/flatcar-sdk-amd64-3005.0.0.tar.bz2 to /home/mathieu/go/src/github.com/kinvolk/mantle/.cache/sdks/flatcar-sdk-amd64-3005.0.0.tar.bz2
2021-10-04T16:05:56Z sdk: Resuming from byte 21495808
^Catcar-sdk-amd64-3005.0.0.tar.bz2: [                          ] 36.1 MB/1.34 GB

@tormath1 tormath1 self-assigned this Oct 4, 2021
it allows user to pull SDK from a private GCS bucket location.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
this --json-key is empty by default. If a user passes a key, it will be
used to create a GCS client.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1 tormath1 force-pushed the tormath1/update-sdk-url branch from 599171e to b98af28 Compare October 4, 2021 16:14
@tormath1 tormath1 requested a review from a team October 4, 2021 16:14
@tormath1 tormath1 marked this pull request as ready for review October 4, 2021 16:14
@tormath1 tormath1 merged commit 92d6e04 into flatcar-master Oct 4, 2021
@tormath1 tormath1 deleted the tormath1/update-sdk-url branch October 4, 2021 16:26
tormath1 added a commit to flatcar/scripts that referenced this pull request Oct 5, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
tormath1 added a commit to flatcar/scripts that referenced this pull request Oct 6, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
tormath1 added a commit to flatcar/scripts that referenced this pull request Oct 7, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
dongsupark pushed a commit to flatcar/scripts that referenced this pull request Oct 13, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
dongsupark pushed a commit to flatcar/scripts that referenced this pull request Oct 13, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
dongsupark pushed a commit to flatcar/scripts that referenced this pull request Oct 13, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
dongsupark pushed a commit to flatcar/scripts that referenced this pull request Oct 13, 2021
it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants