Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -o nounset
set -o errexit
set -o pipefail

# shellcheck disable=SC1090
source "$LEASE_PROXY_CLIENT_SH"
install_lease_handle=''

function set-cluster-version-spec-update-service() {
local payload_version
local jsonpath_flag
Expand Down Expand Up @@ -234,6 +238,8 @@ function write_install_status() {
}

function prepare_next_steps() {
printf 'Releasing install lease (if any)\n'
lease__release --handle="$install_lease_handle" || true
write_install_status
set +e
echo "Tear down the backgroup process of copying kube config"
Expand Down Expand Up @@ -576,6 +582,22 @@ function get_arch() {
echo "${ARCH}"
}

function release_install_lease() {
lease__release --delay=20m --handle="$install_lease_handle"
printf 'Install lease released at %s\n' "$(date "+%F %X")"
}

function refresh_install_lease() {
if ! lease__install_lease_eligible; then
return 0
fi

lease__release --handle="$install_lease_handle"
install_lease_handle=$(lease__acquire --type="${CLUSTER_PROFILE_SET_NAME}--${CLUSTER_PROFILE_NAME}--install-quota-slice" --scope=step)
printf 'Install lease acquired at %s: %s\n' "$(date "+%F %X")" "$(lease__cat --handle="$install_lease_handle" --format=csv)"
release_install_lease &
}

trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM
trap 'prepare_next_steps' EXIT TERM INT

Expand Down Expand Up @@ -853,6 +875,7 @@ do
date "+%F %X" > "${SHARED_DIR}/CLUSTER_INSTALL_START_TIME"
fi

refresh_install_lease || true
copy_kubeconfig_minimal "${dir}" &
copy_kubeconfig_pid=$!
${INSTALLER_BINARY} --dir="${dir}" create cluster 2>&1 | grep --line-buffered -v 'password\|X-Auth-Token\|UserData:' &
Expand Down