fix lint errors
This commit is contained in:
parent
d6c2679416
commit
5f7db0b4d0
@ -278,10 +278,14 @@ func (c *ContainerImage) ResolveId(ctx context.Context) string {
|
||||
slog.Info("ContainerImage.ResolveId()", "name", c.Name, "machine.state", c.StateMachine().CurrentState(), "resource.state", c.State)
|
||||
c.Id = imageInspect.ID
|
||||
if c.Id != "" {
|
||||
c.StateMachine().Trigger("exists")
|
||||
if triggerErr := c.StateMachine().Trigger("exists"); triggerErr != nil {
|
||||
panic(fmt.Errorf("%w: %s %s", triggerErr, c.Type(), c.Name))
|
||||
}
|
||||
slog.Info("ContainerImage.ResolveId() trigger created", "machine", c.StateMachine(), "state", c.StateMachine().CurrentState())
|
||||
} else {
|
||||
c.StateMachine().Trigger("notexists")
|
||||
if triggerErr := c.StateMachine().Trigger("notexists"); triggerErr != nil {
|
||||
panic(fmt.Errorf("%w: %s %s", triggerErr, c.Type(), c.Name))
|
||||
}
|
||||
slog.Info("ContainerImage.ResolveId()", "name", c.Name, "machine.state", c.StateMachine().CurrentState(), "resource.state", c.State)
|
||||
}
|
||||
return c.Id
|
||||
|
@ -42,7 +42,9 @@ func (d *Declaration) ResolveId(ctx context.Context) string {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
slog.Info("Declaration.ResolveId() - panic", "recover", r, "state", d.Attributes.StateMachine())
|
||||
d.Attributes.StateMachine().Trigger("notexists")
|
||||
if triggerErr := d.Attributes.StateMachine().Trigger("notexists"); triggerErr != nil {
|
||||
panic(triggerErr)
|
||||
}
|
||||
}
|
||||
}()
|
||||
slog.Info("Declaration.ResolveId()")
|
||||
|
Loading…
Reference in New Issue
Block a user