From 051f8ddfc1907cf04dc6ccbc129d00d1b7513c82 Mon Sep 17 00:00:00 2001 From: Enrico Candino Date: Mon, 15 Jun 2026 15:02:47 +0200 Subject: [PATCH] removed hcp-test from Tests --- .github/workflows/test.yaml | 265 ------------------------------------ 1 file changed, 265 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b9a288b9..23d9d5f4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,273 +12,8 @@ permissions: env: KUBERNETES_VERSION: v1.35.3 - HELM_VERSION: v4.1.3 - HELM_CHECKSUM_AMD64: 02ce9722d541238f81459938b84cf47df2fdf1187493b4bfb2346754d82a4700 jobs: - hcp-test: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - fetch-tags: true - - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 - with: - go-version-file: go.mod - - - name: Install helm - env: - FILENAME: helm.tar.gz - run: | - curl -sSfL -o ${{ env.FILENAME }} https://get.helm.sh/helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz - echo "${{ env.HELM_CHECKSUM_AMD64 }} ${{ env.FILENAME }}" | sha256sum --check - tar -xvzf ${{ env.FILENAME }} linux-amd64/helm - sudo install -m 755 linux-amd64/helm /usr/local/bin/helm - - rm -fr "${{ env.FILENAME }}" linux-amd64/helm - - - name: Install k3s - env: - K3S_HOST_VERSION: ${{ env.KUBERNETES_VERSION }}+k3s1 - run: | - curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${K3S_HOST_VERSION} INSTALL_K3S_EXEC="--write-kubeconfig-mode=777" sh -s - - - export KUBECONFIG=/etc/rancher/k3s/k3s.yaml - echo "KUBECONFIG=${KUBECONFIG}" >> $GITHUB_ENV - - kubectl cluster-info - kubectl get nodes - - - name: Setup K3k (from source) - run: | - export REPO=ttl.sh/$(uuidgen) - export VERSION=1h - - make build - make package - make push - make install - - # add k3kcli to $PATH - echo "${{ github.workspace }}/bin" >> $GITHUB_PATH - - - name: Wait for K3k controller - run: | - echo "Wait for K3k controller deployment to be available" - kubectl wait -n k3k-system deployment -l "app.kubernetes.io/name=k3k" --for=condition=Available --timeout=5m - - - name: Check k3kcli - run: k3kcli -v - - - name: Create virtual cluster - run: | - kubectl create namespace k3k-mycluster - - cat < user-data - #cloud-config - users: - - name: ubuntu - ssh_authorized_keys: - - $(cat ./id_rsa.pub) - sudo: ['ALL=(ALL) NOPASSWD:ALL'] - shell: /bin/bash - EOF - - # Bake the configuration into a reusable metadata ISO - cloud-localds seed.img user-data - - # 4. Provision independent overlay disks for Worker - - name: Create Worker Disks - run: | - qemu-img create -f qcow2 -b resolute-server-cloudimg-amd64.img -F qcow2 worker-1.qcow2 20G - - # 5. Boot both VMs headlessly in the background with unique MACs and forwarded SSH ports - - name: Launch Worker VM - run: | - # Launch Worker 1 (SSH forwarded to Host Port 2222) - sudo qemu-system-x86_64 \ - -m 2048 -smp 2 -cpu host -enable-kvm -nographic \ - -drive file=worker-1.qcow2,if=virtio \ - -drive file=seed.img,format=raw,if=virtio \ - -net nic,model=virtio,macaddr=52:54:00:12:34:56 \ - -net user,hostfwd=tcp::2222-:22 \ - & - - # 6. Block the script until both VMs are completely booted and listening on SSH - - name: Wait for SSH Availability - run: | - echo "Waiting for Worker (Port 2222) to respond..." - timeout 120s bash -c ' - until ssh -i ./id_rsa -p 2222 -o StrictHostKeyChecking=no -o ConnectTimeout=2 ubuntu@127.0.0.1 true 2>/dev/null; do sleep 3; done - ' - - echo "VM is completely up and accessible!" - - - - name: Join Worker to K3k Control Plane - run: | - K3S_TOKEN=$(kubectl get secret -n k3k-mycluster k3k-mycluster-token -o jsonpath='{.data.token}' | base64 -d) - - echo "Testing connectivity from VM to K3k API server..." - ssh -i ./id_rsa -p 2222 -o StrictHostKeyChecking=no ubuntu@127.0.0.1 \ - "curl -kv --max-time 10 https://10.0.2.2:30001/readyz || echo 'VM connectivity test failed'" - - echo "Registering Worker..." - set +e # Don't exit on error, we want to collect logs - ssh -i ./id_rsa -p 2222 -o StrictHostKeyChecking=no ubuntu@127.0.0.1 bash -s </dev/null | grep -c "Ready") -eq 1 ]; do - echo "Waiting for both worker nodes to show Ready..." - kubectl get nodes || true - sleep 5 - done - ' - - - name: Collect logs - if: always() - run: | - journalctl -u k3s -o cat --no-pager > /tmp/k3s.log - kubectl logs -n k3k-system -l "app.kubernetes.io/name=k3k" --tail=-1 > /tmp/k3k.log - - - name: Archive K3s logs - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - if: always() - with: - name: k3s-hcp-logs - path: /tmp/k3s.log - - - name: Archive K3k logs - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - if: always() - with: - name: k3k-hcp-logs - path: /tmp/k3k.log - tests: runs-on: ubuntu-latest