GCP Cloud Run – 检索所有未提供流量的修订版本

huangapple go评论58阅读模式
英文:

GCP Cloud Run - Retrieve all revisions not serving traffic

问题

我一直在徒劳地尝试获取所有未提供流量的云运行修订版本,以便我可以对它们进行修剪。文档似乎并没有提供太多帮助。这是我拥有的内容:

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

我在yaml中没有看到任何指示修订版本目前正在提供流量的内容,以便我可以在云控制台中进行过滤,除非在UI中。我在这里漏掉了什么?

英文:

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?

答案1

得分: 1

你可以尝试:

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


然后指定`region`。

或者:

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

英文:

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)'

</details>



huangapple
  • 本文由 发表于 2023年6月6日 02:29:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76409115.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定