-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proposal: Post Create Initialization (#868)
* WIP: draft for machine update * changed design to post-creation logic * fixed typo in background * addressed review comments * Driver.InitializeMachine added * instance initialization flow * re-orged section
- Loading branch information
Showing
3 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
flowchart TD | ||
|
||
end1(("end")) | ||
begin((" ")) | ||
medretry["return MediumRetry, err"] | ||
shortretry["return ShortRetry, err"] | ||
medretry-->end1 | ||
shortretry-->end1 | ||
|
||
begin-->AddBootstrapTokenToUserData | ||
-->gms["statusResp,statusErr=driver.GetMachineStatus(...)"] | ||
-->chkstatuserr{"Check statusErr"} | ||
chkstatuserr--NotFound-->chknodelbl{"Chk Node Label"} | ||
chkstatuserr--Initialization-->initMachine["initErr := driver.InitializeMachine(...)"] | ||
chkstatuserr--else-->createFailed["lastop.Type=Create,lastop.state=Failed,\nphase=CrashLoopBackOff|Failed"]-->medretry | ||
chkstatuserr--nil-->initnodename["nodeName = statusResp.NodeName"]-->setnodename | ||
|
||
initMachine-->chkInitErr{"Chk initErr"} | ||
|
||
chknodelbl--notset-->createmachine["createResp, createErr=driver.CreateMachine(...)"]-->chkCreateErr{"Check createErr"} | ||
|
||
chkCreateErr--notnil-->createFailed | ||
|
||
chkCreateErr--nil-->getnodename["nodeName = createResp.NodeName"] | ||
-->chkstalenode{"nodeName != machine.Name\n//chk stale node"} | ||
chkstalenode--false-->setnodename["if unset machine.Labels['node']= nodeName"] | ||
|
||
setnodename-->initMachine | ||
chkInitErr--nil-->machinepending["if empty/crashloopbackoff lastop.type=Create,lastop.State=Processing,\nphase=Pending"]-->shortretry | ||
chkInitErr--notnil-->initFailed["lastop.Type=Create,lastop.Description=InstanceInitialization\n,lastop.state=Failed,phase=CrashLoopBackOff|Failed"] | ||
-->shortretry | ||
|
||
chkstalenode--true-->delmachine["driver.DeleteMachine(...)"] | ||
-->permafail["lastop.type=Create,lastop.state=Failed,Phase=Failed"] | ||
-->shortretry |
Oops, something went wrong.