0

I'm using the Cloud Code extension for VSCode and each time I'm deploying, the skaffold command executed is the following:

skaffold run --enable-rpc -v info --rpc-http-port 33291 --default-repo gcr.io/project-1`

while in my skaffold.yaml file I have the following configuration build.artifacts[].context.image: gcr.io/project-2/hello-world

Thus after the build step, the deployment continues with

The push refers to repository [gcr.io/project-1/gcr.io/project-2/hello-world]

Of course... this is not what I'm expecting.

Locally, my gcloud is using an account which has access to both project so that skaffold (docker) push works and my gcr.io/project-1 is populated accordingly.

But my Cloud Run service in project-2 is not granted rights to access gcr.io/project-1 and deployment (image pull) fails.

Please, do you know where to change that default skaffold command when running Cloud Deploy (and update the destination registry)?

Thanks

Gama11
  • 31,714
  • 9
  • 78
  • 100
Olivier
  • 1,982
  • 3
  • 23
  • 36
  • Did you generate your `skaffold.yaml` from the Cloud Code Extension? If not, ideally it shouldn't contain `gcr.io/project-2` prefix, because the exension adds it. – ahmet alp balkan May 02 '19 at 17:59
  • Consider accepting the answer or leave a comment if it doesn't solve your problem. – ahmet alp balkan May 08 '19 at 20:22
  • Well. I did for one of my apps. The other one was just the Go Hello world sample available directly in the Code Cloud Github repo. – Olivier May 09 '19 at 15:00

1 Answers1

3

You can change the registry Cloud Code vscode extension pushes to, go to settings:

and in the Extensions → Cloud Code section, change the image registry setting:

enter image description here

If you can't get it to work, try deleting your local .vscode directory and do a Cloud Code: Build again, that way it'll ask for your container registry URI again.

ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214