fix lint errors
Some checks failed
Lint / golangci-lint (push) Failing after 9m49s
Declarative Tests / test (push) Successful in 1m28s

This commit is contained in:
Matthew Rich 2024-05-13 10:13:20 -07:00
parent cf61b1504c
commit 0bcea916a2
3 changed files with 14 additions and 10 deletions

View File

@ -84,16 +84,18 @@ func (n *ContainerNetwork) Notify(m *machine.EventMessage) {
case machine.ENTERSTATEEVENT: case machine.ENTERSTATEEVENT:
switch m.Dest { switch m.Dest {
case "start_create": case "start_create":
if e := n.Create(ctx); e != nil { if e := n.Create(ctx); e == nil {
if triggerErr := n.stater.Trigger("created"); triggerErr != nil { if triggerErr := n.stater.Trigger("created"); triggerErr == nil {
// transition error return
} }
} }
n.State = "absent"
case "present": case "present":
n.State = "present" n.State = "present"
} }
case machine.EXITSTATEEVENT: case machine.EXITSTATEEVENT:
} }
} }
func (n *ContainerNetwork) URI() string { func (n *ContainerNetwork) URI() string {

View File

@ -119,11 +119,12 @@ func (f *File) Notify(m *machine.EventMessage) {
case machine.ENTERSTATEEVENT: case machine.ENTERSTATEEVENT:
switch m.Dest { switch m.Dest {
case "start_create": case "start_create":
if e := f.Create(ctx); e != nil { if e := f.Create(ctx); e == nil {
if triggerErr := f.stater.Trigger("created"); triggerErr != nil { if triggerErr := f.stater.Trigger("created"); triggerErr == nil {
// transition error return
} }
} }
f.State = "absent"
case "present": case "present":
f.State = "present" f.State = "present"
} }

View File

@ -70,11 +70,12 @@ func (h *HTTP) Notify(m *machine.EventMessage) {
case machine.ENTERSTATEEVENT: case machine.ENTERSTATEEVENT:
switch m.Dest { switch m.Dest {
case "start_create": case "start_create":
if e := h.Create(ctx); e != nil { if e := h.Create(ctx); e == nil {
if triggerErr := h.stater.Trigger("created"); triggerErr != nil { if triggerErr := h.stater.Trigger("created"); triggerErr == nil {
// transition error return
} }
} }
h.State = "absent"
case "present": case "present":
h.State = "present" h.State = "present"
} }