fix(k8s): update prerequisite messages in freeleaps-cluster-authenticator for consistency

Signed-off-by: 孙振宇 <>
This commit is contained in:
孙振宇 2025-01-14 16:46:25 +08:00
parent 7df990ddac
commit 940c0cc318

View File

@ -89,13 +89,13 @@ ensure_kubelogin() {
gather_prerequisites() { gather_prerequisites() {
gather_os_environment gather_os_environment
echo "[PRE-PREREQUISITES] Checking for required tools..." echo "[PREREQUISITES] Checking for required tools..."
if ! command -v curl > /dev/null; then if ! command -v curl > /dev/null; then
echo "[ERROR] curl is required to download kubectl and kubelogin" echo "[ERROR] curl is required to download kubectl and kubelogin"
exit 1 exit 1
else else
echo "[PRE-PREREQUISITES] curl: ✓" echo "[PREREQUISITES] curl: ✓"
fi fi
@ -103,19 +103,19 @@ gather_prerequisites() {
echo "[ERROR] unzip is required to extract kubelogin" echo "[ERROR] unzip is required to extract kubelogin"
exit 1 exit 1
else else
echo "[PRE-PREREQUISITES] unzip: ✓" echo "[PREREQUISITES] unzip: ✓"
fi fi
if ! command -v uname > /dev/null; then if ! command -v uname > /dev/null; then
echo "[ERROR] uname is required to determine OS and architecture" echo "[ERROR] uname is required to determine OS and architecture"
exit 1 exit 1
else else
echo "[PRE-PREREQUISITES] uname: ✓" echo "[PREREQUISITES] uname: ✓"
fi fi
if ! command -v kubectl > /dev/null; then if ! command -v kubectl > /dev/null; then
if [ "${AUTO_INSTALL_KUBECTL}" = "true" ]; then if [ "${AUTO_INSTALL_KUBECTL}" = "true" ]; then
echo "[PRE-PREREQUISITES] kubectl: Installing..." echo "[PREREQUISITES] kubectl: Installing..."
ensure_kubectl ensure_kubectl
else else
echo "[ERROR] kubectl is required to authenticate with the cluster" echo "[ERROR] kubectl is required to authenticate with the cluster"
@ -123,12 +123,12 @@ gather_prerequisites() {
fi fi
else else
echo "[PRE-PREREQUISITES] kubectl: ✓" echo "[PREREQUISITES] kubectl: ✓"
fi fi
if ! command -v kubelogin > /dev/null; then if ! command -v kubelogin > /dev/null; then
if [ "${AUTO_INSTALL_KUBECTL}" = "true" ]; then if [ "${AUTO_INSTALL_KUBECTL}" = "true" ]; then
echo "[PRE-PREREQUISITES] kubelogin: Installing..." echo "[PREREQUISITES] kubelogin: Installing..."
ensure_kubelogin ensure_kubelogin
else else
echo "[ERROR] kubelogin is required to authenticate with the cluster" echo "[ERROR] kubelogin is required to authenticate with the cluster"
@ -136,7 +136,7 @@ gather_prerequisites() {
fi fi
else else
echo "[PRE-PREREQUISITES] kubelogin: ✓" echo "[PREREQUISITES] kubelogin: ✓"
fi fi
} }