0

I've been trying in vain to get all cloud run revisions not serving traffic so I can prune them. The docs don't seem to provide much help. Here's what I have:

 gcloud run revisions list 
  --region <region> 
  --service <service> 
  --filter="status.conditions.type['Active'].status:'True'" 
  --sort-by="~metadata.creationTimestamp" 

I haven't seen anything the yaml that indicates a revision is currently serving traffic that I can filter on in the cloud console except in the ui. What am I missing here?

smitty
  • 31
  • 3

1 Answers1

1

You can probably try:

gcloud run revisions list \
   --filter="status.conditions.type:Active AND status.conditions.status:'False'" \
   --format='value(metadata.name)'

Then specify the region

Or:

gcloud run revisions list \    
--region <region> \    
--service <service name> \    
--filter="status.conditions.type:Active AND status.conditions.status:'False'" \    
--format='value(metadata.name)'
James S
  • 1,181
  • 1
  • 7