mirror of
https://github.com/rancher/os.git
synced 2025-06-30 08:41:48 +00:00
Simplify the network setup
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
9e0302fd85
commit
e05f30c4fc
@ -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)
|
||||
|
15
init/init.go
15
init/init.go
@ -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
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user