Mcd encap prep cleanups 1#1004
Conversation
In once-from right now we have no previous config; the logic here is now cleaner as the higher level code passes `nil`, then the update logic can more easily understand there is no previous state rather than checking `dn.onceFrom`.
Rather than stashing it in the daemon state, pass it down one level via API. Change other logic to check for e.g. `kubeClient` as a signal for being cluster driven. Related to this, reorder the `reboot` function logic slightly so that we return early if `skipReboot` is set, rather than logging that we're rebooting and then not doing it. Prep for work on initial kargs, also just general logic cleanup.
Both callers outside of the unit test were passing the same things and also duplicating the rationale; lower that into the function. Drop the unit test since it really isn't useful enough to motivate passing extra parameters in the primary path.
We weren't necessarily "killed by kube", maybe we got OOM killed or crashed, etc. It's about being interrupted in the middle of a drain, so let's clarify the log message.
| // take a stab at that and re-run the drain+reboot routine | ||
| if state.pendingConfig != nil && bootID == dn.bootID { | ||
| dn.logSystem("killed by kube, retrying...") | ||
| dn.logSystem("drain interrupted, retrying") |
There was a problem hiding this comment.
thanks for this, I completely forgot to clean this up
|
/approve I'm not sure we can land this even if it's just a cleanup and it's far better than before - I'll check that out and/or create a |
|
It's just feature freeze, not code freeze right? |
right 🤔 this isn't changing anything then or adding anything /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, runcom The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Extracted from #935
With one other small commit on top.
Would like to land this so I'm less in rebase hell later...