Skip to content

Commit

Permalink
chore: kind setup script, check for kubectl
Browse files Browse the repository at this point in the history
And if not found install it.
  • Loading branch information
jan--f committed Jul 8, 2022
1 parent b04358a commit b9bd550
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion hack/kind/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,23 @@ setup_cluster() {
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
}

install_kubectl() {
if ! command -v kubectl &> /dev/null
then
info "kubectl not found, attempting to install"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
export PATH="$(pwd):$PATH"
fi

}

main() {
## NOTE: all paths are relative to the root of the project
cd "$PROJECT_ROOT_DIR"
mkdir -p tmp/logs $(dirname $KUBECONFIG)
mkdir -p tmp/logs "$(dirname $KUBECONFIG)"

install_kubectl
setup_cluster
label_infra_node
setup_olm
Expand Down

0 comments on commit b9bd550

Please sign in to comment.