Skip to content

Commit

Permalink
Proposal: Post Create Initialization (#868)
Browse files Browse the repository at this point in the history
* 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
elankath authored Dec 12, 2023
1 parent d5d385b commit 897fbb8
Show file tree
Hide file tree
Showing 3 changed files with 222 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/proposals/initialize-machine-triggercreationflow.mmd
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
Loading

0 comments on commit 897fbb8

Please sign in to comment.