1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 23:34:57 +00:00

Rewrite a few scripts in Go and remove unneeded services

This commit is contained in:
Josh Curl
2016-10-17 14:47:44 -07:00
parent 9755a37fe6
commit a7d405991c
22 changed files with 321 additions and 226 deletions

View File

@@ -3,8 +3,6 @@ package init
import (
"syscall"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/rancher/docker-from-scratch"
"github.com/rancher/os/compose"
@@ -12,20 +10,11 @@ import (
"github.com/rancher/os/util"
)
func autoformat(cfg *config.CloudConfig) (*config.CloudConfig, error) {
func bootstrapServices(cfg *config.CloudConfig) (*config.CloudConfig, error) {
if len(cfg.Rancher.State.Autoformat) == 0 || util.ResolveDevice(cfg.Rancher.State.Dev) != "" {
return cfg, nil
}
AUTOFORMAT := "AUTOFORMAT=" + strings.Join(cfg.Rancher.State.Autoformat, " ")
t := *cfg
t.Rancher.Autoformat["autoformat"].Environment = []string{AUTOFORMAT}
log.Info("Running Autoformat services")
_, err := compose.RunServiceSet("autoformat", &t, t.Rancher.Autoformat)
return &t, err
}
func runBootstrapContainers(cfg *config.CloudConfig) (*config.CloudConfig, error) {
log.Info("Running Bootstrap services")
log.Info("Running Bootstrap")
_, err := compose.RunServiceSet("bootstrap", cfg, cfg.Rancher.BootstrapContainers)
return cfg, err
}
@@ -70,7 +59,6 @@ func bootstrap(cfg *config.CloudConfig) error {
_, err = config.ChainCfgFuncs(cfg,
loadImages,
runBootstrapContainers,
autoformat)
bootstrapServices)
return err
}