首页 > 解决方案 > 直接使用 source-repositories API 镜像 GitHub 存储库

问题描述

云控制台提供了一个用于从 GitHub 镜像存储库的界面。

当您使用此功能时,它会在可以从 API 读取的存储库上创建一个mirrorConfig 。然而,API 本身似乎没有提供写入此配置的方法。

尝试使用 mirrorConfig 创建存储库时的示例

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "repo.mirror_config",
            "description": "mirror_config is a read-only field and must not be set"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "*****"
      }
    ]
  }
}

有没有办法在 Google Cloud Platform 中以编程方式创建镜像源存储库?

标签: githubgoogle-cloud-platformgoogle-source-repositories

解决方案


不。

是答案:(

资料来源:George 上面的评论(谷歌云平台支持团队)


推荐阅读