Replace kind installation

Signed-off-by: leonharetd <610288372@qq.com>
This commit is contained in:
leonharetd 2021-12-22 13:44:37 +08:00
parent 00307f25c4
commit 5d6a5780f9
3 changed files with 5 additions and 24 deletions

View File

@ -51,6 +51,9 @@ ensures development quality.
please use it like this: `hack/undeploy-karmada.sh <KUBECONFIG> <CONTEXT_NAME>`, the same parameters as you input at
the installing step.
- [`delete-cluster.sh`](delete-cluster.sh) This script delete a kube cluster by kind,
please use it like this: `hack/delete-cluster.sh.sh <CLUSTER_NAME> <KUBECONFIG>`
## For CI pipeline
- [`local-up-karmada.sh`](local-up-karmada.sh) This script also used for testing.

View File

@ -65,7 +65,7 @@ if util::cmd_exist kind; then
echo "passed"
else
echo "not pass"
util::install_kind $kind_version
util::install_tools "sigs.k8s.io/kind" $kind_version
fi
# get arch name and os name in bootstrap
BS_ARCH=$(go env GOARCH)

View File

@ -25,7 +25,7 @@ MIN_Go_VERSION=go1.16.0
function util::install_tools() {
local package="$1"
local version="$2"
echo "go install ${package}@${version}"
GO111MODULE=on go install "${package}"@"${version}"
GOPATH=$(go env GOPATH | awk -F ':' '{print $1}')
export PATH=$PATH:$GOPATH/bin
@ -119,28 +119,6 @@ function util::install_kubectl {
fi
}
# util::install_kind will install the given version kind
function util::install_kind {
local kind_version=${1}
echo "Installing 'kind ${kind_version}' for you"
local os_name
os_name=$(go env GOOS)
local arch_name
arch_name=$(go env GOARCH)
curl --retry 5 -sSLo ./kind -w "%{http_code}" "https://kind.sigs.k8s.io/dl/${kind_version}/kind-${os_name:-linux}-${arch_name:-amd64}" | grep '200' > /dev/null
ret=$?
if [ ${ret} -eq 0 ]; then
chmod +x ./kind
mkdir -p ~/.local/bin/
mv ./kind ~/.local/bin/kind
export PATH=$PATH:~/.local/bin
else
echo "Failed to install kind, can not download the binary file at https://kind.sigs.k8s.io/dl/${kind_version}/kind-${os_name:-linux}-${arch_name:-amd64}"
exit 1
fi
}
# util::create_signing_certkey creates a CA, args are sudo, dest-dir, ca-id, purpose
function util::create_signing_certkey {
local sudo=$1