gcloud 崩溃(AttributeError):“str”对象没有属性“get”清理策略

问题描述 投票:0回答:1

我正在尝试运行示例命令:

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,因为我刚刚从这里下载了它。

提前致谢

python google-cloud-platform gcloud
1个回答
0
投票

您的policy.json必须采用以下格式。

[
  {
    "name": "delete-prerelease",
    "action": {"type": "Delete"},
    "condition": {
      "tagState": "tagged",
      "tagPrefixes": ["alpha", "v0"],
      "olderThan": "30d"
    }
  }
]
© www.soinside.com 2019 - 2024. All rights reserved.