-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixreboot #1521
Fixreboot #1521
Conversation
if [ -f /kind/old-ip ]; then | ||
old_ip=$(cat /kind/old-ip) | ||
sed -i "s#${old_ip}#${curr_ip}#" /etc/kubernetes/manifests/*.yaml /var/lib/kubelet/kubeadm-flags.env | ||
curr_ipv4="$( (getent ahostsv4 $(hostname) | head -n1 | cut -d' ' -f1) || true)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to put it in an array but is too brittle, this option has more boilerplate code but is more resilient ... the order of the returned address may change depending on the node configuration, or someone can enable ipv6 addresses later on, who knows 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we depended on this for something other than host reboot I'd be pretty unhappy with how much || true
is going on here, but given the context this seems reasonable..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guarding against this more in another commit
@BenTheElder please take the last commit , it fixes the reboot on ipv6 and in worker nodes |
I've tested and it worked to me on Linux, IPv6 and multinode, can't test in mac or windows |
rebased, dropped the old base bump, added a new base bump |
/lgtm |
/lgtm cancel |
fi | ||
echo -n "${curr_ip}" >/kind/old-ip | ||
[[ ! -z "${curr_ipv4}" ]] && echo -n "${curr_ipv4}" >/kind/old-ipv4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this form is cute but exits. an if statement does not set the exit code.
fixing |
pushing a new node image because this change will otherwise break the default :-) |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is still on hold , any particular reason? |
/hold cancel |
No description provided.