mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Use ensure-temp-dir in the common.sh script
Instead of having an ensure-temp-dir function in multiple places, add it to the common.sh script which is sourced by all the providers.
This commit is contained in:
@@ -1030,18 +1030,6 @@ function verify-cmd-in-path {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Checks that KUBE_TEMP is set, or sets it
|
||||
# If it sets it, it also creates the temporary directory
|
||||
# and sets up a trap so that we delete it when we exit
|
||||
#
|
||||
function ensure-temp-dir {
|
||||
if [[ -z ${KUBE_TEMP-} ]]; then
|
||||
KUBE_TEMP=$(mktemp -d -t kubernetes.XXXXXX)
|
||||
trap-add "rm -rf '${KUBE_TEMP}'" EXIT
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Repeatedly try a command over ssh until it succeeds or until five minutes have passed
|
||||
# The timeout isn't exact, since we assume the command runs instantaneously, and
|
||||
|
Reference in New Issue
Block a user