Skip to content

Commit

Permalink
Bump kwokctl
Browse files Browse the repository at this point in the history
Signed-off-by: Shiming Zhang <[email protected]>
  • Loading branch information
wzshiming committed Sep 20, 2023
1 parent b0eee8f commit a03fc13
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,19 @@ function install_kwokctl() {
if cmd_exist kwokctl; then
return 0
fi
wget "https://github.com/kubernetes-sigs/kwok/releases/download/v0.1.0/kwokctl-$(go env GOOS)-$(go env GOARCH)" -O "/usr/local/bin/kwokctl" &&
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"
}

CONTROL_PLANE_NAME=""

# create a control plane cluster and install the Clusterpedia
function create_control_plane() {
local name="${1}"
local version="${2}"
create_cluster "${name}" "${version}"
install_clusterpedia
CONTROL_PLANE_NAME="${name}"
}

# delete the control plane cluster
Expand All @@ -141,7 +144,7 @@ function create_data_plane() {

install_kwokctl

KWOK_KUBE_VERSION="${version}" kwokctl create cluster --name "${name}" --quiet-pull
KWOK_KUBE_VERSION="${version}" kwokctl create cluster --name "${name}" --quiet-pull --wait 120s
ip="$(host_docker_internal)"
kubeconfig="$(kwokctl get kubeconfig --name="${name}" | sed "s#/127.0.0.1:#/${ip}:#" || :)"
if [[ "${kubeconfig}" == "" ]]; then
Expand All @@ -166,8 +169,7 @@ metadata:
type: kwok-controller
name: fake-node
EOF
pedia_cluster="$(build_pedia_cluster "${name}" "${kubeconfig}")"
echo "${pedia_cluster}" | kubectl apply -f -
build_pedia_cluster "${name}" "${kubeconfig}" | kwokctl --name "${CONTROL_PLANE_NAME}" kubectl apply -f -
}

# delete the worker fake cluster
Expand Down

0 comments on commit a03fc13

Please sign in to comment.