From 7eca29daeee6b583f5394a45d8edfd41c15dbe6d Mon Sep 17 00:00:00 2001 From: Karl Gustav Date: Sat, 25 Jan 2020 20:43:37 +0100 Subject: [PATCH] Fix install_kustomize.sh so it works on alpine linux The install script fails and thinks that alpine linux is in windows. This is because `$OSTYPE` in alpine linux is linux-musl, not linux-gnu as this script assumes. I tested these changes with this script: ``` set -euo pipefail opsys="" function check { opsys=windows if [[ "$OSTYPE" == linux* ]]; then opsys=linux elif [[ "$OSTYPE" == darwin* ]]; then opsys=darwin fi } OSTYPE="linux-gnu" check test "$opsys" == "linux" || echo $OSTYPE test failed OSTYPE="linuxsomething" check test "$opsys" == "linux" || echo $OSTYPE test failed OSTYPE="darwinsomething" check test "$opsys" == "darwin" || echo $OSTYPE test failed OSTYPE="either" check test "$opsys" == "windows" || echo $OSTYPE test failed ``` ref: #2146 --- hack/install_kustomize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/install_kustomize.sh b/hack/install_kustomize.sh index e17a317fc..6e152d6dc 100755 --- a/hack/install_kustomize.sh +++ b/hack/install_kustomize.sh @@ -26,9 +26,9 @@ trap cleanup EXIT pushd $tmpDir >& /dev/null opsys=windows -if [[ "$OSTYPE" == "linux-gnu" ]]; then +if [[ "$OSTYPE" == linux* ]]; then opsys=linux -elif [[ "$OSTYPE" == "darwin"* ]]; then +elif [[ "$OSTYPE" == darwin* ]]; then opsys=darwin fi