Compare commits
2 Commits
baa8e51b3e
...
eaac8c8800
Author | SHA1 | Date | |
---|---|---|---|
eaac8c8800 | |||
9164150c06 |
@ -65,6 +65,11 @@ func ResourceMachine(sub machine.Subscriber) machine.Stater {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stater.AddTransition("read-failed", machine.States("start_read"), "inconsistent")
|
||||||
|
if e := stater.AddSubscription("read-failed", sub); e != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
stater.AddTransition("update-failed", machine.States("start_update"), "inconsistent")
|
stater.AddTransition("update-failed", machine.States("start_update"), "inconsistent")
|
||||||
if e := stater.AddSubscription("update-failed", sub); e != nil {
|
if e := stater.AddSubscription("update-failed", sub); e != nil {
|
||||||
return nil
|
return nil
|
||||||
@ -147,5 +152,20 @@ func ProcessMachine(sub machine.Subscriber) machine.Stater {
|
|||||||
if e := stater.AddSubscription("deleted", sub); e != nil {
|
if e := stater.AddSubscription("deleted", sub); e != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stater.AddTransition("restart", machine.States("*"), "restarting")
|
||||||
|
if e := stater.AddSubscription("restart", sub); e != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
stater.AddTransition("restarted", machine.States("restarting"), "running")
|
||||||
|
if e := stater.AddSubscription("restarted", sub); e != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
stater.AddTransition("restart-failed", machine.States("restarting"), "inconsistent")
|
||||||
|
if e := stater.AddSubscription("restart-failed", sub); e != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return stater
|
return stater
|
||||||
}
|
}
|
||||||
|
@ -6,23 +6,23 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"path": {
|
"path": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "command path",
|
"description": "command path",
|
||||||
"minLength": 1
|
"minLength": 1
|
||||||
},
|
},
|
||||||
"args": {
|
"args": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"description": "list of command args",
|
"description": "list of command args",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"split": {
|
"split": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "split command line args by space"
|
"description": "split command line args by space"
|
||||||
},
|
},
|
||||||
"failonerror": {
|
"failonerror": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Generate an error if the command fails",
|
"description": "Generate an error if the command fails",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user