mirror of
https://github.com/rancher/os.git
synced 2025-08-17 14:28:16 +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) {
|
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()
|
hypervisor := util.GetHypervisor()
|
||||||
if hypervisor == "" {
|
if hypervisor == "" {
|
||||||
log.Infof("ros init: No Detected Hypervisor")
|
log.Infof("ros init: No Detected Hypervisor")
|
||||||
|
Loading…
Reference in New Issue
Block a user