mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-03-06 18:28:48 -06:00
Make wasRunning a bool
This commit is contained in:
parent
3054f40223
commit
ee6abfd1bb
@ -61,7 +61,7 @@ type Container struct {
|
||||
|
||||
conn context.Context
|
||||
cdata *define.InspectContainerData
|
||||
wasRunning null.Bool
|
||||
wasRunning bool
|
||||
}
|
||||
|
||||
func (c *Container) Init(conn context.Context, nets []network.Network) error {
|
||||
@ -106,7 +106,7 @@ func (c *Container) Init(conn context.Context, nets []network.Network) error {
|
||||
}
|
||||
c.conn = conn
|
||||
err := c.populateCData()
|
||||
c.wasRunning.SetValid(c.IsRunning())
|
||||
c.wasRunning = err != nil && c.IsRunning()
|
||||
return err
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ func (c *Container) UpdateCommands() cmd.CommandSet {
|
||||
func (c *Container) ConditionalStartCommands() cmd.CommandSet {
|
||||
return c.newCommandSet("CONDSTART", cmd.Commands{
|
||||
cmd.NewConditional("restart_if_was_running",
|
||||
c.wasRunning.ValueOrZero,
|
||||
func() bool { return c.wasRunning },
|
||||
cmd.NewSet(c.StartCommands()),
|
||||
cmd.NewNop(),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user