mirror of
https://github.com/rancher/os.git
synced 2025-09-04 00:04:25 +00:00
preload images: service dependencies
also, log implicitly added service dependencies and remove unnecessary linking to dockerwait
This commit is contained in:
@@ -231,6 +231,9 @@ func NewConfig() *Config {
|
|||||||
Environment: project.NewMaporslice([]string{
|
Environment: project.NewMaporslice([]string{
|
||||||
"CLOUD_INIT_NETWORK=false",
|
"CLOUD_INIT_NETWORK=false",
|
||||||
}),
|
}),
|
||||||
|
Links: []string{
|
||||||
|
"preload-system-images",
|
||||||
|
},
|
||||||
VolumesFrom: []string{
|
VolumesFrom: []string{
|
||||||
"command-volumes",
|
"command-volumes",
|
||||||
"system-volumes",
|
"system-volumes",
|
||||||
@@ -262,6 +265,7 @@ func NewConfig() *Config {
|
|||||||
}),
|
}),
|
||||||
Net: "host",
|
Net: "host",
|
||||||
Links: []string{
|
Links: []string{
|
||||||
|
"preload-user-images",
|
||||||
"cloud-init-pre",
|
"cloud-init-pre",
|
||||||
"network",
|
"network",
|
||||||
},
|
},
|
||||||
|
@@ -242,12 +242,6 @@ func (c *Container) requiresUserDocker() bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range c.ContainerCfg.Service.Volumes {
|
|
||||||
if strings.Index(v, "/var/run/docker.sock") != -1 {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,10 +261,12 @@ func (c *Container) addLink(link string) {
|
|||||||
func (c *Container) parseService() {
|
func (c *Container) parseService() {
|
||||||
if c.requiresSyslog() {
|
if c.requiresSyslog() {
|
||||||
c.addLink("syslog")
|
c.addLink("syslog")
|
||||||
|
log.Infof("[%v]: Implicitly linked to 'syslog'", c.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.requiresUserDocker() {
|
if c.requiresUserDocker() {
|
||||||
c.addLink("dockerwait")
|
c.addLink("dockerwait")
|
||||||
|
log.Infof("[%v]: Implicitly linked to 'dockerwait'", c.Name)
|
||||||
} else if c.ContainerCfg.Service.Image != "" {
|
} else if c.ContainerCfg.Service.Image != "" {
|
||||||
client, err := NewClient(c.dockerHost)
|
client, err := NewClient(c.dockerHost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -281,6 +277,7 @@ func (c *Container) parseService() {
|
|||||||
i, _ := client.InspectImage(c.ContainerCfg.Service.Image)
|
i, _ := client.InspectImage(c.ContainerCfg.Service.Image)
|
||||||
if i == nil {
|
if i == nil {
|
||||||
c.addLink("network")
|
c.addLink("network")
|
||||||
|
log.Infof("[%v]: Implicitly linked to 'network'", c.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user