mirror of
https://github.com/rancher/os.git
synced 2025-04-28 03:20:50 +00:00
Optimized the process of static ip
This commit is contained in:
parent
408f7afd63
commit
5f4ff44780
@ -10,7 +10,16 @@ import (
|
||||
)
|
||||
|
||||
func CloudInit(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
cfg.Rancher.CloudInit.Datasources = config.LoadConfigWithPrefix(config.StateDir).Rancher.CloudInit.Datasources
|
||||
stateConfig := config.LoadConfigWithPrefix(config.StateDir)
|
||||
cfg.Rancher.CloudInit.Datasources = stateConfig.Rancher.CloudInit.Datasources
|
||||
|
||||
if len(stateConfig.Rancher.Network.Interfaces) > 0 {
|
||||
cfg.Rancher.Network = stateConfig.Rancher.Network
|
||||
if err := config.Set("rancher.network", stateConfig.Rancher.Network); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
hypervisor := util.GetHypervisor()
|
||||
if hypervisor == "" {
|
||||
log.Infof("ros init: No Detected Hypervisor")
|
||||
|
Loading…
Reference in New Issue
Block a user