allow providing list of services not to start

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2022-07-21 15:46:36 +02:00
parent 346b53817d
commit 4b8d1acdf4
3 changed files with 23 additions and 3 deletions

View File

@@ -248,12 +248,24 @@ func (s *Service) generateRunSet(cfg *ociscfg.Config) {
return
}
disabled := make(map[string]bool)
if cfg.Runtime.Disabled != "" {
e := strings.Split(strings.ReplaceAll(cfg.Runtime.Disabled, " ", ""), ",")
for _, s := range e {
disabled[s] = true
}
}
for name := range s.ServicesRegistry {
runset = append(runset, name)
if !disabled[name] {
runset = append(runset, name)
}
}
for name := range s.Delayed {
runset = append(runset, name)
if !disabled[name] {
runset = append(runset, name)
}
}
}