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

Authentication required when pullinb public images from gcr when logged in to Google Cloud #9383

Open
anu-tiernan opened this issue Apr 10, 2024 · 0 comments

Comments

@anu-tiernan
Copy link

skaffold dev run via cloud code intellij errors out while fetching a public image from gcr.

Starting the Cloud Run development session...
C:\Users\...\AppData\Local\cloud-code\bin\versions\0db09442f37edef90b605bdb3dc0f6afe01295adf75a5158a6f66d7e22adf606\skaffold.exe dev --filename C:\Users\...\AppData\Local\Temp\cloud-code-temp-skaffold2434626383386069809.tmp --auto-build=false --auto-deploy=false --auto-sync=false --rpc-port 50051 --skip-tests=true --port-forward=true --kube-context cloud-run-dev-internal --minikube-profile cloud-run-dev-internal
Generating tags...
 - hello-world -> hello-world:latest
Checking cache...
 - hello-world: Error checking cache.
Cleaning up...
 - No resources found
getting hash for artifact "hello-world": getting dependencies for "hello-world": parsing ONBUILD instructions: retrieving image "gcr.io/distroless/static-debian12:nonroot": GET https://storage.googleapis.com/artifacts.distroless.appspot.com/containers/images/sha256:9104641e02422ad525655b288753cce29b993a41579494b20dbd1874830a9586?access_token=REDACTED: unexpected status code 401 Unauthorized: <?xml version='1.0' encoding='UTF-8'?><Error><Code>AuthenticationRequired</Code><Message>Authentication required.</Message></Error>

Failed to start Cloud Run dev session.

Note that docker pull gcr.io/distroless/static-debian12:nonroot works fine.

If I log out from Google Cloud in Cloud Code for IntelliJ it builds and runs fine.

Information

  • Skaffold version: v2.10.1
  • Operating system: Windows 11
  • Installed via: Cloud Code
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta9
kind: Config
metadata: {name: work}
build:
  artifacts:
  - image: hello-world
    context: hello-world
    docker: {dockerfile: Dockerfile}
  tagPolicy:
    sha256: {}
  local: {push: false}
manifests:
  rawYaml: ['C:\Users\...\AppData\Local\Temp\cloud-code-temp-k8s15405164151782371968.tmp']
deploy: {statusCheckDeadlineSeconds: 300}

Steps to reproduce the behavior

Create an IntelliJ project with a "Cloud Code: Cloud Run -> Run Locally" run configuration and selected Dockerfile with the following Dockerfile contents:

FROM gcr.io/distroless/static-debian12:nonroot

COPY hello-world /

CMD ["/hello-world"]

Ensure you are logged in to Google Cloud in the Cloud Code Plugin

Run the newly created run configuration and observe the error

Log out of Google Cloud in the Cloud Code Plugin

Run the configuration and observe it works fine

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

No branches or pull requests

1 participant