diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 000000000..71acca7dc --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,37 @@ +name: E2E +on: + pull_request: +jobs: + e2e-test: + runs-on: ubuntu-22.04 + name: E2E Test + timeout-minutes: 40 + steps: + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: 1.20.x + - name: Checkout code + uses: actions/checkout@v4 + - name: Build Clusters + uses: helm/kind-action@v1.8.0 + with: + version: v0.18.0 + install_only: true + - name: Set Up Clusters + run: | + hack/local-dev-setup.sh + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.1 + - name: Install Kubectl + uses: actions-hub/kubectl@v1.27.3 + env: + KUBE_CONFIG: "${{ cat $HOME/.kube/config | base64 }}"" + - name: Init kurator cluster + run: | + hack/e2e-test/install.sh + - name: fleet-clusters e2e test + run: | + hack/e2e-test/fleet-clusters/e2e-run.sh diff --git a/hack/e2e-test/fleet-clusters/attachedcluster.sh b/hack/e2e-test/fleet-clusters/attachedcluster.sh new file mode 100755 index 000000000..4dcd69160 --- /dev/null +++ b/hack/e2e-test/fleet-clusters/attachedcluster.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +KUBECONFIG_PATH=${KUBECONFIG_PATH:-"${HOME}/.kube"} +MAIN_KUBECONFIG=${MAIN_KUBECONFIG:-"${KUBECONFIG_PATH}/kurator-host.config"} +export KUBECONFIG=${MAIN_KUBECONFIG} + +kubectl create secret generic kurator-member1 --from-file=kurator-member1.config=${KUBECONFIG_PATH}/kurator-member1.config +kubectl create secret generic kurator-member2 --from-file=kurator-member2.config=${KUBECONFIG_PATH}/kurator-member2.config + +cat <