#!/bin/sh
# Usage:
# $ kubectl context set "my-context"
# set -x # verbose
set -o pipefail # exit on pipeline error
set -e # exit on error
set -u # variable must exist
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
NAME="${1}"
kubectl config use-context "${NAME}"