diff --git a/bin/freeleaps-cluster-authenticator b/bin/freeleaps-cluster-authenticator index 92b2d873..1476238d 100755 --- a/bin/freeleaps-cluster-authenticator +++ b/bin/freeleaps-cluster-authenticator @@ -24,6 +24,7 @@ help() { echo "" echo "Sub Commands:" echo " auth,-a,--auth Setup kubectl for freeleaps cluster with Mathmast account." + echo " reset-auth,-r,--reset-auth Reset kubectl authentication state for freeleaps cluster." echo " clear,-c,--clear Clear authentication for freeleaps cluster." echo " doctor,-d,--doctor Check if all the required tools are installed." echo " help,-h,--help Show this help message." @@ -267,6 +268,12 @@ clear_auth() { echo "[CLEAR] kubectl authentication cleared successfully." } +reset_auth() { + echo "[RESET] Reset kubectl authentication state..." + rm -rf "${HOME}/.kube/oidc-login" + echo "[RESET] kubectl authentication state reset successfully." +} + main() { if [ $# -lt 1 ]; then echo "[ERROR] No sub-command provided." @@ -281,6 +288,9 @@ main() { auth|-a|--auth) auth ;; + reset-auth|-r|--reset-auth) + reset_auth + ;; clear|-c|--clear) clear_auth ;;