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

Shim to support services depending on cloud-init service

This commit is contained in:
Josh Curl
2016-11-03 13:27:15 -07:00
parent 33b6145162
commit 72f7f9a572

View File

@@ -15,11 +15,17 @@ type ServiceFactory struct {
func (s *ServiceFactory) Create(project *project.Project, name string, serviceConfig *composeConfig.ServiceConfig) (project.Service, error) {
if after := serviceConfig.Labels["io.rancher.os.after"]; after != "" {
for _, dep := range util.TrimSplit(after, ",") {
if dep == "cloud-init" {
dep = "cloud-init-execute"
}
s.Deps[name] = append(s.Deps[name], dep)
}
}
if before := serviceConfig.Labels["io.rancher.os.before"]; before != "" {
for _, dep := range util.TrimSplit(before, ",") {
if dep == "cloud-init" {
dep = "cloud-init-execute"
}
s.Deps[dep] = append(s.Deps[dep], name)
}
}