Skip to content

Commit

Permalink
Added warning for setupkind script (istio#38181)
Browse files Browse the repository at this point in the history
* Added warning for setupkind script

setupkind script can only successfully setup kind
with metallb in Linux environment. This PR will warn
a user if this script gets run in an envrionment other
than Linux

Signed-off-by: Tong Li <[email protected]>

* setupkind script can only successfully setup kind
with metallb in Linux environment. This PR will warn
a user if this script gets run in an envrionment other
than Linux

Signed-off-by: Tong Li <[email protected]>
  • Loading branch information
litong01 authored Mar 31, 2022
1 parent 1559e0e commit 122b24d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/kind-lb/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

# Create a KinD cluster with an external load balancer

This bash script sets up a k8s cluster using kind and metallb.
This bash script sets up a k8s cluster using kind and metallb on Linux.

WARNING: when it runs in an environment other than Linux, it will only
produce an error message.

The following dependencies must be installed before running the script:
1. kubectl
Expand Down
7 changes: 7 additions & 0 deletions samples/kind-lb/setupkind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
#
set -e

# This script can only produce desired results on Linux systems.
ENVOS=$(uname 2>/dev/null || true)
if [[ "${ENVOS}" != "Linux" ]]; then
echo "Your environment is not supported by this script."
exit 1
fi

# Check prerequisites
REQUISITES=("kubectl" "kind" "docker")
for item in "${REQUISITES[@]}"; do
Expand Down

0 comments on commit 122b24d

Please sign in to comment.