如果更改项目名称,对Google Container Registry有什么风险?

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

我配置了CI / CD管道,如果使用特定标签进行了标记,则Google Cloud Build会根据推送到GitHub存储库的代码自动构建容器。容器会自动保存到Google Container Registry中。注册表中的每个容器都以us.gcr.io/project_name/container_name:tag_name

形式标记。

我的问题是,如果我更改了项目名称,这将如何影响我已经用当前项目名称标记的当前位于Google Container Registry中的容器?在更新项目名称本身之前,是否需要使用预期的项目名称更改每个容器上的标签?这是由GCP自动处理的吗?

github google-cloud-platform google-cloud-build google-container-registry
1个回答
0
投票

Registries in Container Registry are named by the host and project ID。要处理图像(例如,推,拉,删除),请使用以下格式标识图像:

[[主机名] / [项目ID] / [图像]:[TAG]

或[主机名] / [项目ID] / [图像] @ [图像_DIGEST]

即使您更改了项目名称,也无法更改项目ID,因为Project ID: a unique identifier for your project, composed of the project name and a randomly assigned number。因此,您的图像在Container Registry中具有相同的注册表。 us.gcr.io/project_id/container_name:tag_name

© www.soinside.com 2019 - 2024. All rights reserved.