mirror of
https://github.com/rancher/os.git
synced 2025-09-12 21:23:13 +00:00
My first pass at fixing the b2d autoformat
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
@@ -12,6 +12,8 @@ import (
|
||||
|
||||
func bootstrapServices(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
if util.ResolveDevice(cfg.Rancher.State.Dev) != "" && len(cfg.Bootcmd) == 0 {
|
||||
log.Info("NOT Running Bootstrap")
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
log.Info("Running Bootstrap")
|
||||
@@ -56,6 +58,8 @@ func stopDocker(c chan interface{}) error {
|
||||
|
||||
func bootstrap(cfg *config.CloudConfig) error {
|
||||
log.Info("Launching Bootstrap Docker")
|
||||
log.Infof("bootstrap container: Autoformat(%v)", cfg.Rancher.State.Autoformat)
|
||||
|
||||
c, err := startDocker(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
|
15
init/init.go
15
init/init.go
@@ -267,7 +267,17 @@ func RunInit() error {
|
||||
}
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
// save here so the bootstrap service can see it (when booting from iso, its very early)
|
||||
if boot2DockerEnvironment {
|
||||
if err := config.Set("rancher.state.dev", cfg.Rancher.State.Dev); err != nil {
|
||||
log.Errorf("Failed to update rancher.state.dev: %v", err)
|
||||
}
|
||||
if err := config.Set("rancher.state.autoformat", cfg.Rancher.State.Autoformat); err != nil {
|
||||
log.Errorf("Failed to update rancher.state.autoformat: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return config.LoadConfig(), nil
|
||||
},
|
||||
func(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
var err error
|
||||
@@ -278,9 +288,6 @@ func RunInit() error {
|
||||
return cfg, nil
|
||||
},
|
||||
func(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
if err := os.MkdirAll(config.CloudConfigDir, os.ModeDir|0755); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
cfg.Rancher.CloudInit.Datasources = config.LoadConfigWithPrefix(state).Rancher.CloudInit.Datasources
|
||||
if err := config.Set("rancher.cloud_init.datasources", cfg.Rancher.CloudInit.Datasources); err != nil {
|
||||
|
Reference in New Issue
Block a user