CircleCI-Public / gcp-cli-orb

Install and configure the Google Cloud CLI (gcloud)
https://circleci.com/orbs/registry/orb/circleci/gcp-cli
MIT License
9 stars 32 forks source link

Cannot use gcloud config initialized by the "initialize" orb command because config is root #3

Closed looztra closed 5 years ago

looztra commented 5 years ago

All the commands executed by the initialize orb command are run either by root or with sudo, hence, the gcloud auth commands (executed by the initialize orb command) generate a valid gcloud config for the root user, not for the user running in a container when a job relies on a docker container executor and not a "machine" executor.

Question : why did you choose to use sudo when user is not root? (that is the cas when the job is running inside a container)

Note : this issue is a follow up of this Twitter thread : https://twitter.com/drazisil/status/1097909301857927168?s=17

clakech commented 5 years ago

a workaround proposal from twitter is to copy the config from root dir to the current user dir

iynere commented 5 years ago

thank you @looztra , i think i've been running into this issue myself but wasn't sure what was going on... working on an orb that makes heavy use of this one, so i'll make sure to resolve this as i work on it.