0
votes

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

1
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
Consider accepting the answer or leave a comment if it doesn't solve your problem.Ahmet Alp Balkan
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

1 Answers

2
votes

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.