Search code examples
google-cloud-platformtagsgcloudgoogle-cloud-runrevision

Cloud Run remove revision tag through CLI


Is there a way to remove a tag(through CLI) that I've set on a cloud run revision when doing a deployment? I can see how to do it through the UI, but I need to include this in my deployment pipeline so it should be through the CLI Delete tag through UI

My use case is the following:

  • deploy a new version of my service with --no-traffic flag and --tag option in order to make the version accessible
  • run test suite on the newly deployed version
  • update traffic to point to the new version
  • remove the tag from the old/new version

The reason I want to remove those is that all versions that contain tag are kept accessible which is a problem for me since I'm also using the min-instances option.

Edit: I was using incorrectly labels instead of tags here.


Solution

  • The --remove-tags can be used with the update-traffic command. Since every tag can be assigned only to a single run revision this is the correct way to remove a tag from a revision.

    ** Always using the same tag for deployment preview/testing also works in the above use case since using the same tag on the latest revision effectively removes this tag from older revisions.