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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user