mirror of
https://github.com/rancher/os.git
synced 2025-10-22 07:58:48 +00:00
Don't create container when disabled
This commit is contained in:
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user