Skip to content

Commit

Permalink
Use actions to install kwokctl
Browse files Browse the repository at this point in the history
Signed-off-by: Shiming Zhang <[email protected]>
  • Loading branch information
wzshiming committed Nov 21, 2023
1 parent 630cf19 commit c24d238
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ jobs:
with:
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
fetch-depth: 0

- name: Set up kwokctl
uses: kubernetes-sigs/kwok@main
with:
command: kwokctl
kwok-version: v0.4.0

- name: Run e2e test
run: ./test/test.sh

Expand Down
14 changes: 4 additions & 10 deletions test/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@ function host_docker_internal() {

TMPDIR="${TMPDIR:-/tmp/}"

# Install kwokctl tools
function install_kwokctl() {
if cmd_exist kwokctl; then
return 0
fi
wget "https://github.com/kubernetes-sigs/kwok/releases/download/v0.4.0/kwokctl-$(go env GOOS)-$(go env GOARCH)" -O "/usr/local/bin/kwokctl" &&
chmod +x "/usr/local/bin/kwokctl"
}

# create a control plane cluster and install the Clusterpedia
function create_control_plane() {
local name="${1}"
Expand All @@ -139,7 +130,10 @@ function create_data_plane() {
local kubeconfig
local ip

install_kwokctl
if ! cmd_exist kwokctl; then
echo "Please install kwokctl first, see https://kwok.sigs.k8s.io/docs/user/installation/"
return 1
fi

ip="$(host_docker_internal)"
kwokctl create cluster --name "${name}" --wait 120s --kubeconfig "" --config - <<EOF
Expand Down

0 comments on commit c24d238

Please sign in to comment.