GoogleContainerTools / GoogleContainerTools/skaffold

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

Open
#9,383 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

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: AuthenticationRequiredAuthentication required.

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:

```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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.