mirror of
https://github.com/rancher/os.git
synced 2025-08-28 19:21:42 +00:00
Don't create container when disabled
This commit is contained in:
parent
34ac3236d4
commit
f09df5610f
@ -30,17 +30,20 @@ func (c *containerBasedService) Up() error {
|
|||||||
container := c.container
|
container := c.container
|
||||||
containerCfg := c.container.ContainerCfg
|
containerCfg := c.container.ContainerCfg
|
||||||
|
|
||||||
|
fakeCreate := false
|
||||||
create := containerCfg.CreateOnly
|
create := containerCfg.CreateOnly
|
||||||
|
|
||||||
if util.Contains(c.cfg.Disable, c.name) {
|
if util.Contains(c.cfg.Disable, c.name) {
|
||||||
create = true
|
fakeCreate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
var event project.Event
|
var event project.Event
|
||||||
|
|
||||||
c.project.Notify(project.CONTAINER_STARTING, c, map[string]string{})
|
c.project.Notify(project.CONTAINER_STARTING, c, map[string]string{})
|
||||||
|
|
||||||
if create {
|
if fakeCreate {
|
||||||
|
event = project.CONTAINER_CREATED
|
||||||
|
} else if create {
|
||||||
container.Create()
|
container.Create()
|
||||||
event = project.CONTAINER_CREATED
|
event = project.CONTAINER_CREATED
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user