1
0
mirror of https://github.com/rancher/os.git synced 2025-08-02 07:24:28 +00:00

defer udevsettle to cloud-init-save container

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-04-06 11:49:35 +00:00
parent 84926cb463
commit 79a7e59adb
2 changed files with 14 additions and 4 deletions

View File

@ -26,6 +26,7 @@ import (
yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/rancher/os/cmd/control"
"github.com/rancher/os/cmd/network"
rancherConfig "github.com/rancher/os/config"
"github.com/rancher/os/config/cloudinit/config"
@ -54,6 +55,14 @@ func Main() {
log.InitLogger()
log.Info("Running cloud-init-save")
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)
network.ApplyNetworkConfig(cfg)
if err := SaveCloudConfig(); err != nil {
log.Errorf("Failed to save cloud-config: %v", err)
}

View File

@ -13,7 +13,7 @@ import (
"syscall"
"github.com/docker/docker/pkg/mount"
"github.com/rancher/os/cmd/control"
// "github.com/rancher/os/cmd/control"
networkCmd "github.com/rancher/os/cmd/network"
"github.com/rancher/os/config"
"github.com/rancher/os/dfs"
@ -304,9 +304,10 @@ func RunInit() error {
log.Error(err)
}
if err := control.UdevSettle(); err != nil {
log.Errorf("Failed to run udev settle: %v", 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)