我正在尝试运行示例命令:
gcloud artifacts repositories set-cleanup-policies my-repo --policy=policy.json
在文档中提到,但我得到以下输出:
ERROR: gcloud crashed (AttributeError): 'str' object has no attribute 'get'
If you would like to report this issue, please run the following command:
gcloud feedback
To check gcloud for common problems, please run the following command:
gcloud info --run-diagnostics
我正在使用最新版本的 CLI,因为我刚刚从这里下载了它。
提前致谢
您的policy.json必须采用以下格式。
[
{
"name": "delete-prerelease",
"action": {"type": "Delete"},
"condition": {
"tagState": "tagged",
"tagPrefixes": ["alpha", "v0"],
"olderThan": "30d"
}
}
]