From 6e55a712e68700f2730b50115e0fa3157c65b8ba Mon Sep 17 00:00:00 2001 From: WenyXu Date: Thu, 16 May 2024 18:22:06 +0000 Subject: [PATCH] chore: use kind --- .github/scripts/kind-with-registry.sh | 64 +++++++++++++++++++++++++++ .github/workflows/develop.yml | 13 +++--- 2 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 .github/scripts/kind-with-registry.sh diff --git a/.github/scripts/kind-with-registry.sh b/.github/scripts/kind-with-registry.sh new file mode 100644 index 000000000000..b481272e537f --- /dev/null +++ b/.github/scripts/kind-with-registry.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +set -o errexit + +# 1. Create registry container unless it already exists +reg_name='kind-registry' +reg_port='5001' +if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then + docker run \ + -d --restart=always -p "127.0.0.1:${reg_port}:5000" --network bridge --name "${reg_name}" \ + registry:2 +fi + +# 2. Create kind cluster with containerd registry config dir enabled +# TODO: kind will eventually enable this by default and this patch will +# be unnecessary. +# +# See: +# https://github.com/kubernetes-sigs/kind/issues/2875 +# https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration +# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md +cat <