mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 17:52:12 +00:00
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
This commit is contained in:
committed by
Karl Gustav Roksund
parent
a851232100
commit
7eca29daee
@@ -26,9 +26,9 @@ trap cleanup EXIT
|
|||||||
pushd $tmpDir >& /dev/null
|
pushd $tmpDir >& /dev/null
|
||||||
|
|
||||||
opsys=windows
|
opsys=windows
|
||||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
if [[ "$OSTYPE" == linux* ]]; then
|
||||||
opsys=linux
|
opsys=linux
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == darwin* ]]; then
|
||||||
opsys=darwin
|
opsys=darwin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user