mirror of
https://gitea.com/gitea/helm-actions.git
synced 2026-04-05 01:00:48 +00:00
.gitea/workflows/e2e.yml aktualisiert
This commit is contained in:
@ -18,16 +18,9 @@ jobs:
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
install kubectl /usr/local/bin/
|
||||
|
||||
- name: Cleanup any previous kind cluster (best-effort)
|
||||
if: always()
|
||||
run: |
|
||||
kind delete cluster --name test-cluster || true
|
||||
docker ps -a --filter "name=test-cluster" -q | xargs -r docker rm -f || true
|
||||
docker network ls --filter "name=kind" -q | xargs -r docker network rm || true
|
||||
|
||||
- name: Create kind cluster
|
||||
run: |
|
||||
kind create cluster --name test-cluster
|
||||
kind create cluster --name test-cluster-2
|
||||
|
||||
- name: Attach kind control-plane to job network and wait
|
||||
run: |
|
||||
@ -37,15 +30,15 @@ jobs:
|
||||
NETWORK_NAME="$(docker inspect "$JOB_CONTAINER_ID" --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}{{end}}')"
|
||||
echo "Job network: $NETWORK_NAME"
|
||||
|
||||
CONTROL_PLANE="test-cluster-control-plane"
|
||||
CONTROL_PLANE="test-cluster-2-control-plane"
|
||||
docker network connect "$NETWORK_NAME" "$CONTROL_PLANE" || true
|
||||
|
||||
KIND_IP="$(docker inspect "$CONTROL_PLANE" --format "{{(index .NetworkSettings.Networks \"$NETWORK_NAME\").IPAddress}}")"
|
||||
echo "Kind IP: $KIND_IP"
|
||||
|
||||
# Point kubectl at the control-plane directly
|
||||
kubectl config set-cluster kind-test-cluster --server="https://${KIND_IP}:6443"
|
||||
kubectl config set-cluster kind-test-cluster --insecure-skip-tls-verify=true
|
||||
kubectl config set-cluster kind-test-cluster-2 --server="https://${KIND_IP}:6443"
|
||||
kubectl config set-cluster kind-test-cluster-2 --insecure-skip-tls-verify=true
|
||||
|
||||
# Wait for API and nodes
|
||||
for i in $(seq 1 120); do
|
||||
@ -63,9 +56,3 @@ jobs:
|
||||
kubectl get nodes
|
||||
kubectl get pods -A
|
||||
|
||||
- name: Cleanup kind cluster (best-effort)
|
||||
if: always()
|
||||
run: |
|
||||
kind delete cluster --name test-cluster || true
|
||||
docker ps -a --filter "name=test-cluster" -q | xargs -r docker rm -f || true
|
||||
docker network ls --filter "name=kind" -q | xargs -r docker network rm || true
|
||||
|
||||
Reference in New Issue
Block a user