1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

preload images: service dependencies

also, log implicitly added service dependencies and remove unnecessary linking to dockerwait
This commit is contained in:
Ivan Mikushin
2015-05-22 13:29:24 +05:00
parent 9a91accae9
commit 2dff031552
2 changed files with 7 additions and 6 deletions

View File

@@ -231,6 +231,9 @@ func NewConfig() *Config {
Environment: project.NewMaporslice([]string{
"CLOUD_INIT_NETWORK=false",
}),
Links: []string{
"preload-system-images",
},
VolumesFrom: []string{
"command-volumes",
"system-volumes",
@@ -262,6 +265,7 @@ func NewConfig() *Config {
}),
Net: "host",
Links: []string{
"preload-user-images",
"cloud-init-pre",
"network",
},

View File

@@ -242,12 +242,6 @@ func (c *Container) requiresUserDocker() bool {
return true
}
for _, v := range c.ContainerCfg.Service.Volumes {
if strings.Index(v, "/var/run/docker.sock") != -1 {
return true
}
}
return false
}
@@ -267,10 +261,12 @@ func (c *Container) addLink(link string) {
func (c *Container) parseService() {
if c.requiresSyslog() {
c.addLink("syslog")
log.Infof("[%v]: Implicitly linked to 'syslog'", c.Name)
}
if c.requiresUserDocker() {
c.addLink("dockerwait")
log.Infof("[%v]: Implicitly linked to 'dockerwait'", c.Name)
} else if c.ContainerCfg.Service.Image != "" {
client, err := NewClient(c.dockerHost)
if err != nil {
@@ -281,6 +277,7 @@ func (c *Container) parseService() {
i, _ := client.InspectImage(c.ContainerCfg.Service.Image)
if i == nil {
c.addLink("network")
log.Infof("[%v]: Implicitly linked to 'network'", c.Name)
}
}