mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
ci: fix nightly due to outdated kind (#3676)
ci: update kind version Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ac5fbd9110
commit
bc9f270e96
@@ -170,7 +170,7 @@ jobs:
|
||||
|
||||
kind-setup:
|
||||
name: Prometheus setup
|
||||
runs-on: oracle-vm-8cpu-32gb-x86-64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-go@v6
|
||||
@@ -179,6 +179,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
make check-blackbox-prerequisites
|
||||
go mod download
|
||||
sudo apt-get update
|
||||
sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap
|
||||
@@ -194,6 +195,8 @@ jobs:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
- name: Free up disk space
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
sudo ./scripts/enable_userns.sh
|
||||
|
||||
@@ -34,6 +34,8 @@ ZUI_REPO_NAME := zui
|
||||
SWAGGER_VERSION := v1.16.2
|
||||
STACKER := $(TOOLSDIR)/bin/stacker
|
||||
STACKER_VERSION := v1.1.0-rc3
|
||||
KIND := $(TOOLSDIR)/bin/kind
|
||||
KIND_VERSION := v0.31.0
|
||||
BATS := $(TOOLSDIR)/bin/bats
|
||||
TESTDATA := $(TOP_LEVEL)/test/data
|
||||
OS ?= $(shell go env GOOS)
|
||||
@@ -518,7 +520,7 @@ $(BATS):
|
||||
rm -rf bats-core
|
||||
|
||||
.PHONY: check-blackbox-prerequisites
|
||||
check-blackbox-prerequisites: check-linux check-skopeo $(BATS) $(REGCLIENT) $(ORAS) $(HELM) $(CRICTL) $(NOTATION) $(COSIGN) $(STACKER)
|
||||
check-blackbox-prerequisites: check-linux check-skopeo $(BATS) $(REGCLIENT) $(ORAS) $(HELM) $(CRICTL) $(NOTATION) $(COSIGN) $(STACKER) $(KIND)
|
||||
which skopeo && skopeo --version; \
|
||||
which stacker && stacker --version; \
|
||||
which regctl && regctl version; \
|
||||
@@ -526,7 +528,8 @@ check-blackbox-prerequisites: check-linux check-skopeo $(BATS) $(REGCLIENT) $(OR
|
||||
which helm && helm version; \
|
||||
which crictl && crictl version; \
|
||||
which notation && notation version; \
|
||||
which cosign && cosign version;
|
||||
which cosign && cosign version; \
|
||||
which kind && kind version;
|
||||
|
||||
.PHONY: run-blackbox-tests
|
||||
run-blackbox-tests: $(BATS_TEST_FILE_PATH) check-blackbox-prerequisites binary binary-minimal cli bench
|
||||
@@ -598,6 +601,11 @@ $(COSIGN):
|
||||
curl -fsSL https://github.com/sigstore/cosign/releases/download/v$(COSIGN_VERSION)/cosign-$(OS)-$(ARCH) -o $@; \
|
||||
chmod +x $@
|
||||
|
||||
$(KIND): check-linux
|
||||
mkdir -p $(TOOLSDIR)/bin; \
|
||||
curl -fsSL curl -Lo ./kind https://kind.sigs.k8s.io/dl/$(KIND_VERSION)/kind-$(OS)-$(ARCH) -o $@; \
|
||||
chmod +x $@
|
||||
|
||||
# set ZUI_VERSION to empty string in order to clone zui locally and build default branch
|
||||
.PHONY: ui
|
||||
ui:
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -o errexit
|
||||
|
||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
KIND="${ROOT_DIR}"/hack/tools/bin/kind
|
||||
|
||||
# Reference: https://kind.sigs.k8s.io/docs/user/local-registry/
|
||||
|
||||
# set no_proxy if applicable
|
||||
@@ -21,12 +24,20 @@ fi
|
||||
|
||||
CLUSTER_NAME=kind
|
||||
## Delete the cluster if it already exist
|
||||
kind get clusters | grep ${CLUSTER_NAME} && kind delete cluster --name ${CLUSTER_NAME}
|
||||
"${KIND}" get clusters | grep ${CLUSTER_NAME} && "${KIND}" delete cluster --name ${CLUSTER_NAME}
|
||||
|
||||
# create a cluster with the local registry enabled in containerd
|
||||
cat <<EOF | kind create cluster --config=-
|
||||
cat <<EOF | "${KIND}" create cluster --config=-
|
||||
kind: Cluster
|
||||
apiVersion: kind.x-k8s.io/v1alpha4
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: KubeletConfiguration
|
||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
||||
cgroupDriver: systemd
|
||||
nodes:
|
||||
- role: control-plane
|
||||
image: kindest/node:v1.28.7
|
||||
containerdConfigPatches:
|
||||
- |-
|
||||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${reg_port}"]
|
||||
|
||||
Reference in New Issue
Block a user