From d9b95ab6860197ef52bccc256f2e75a70cc61b67 Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Wed, 7 Feb 2024 10:56:47 +0530 Subject: [PATCH] Update gce configure.sh to use registry config_path Signed-off-by: Aditi Sharma --- contrib/gce/configure.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/gce/configure.sh b/contrib/gce/configure.sh index 0d6ae91c1ddf..d46f642b505c 100755 --- a/contrib/gce/configure.sh +++ b/contrib/gce/configure.sh @@ -190,6 +190,7 @@ rm -f "${CONTAINERD_HOME}/etc/crictl.yaml" # Generate containerd config config_path="${CONTAINERD_CONFIG_PATH:-"/etc/containerd/config.toml"}" +registry_config_path="${CONTAINERD_REGISTRY_CONFIG_PATH:-"/etc/containerd/certs.d"}" mkdir -p $(dirname ${config_path}) cni_bin_dir="${CONTAINERD_HOME}/opt/cni/bin" cni_template_path="${CONTAINERD_HOME}/opt/containerd/cluster/gce/cni.template" @@ -223,8 +224,8 @@ disabled_plugins = ["io.containerd.internal.v1.restart"] bin_dir = "${cni_bin_dir}" conf_dir = "/etc/cni/net.d" conf_template = "${cni_template_path}" -[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] - endpoint = ["https://mirror.gcr.io","https://registry-1.docker.io"] +[plugins."io.containerd.grpc.v1.cri".registry] + config_path = "${registry_config_path}" [plugins."io.containerd.grpc.v1.cri".containerd] default_runtime_name = "${CONTAINERD_DEFAULT_RUNTIME:-"runc"}" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] @@ -235,6 +236,17 @@ disabled_plugins = ["io.containerd.internal.v1.restart"] EOF chmod 644 "${config_path}" + +docker_registry_host_namespace="${registry_config_path}/docker.io/hosts.toml" +mkdir -p $(dirname ${docker_registry_host_namespace}) +cat > ${docker_registry_host_namespace} <