From 10b37b0bd5c7d58625e1bf40b3c279e3c2d69bde Mon Sep 17 00:00:00 2001 From: LiZhenCheng9527 Date: Wed, 24 Jan 2024 17:35:11 +0800 Subject: [PATCH] add attachedcluater e2e test Signed-off-by: LiZhenCheng9527 --- .github/workflows/e2e.yaml | 34 +++++++++ .../fleet-clusters/attachedcluster.sh | 76 +++++++++++++++++++ hack/e2e-test/fleet-clusters/e2e-run.sh | 8 ++ hack/e2e-test/install.sh | 25 ++++++ 4 files changed, 143 insertions(+) create mode 100644 .github/workflows/e2e.yaml create mode 100755 hack/e2e-test/fleet-clusters/attachedcluster.sh create mode 100755 hack/e2e-test/fleet-clusters/e2e-run.sh create mode 100755 hack/e2e-test/install.sh diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 000000000..5b4439bbb --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,34 @@ +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 + 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@1.27.3 + - 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 <