ilooner
ilooner

Reputation: 2560

How do you filter by image tags with the gcloud utility?

I am using gcloud to list all the tags for an image. The image can have multiple tags so I am filtering with the following command.

gcloud container images list-tags us.gcr.io/myproj/myrepp/myimage --filter="tags[0]=abc"

This correctly returns a record, however, it only works if abc is the first tag for the image. How can I return a record if abc could be any of the tags, not just the first for the image?

Upvotes: 2

Views: 2654

Answers (1)

John Hanley
John Hanley

Reputation: 81396

Change your filter to be: --filter="tags[]=abc"

This allows for any tag that matches abc. Your command was limiting this to tags[0] (the first tag).

Upvotes: 5

Related Questions