如何用gcloud命令查看Google Artifact Registry仓库的地域信息?
解决方法
问题出在你使用的format是gcloud格式化语法中的关键字,直接写会被解析成语法指令而非仓库的format字段,导致location字段被忽略。可以通过以下两种方式解决:
方式一:用双引号包裹冲突字段名
使用value格式时,给format字段加上双引号,明确指定这是仓库的属性字段:gcloud artifacts repositories list --format 'value(name,"format",location)'执行后会输出空格分隔的名称、格式、地域三个字段内容。
方式二:改用table格式输出
如果需要更清晰的列对齐展示,直接使用table格式,无需处理关键字冲突:gcloud artifacts repositories list --format 'table(name,format,location)'
内容的提问来源于stack exchange,提问作者Kossak
相关产品推荐
相关产品推荐

