2021-11-29 08:07:17 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-03-11 18:38:32 +00:00
|
|
|
source .utils
|
|
|
|
|
2021-11-29 08:07:17 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
NAMESPACE="org-giantswarm"
|
|
|
|
|
|
|
|
print_usage() {
|
2022-03-11 18:38:32 +00:00
|
|
|
orange "gs-get-cluster - get a Giant Swarm managed workload cluster"
|
2021-11-29 08:07:17 +00:00
|
|
|
echo " "
|
2022-03-11 18:38:32 +00:00
|
|
|
underline "Usage:"
|
2021-11-29 08:07:17 +00:00
|
|
|
echo "gs-get-cluster [cluster-name]"
|
|
|
|
echo " "
|
|
|
|
echo " "
|
2022-03-11 18:38:32 +00:00
|
|
|
underline "Options:"
|
2021-11-29 08:07:17 +00:00
|
|
|
echo "-h, --help show this help text"
|
|
|
|
echo "-n, --namespace the namespace the cluster is in (default: org-giantswarm)"
|
|
|
|
}
|
|
|
|
|
|
|
|
while test $# -gt 0; do
|
|
|
|
case "$1" in
|
|
|
|
-n|--namespace)
|
|
|
|
shift
|
|
|
|
NAMESPACE=$1
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-h|--help)
|
|
|
|
print_usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
kubectl-gs get cluster --namespace $NAMESPACE $@ 2>/dev/null || kubectl get cl --namespace $NAMESPACE $@
|