1
0
mirror of https://github.com/rancher/os.git synced 2025-06-30 16:51:47 +00:00

Simplify the network setup

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-04-19 12:47:44 +00:00
parent 9e0302fd85
commit e05f30c4fc
2 changed files with 3 additions and 21 deletions

View File

@ -59,19 +59,14 @@ func Main() {
log.Errorf("Failed to run udev settle: %v", err)
}
cfg := rancherConfig.LoadConfig()
log.Debugf("init: SaveCloudConfig(pre ApplyNetworkConfig): %#v", cfg.Rancher.Network)
network.ApplyNetworkConfig(cfg)
if err := SaveCloudConfig(); err != nil {
if err := saveCloudConfig(); err != nil {
log.Errorf("Failed to save cloud-config: %v", err)
}
}
func SaveCloudConfig() error {
func saveCloudConfig() error {
log.Debugf("SaveCloudConfig")
// TODO: can't run these here, but it needs to be triggered from here :()
cfg := rancherConfig.LoadConfig()
log.Debugf("init: SaveCloudConfig(pre ApplyNetworkConfig): %#v", cfg.Rancher.Network)
network.ApplyNetworkConfig(cfg)

View File

@ -13,8 +13,6 @@ import (
"syscall"
"github.com/docker/docker/pkg/mount"
// "github.com/rancher/os/cmd/control"
networkCmd "github.com/rancher/os/cmd/network"
"github.com/rancher/os/config"
"github.com/rancher/os/dfs"
"github.com/rancher/os/log"
@ -304,24 +302,13 @@ func RunInit() error {
log.Error(err)
}
// Udev tools not available here at this point - defer to cloud-init-save container
//if err := control.UdevSettle(); err != nil {
// log.Errorf("Failed to run udev settle: %v", err)
// }
//cfg := rancherConfig.LoadConfig()
log.Debugf("init: SaveCloudConfig(pre ApplyNetworkConfig): %#v", cfg.Rancher.Network)
networkCmd.ApplyNetworkConfig(cfg)
log.Debug("init: runCloudInitServices()")
if err := runCloudInitServices(cfg); err != nil {
log.Error(err)
}
// Apply any newly detected network config.
// return any newly detected network config.
cfg = config.LoadConfig()
log.Debugf("init: SaveCloudConfig(post ApplyNetworkConfig): %#v", cfg.Rancher.Network)
networkCmd.ApplyNetworkConfig(cfg)
return cfg, nil
},