mirror of
https://github.com/rancher/os.git
synced 2025-07-05 19:16:13 +00:00
Merge pull request #312 from imikushin/fix-container-npe
prevent `nil` from being put back to `c.Container`
This commit is contained in:
commit
0b3b4a317b
@ -529,7 +529,6 @@ func (c *Container) start(createOnly, wait bool) *Container {
|
||||
return c.returnErr(err)
|
||||
}
|
||||
|
||||
container := c.Container
|
||||
created := false
|
||||
|
||||
opts, err := c.getCreateOpts(client)
|
||||
@ -563,15 +562,13 @@ func (c *Container) start(createOnly, wait bool) *Container {
|
||||
return c.returnErr(err)
|
||||
}
|
||||
|
||||
container, err = client.CreateContainer(*opts)
|
||||
c.Container, err = client.CreateContainer(*opts)
|
||||
created = true
|
||||
if err != nil {
|
||||
return c.returnErr(err)
|
||||
}
|
||||
}
|
||||
|
||||
c.Container = container
|
||||
|
||||
hostConfig := c.Container.HostConfig
|
||||
if created {
|
||||
hostConfig = opts.HostConfig
|
||||
|
Loading…
Reference in New Issue
Block a user