mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-22 10:06:15 +00:00
Attempt to delete node-template before retry
I don't think we've seen this commonly, so I'm proposing a simplistic fix for now. Fixes #20878
This commit is contained in:
parent
699c80b752
commit
e85cf1bb97
@ -396,6 +396,11 @@ function create-node-template {
|
|||||||
echo -e "${color_yellow}Attempt ${attempt} failed to create instance template $template_name. Retrying.${color_norm}" >&2
|
echo -e "${color_yellow}Attempt ${attempt} failed to create instance template $template_name. Retrying.${color_norm}" >&2
|
||||||
attempt=$(($attempt+1))
|
attempt=$(($attempt+1))
|
||||||
sleep $(($attempt * 5))
|
sleep $(($attempt * 5))
|
||||||
|
|
||||||
|
# In case the previous attempt failed with something like a
|
||||||
|
# Backend Error and left the entry laying around, delete it
|
||||||
|
# before we try again.
|
||||||
|
gcloud compute instance-templates delete "$template_name" --project "${PROJECT}" &>/dev/null || true
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user