Merge pull request #1616 from ndeloof/pid_namespace

handle dependency involved by shared PID namespace
This commit is contained in:
Nicolas De loof 2021-04-30 12:25:33 +02:00 committed by GitHub
commit 7d43d39de2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -144,15 +144,16 @@ outLoop:
for i := range p.Services { for i := range p.Services {
networkDependency := getDependentServiceFromMode(p.Services[i].NetworkMode) networkDependency := getDependentServiceFromMode(p.Services[i].NetworkMode)
ipcDependency := getDependentServiceFromMode(p.Services[i].Ipc) ipcDependency := getDependentServiceFromMode(p.Services[i].Ipc)
pidDependency := getDependentServiceFromMode(p.Services[i].Pid)
if networkDependency == "" && ipcDependency == "" { if networkDependency == "" && ipcDependency == "" && pidDependency == "" {
continue continue
} }
if p.Services[i].DependsOn == nil { if p.Services[i].DependsOn == nil {
p.Services[i].DependsOn = make(types.DependsOnConfig) p.Services[i].DependsOn = make(types.DependsOnConfig)
} }
for _, service := range p.Services { for _, service := range p.Services {
if service.Name == networkDependency || service.Name == ipcDependency { if service.Name == networkDependency || service.Name == ipcDependency || service.Name == pidDependency {
p.Services[i].DependsOn[service.Name] = types.ServiceDependency{ p.Services[i].DependsOn[service.Name] = types.ServiceDependency{
Condition: types.ServiceConditionStarted, Condition: types.ServiceConditionStarted,
} }