mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
Remove several red herring error messages in GCE cluster scripts
This commit is contained in:
@@ -147,15 +147,15 @@ function clear-kubeconfig() {
|
||||
fi
|
||||
|
||||
local kubectl="${KUBE_ROOT}/cluster/kubectl.sh"
|
||||
"${kubectl}" config unset "clusters.${CONTEXT}"
|
||||
"${kubectl}" config unset "users.${CONTEXT}"
|
||||
"${kubectl}" config unset "users.${CONTEXT}-basic-auth"
|
||||
"${kubectl}" config unset "contexts.${CONTEXT}"
|
||||
|
||||
# Unset the current-context before we delete it, as otherwise kubectl errors.
|
||||
local cc=$("${kubectl}" config view -o jsonpath='{.current-context}')
|
||||
if [[ "${cc}" == "${CONTEXT}" ]]; then
|
||||
"${kubectl}" config unset current-context
|
||||
fi
|
||||
"${kubectl}" config unset "clusters.${CONTEXT}"
|
||||
"${kubectl}" config unset "users.${CONTEXT}"
|
||||
"${kubectl}" config unset "users.${CONTEXT}-basic-auth"
|
||||
"${kubectl}" config unset "contexts.${CONTEXT}"
|
||||
|
||||
echo "Cleared config for ${CONTEXT} from ${KUBECONFIG}"
|
||||
}
|
||||
|
Reference in New Issue
Block a user