From 91348eb00b295cb3d5985aadb40dd3a7c4efc7c0 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Thu, 19 Mar 2026 11:01:02 +0000 Subject: [PATCH] Rename cluster --- .gitea/workflows/e2e.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/e2e.yml b/.gitea/workflows/e2e.yml index 1846d0e..aa902d6 100644 --- a/.gitea/workflows/e2e.yml +++ b/.gitea/workflows/e2e.yml @@ -2,6 +2,8 @@ on: pull_request jobs: k8s-test: runs-on: ubuntu-latest + env: + CLUSTER_NAME: helm-actions-cluster steps: - uses: actions/checkout@v4 @@ -20,7 +22,7 @@ jobs: - name: Create kind cluster run: | - docker inspect test-cluster-control-plane && mkdir -p ~/.kube && kind get kubeconfig --name test-cluster > ~/.kube/config || kind create cluster --name test-cluster --wait 5m + docker inspect ${CLUSTER_NAME}-control-plane && mkdir -p ~/.kube && kind get kubeconfig --name ${CLUSTER_NAME} > ~/.kube/config || kind create cluster --name ${CLUSTER_NAME} --wait 5m - name: Connect kind to the job container's network and fix kubeconfig if: always() @@ -36,7 +38,7 @@ jobs: echo "Job container network: $NETWORK_NAME" # 2. Get the kind control-plane container name - KIND_CONTAINER="test-cluster-control-plane" + KIND_CONTAINER="${CLUSTER_NAME}-control-plane" echo "KIND_CONTAINER=$KIND_CONTAINER" >> $GITHUB_ENV @@ -51,12 +53,12 @@ jobs: # 5. Rewrite the kubeconfig to use the kind container's IP # kind's API server listens on port 6443 inside the container - kubectl config set-cluster kind-test-cluster \ + kubectl config set-cluster kind-${CLUSTER_NAME} \ --server="https://${KIND_IP}:6443" # 6. Since the TLS cert won't match the new IP, use insecure mode # OR set insecure-skip-tls-verify - kubectl config set-cluster kind-test-cluster \ + kubectl config set-cluster kind-${CLUSTER_NAME} \ --insecure-skip-tls-verify=true - name: Verify cluster access