Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into morgo-fix-docker-…
Browse files Browse the repository at this point in the history
…bootstrap

Signed-off-by: Morgan Tocker <[email protected]>
  • Loading branch information
morgo committed Mar 31, 2020
2 parents 6ad0713 + 69afb4e commit f4a28ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ function install_k3s() {

case $(uname) in
Linux) local platform=linux;;
*) echo "ERROR: unsupported platform. K3s only supports running on Linux"; exit 1;;
*) echo "WARNING: unsupported platform. K3s only supports running on Linux, the k8s topology will not be available for local examples."; return;;
esac

case $(get_arch) in
aarch64) local target="-arm64";;
x86_64) local target="";;
*) echo "ERROR: unsupported architecture"; exit 1;;
*) echo "WARNING: unsupported architecture, the k8s topology will not be available for local examples."; return;;
esac

download_url=https://github.com/rancher/k3s/releases/download
Expand All @@ -192,7 +192,6 @@ function install_k3s() {
}
command -v k3s || install_dep "k3s" "v1.0.0" "$VTROOT/dist/k3s" install_k3s


# Download and install consul, link consul binary into our root.
function install_consul() {
local version="$1"
Expand Down Expand Up @@ -224,6 +223,11 @@ function install_chromedriver() {
local version="$1"
local dist="$2"

case $(uname) in
Linux) local platform=linux;;
*) echo "Platform not supported for vtctl-web tests. Skipping chromedriver install."; return;;
esac

if [ "$(arch)" == "aarch64" ] ; then
os=$(cat /etc/*release | grep "^ID=" | cut -d '=' -f 2)
case $os in
Expand All @@ -244,6 +248,7 @@ function install_chromedriver() {
rm chromedriver_linux64.zip
fi
}

if [ "$BUILD_CHROME" == 1 ] ; then
install_dep "chromedriver" "73.0.3683.20" "$VTROOT/dist/chromedriver" install_chromedriver
fi
Expand Down
11 changes: 11 additions & 0 deletions examples/local/scripts/k3s-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ script_root=$(dirname "${BASH_SOURCE[0]}")
# shellcheck disable=SC1091
source ./env.sh

case $(uname) in
Linux) ;;
*) echo "WARNING: unsupported platform. K3s only supports running on Linux, the k8s topology is available for local examples."; exit 1;;
esac

case $(uname -m) in
aarch64) ;;
x86_64) ;;
*) echo "ERROR: unsupported architecture, the k8s topology is not available for local examples."; exit 1;;
esac

k3s server --disable-agent --data-dir "${VTDATAROOT}/k3s/" --https-listen-port "${K8S_PORT}" --write-kubeconfig "${K8S_KUBECONFIG}" > "${VTDATAROOT}"/tmp/k3s.out 2>&1 &
PID=$!
echo $PID > "${VTDATAROOT}/tmp/k3s.pid"
Expand Down

0 comments on commit f4a28ab

Please sign in to comment.