mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 07:03:31 +00:00
hack/cluster: consolidate cluster/ utils to hack/lib/util.sh
Per Clayton's suggestion, move stuff from cluster/lib/util.sh to hack/lib/util.sh. Also consolidate ensure-temp-dir and use the hack/lib/util.sh implementation rather than cluster/common.sh.
This commit is contained in:
@@ -24,7 +24,7 @@ KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd)
|
||||
|
||||
DEFAULT_KUBECONFIG="${HOME}/.kube/config"
|
||||
|
||||
source "${KUBE_ROOT}/cluster/lib/util.sh"
|
||||
source "${KUBE_ROOT}/hack/lib/util.sh"
|
||||
source "${KUBE_ROOT}/cluster/lib/logging.sh"
|
||||
# KUBE_RELEASE_VERSION_REGEX matches things like "v1.2.3" or "v1.2.3-alpha.4"
|
||||
#
|
||||
@@ -308,17 +308,6 @@ function load-or-gen-kube-bearertoken() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Create a temp dir that'll be deleted at the end of this bash session.
|
||||
#
|
||||
# Vars set:
|
||||
# KUBE_TEMP
|
||||
function ensure-temp-dir {
|
||||
if [[ -z ${KUBE_TEMP-} ]]; then
|
||||
export KUBE_TEMP=$(mktemp -d -t kubernetes.XXXXXX)
|
||||
trap 'rm -rf "${KUBE_TEMP}"' EXIT
|
||||
fi
|
||||
}
|
||||
|
||||
# Get the master IP for the current-context in kubeconfig if one exists.
|
||||
#
|
||||
# Assumed vars:
|
||||
|
Reference in New Issue
Block a user