Skip to content

Commit

Permalink
added more "colorization"
Browse files Browse the repository at this point in the history
  • Loading branch information
fragolinux committed Nov 7, 2021
1 parent c2ffc63 commit 3933146
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/kube-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ prepare_and_check_k8s_context_generic() {
local context_name="${1:-"${RESOURCE_GROUP}-cluster"}"
local cluster_description

log "Searching for accessibility of k8s context $(b "${context_name}")"
log "Searching for accessibility of k8s context $(green "$(b "${context_name}")")"
if has_context "${context_name}"; then
log "k8s context $(b "${context_name}") is accessible, switching to it"
log "k8s context $(green "$(b "${context_name}")") is accessible, switching to it"
kubectx "${context_name}" >/dev/null 2>&1
else
whine "k8s context $(b "${context_name}") is not accessible, check your env"
fi
cluster_description="context: $(b "$(kubectx -c)")"
cluster_description="$(green "context: $(b "$(kubectx -c)")")"
log "Switched to k8s ${cluster_description}"

log "Checking Kubernetes accessibility - ${cluster_description}"
if kubectl version >/dev/null 2>&1 ; then
log "Found valid Kubernetes accessibility - ${cluster_description}"
log "Server version: $(b "$(get_kube_server_version)")"
log "Server version: $(green "$(b "$(get_kube_server_version)")")"
else
whine "Couldn't access Kubernetes right now, please fix it"
fi
Expand Down

0 comments on commit 3933146

Please sign in to comment.