mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Do not query for VMUUID if it was explicitly passed
This commit is contained in:
parent
3abba25160
commit
81e25c37be
@ -134,7 +134,7 @@ type VSphereConfig struct {
|
|||||||
WorkingDir string `gcfg:"working-dir"`
|
WorkingDir string `gcfg:"working-dir"`
|
||||||
// Soap round tripper count (retries = RoundTripper - 1)
|
// Soap round tripper count (retries = RoundTripper - 1)
|
||||||
RoundTripperCount uint `gcfg:"soap-roundtrip-count"`
|
RoundTripperCount uint `gcfg:"soap-roundtrip-count"`
|
||||||
// Deprecated as the virtual machines will be automatically discovered.
|
// Is required on the controller-manager if it does not run on a VMware machine
|
||||||
// VMUUID is the VM Instance UUID of virtual machine which can be retrieved from instanceUuid
|
// VMUUID is the VM Instance UUID of virtual machine which can be retrieved from instanceUuid
|
||||||
// property in VmConfigInfo, or also set as vc.uuid in VMX file.
|
// property in VmConfigInfo, or also set as vc.uuid in VMX file.
|
||||||
// If not set, will be fetched from the machine via sysfs (requires root)
|
// If not set, will be fetched from the machine via sysfs (requires root)
|
||||||
@ -442,11 +442,15 @@ func newControllerNode(cfg VSphereConfig) (*VSphere, error) {
|
|||||||
glog.Errorf("Failed to get hostname. err: %+v", err)
|
glog.Errorf("Failed to get hostname. err: %+v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if cfg.Global.VMUUID != "" {
|
||||||
|
vs.vmUUID = cfg.Global.VMUUID
|
||||||
|
} else {
|
||||||
vs.vmUUID, err = getVMUUID()
|
vs.vmUUID, err = getVMUUID()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Failed to get uuid. err: %+v", err)
|
glog.Errorf("Failed to get uuid. err: %+v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
runtime.SetFinalizer(vs, logout)
|
runtime.SetFinalizer(vs, logout)
|
||||||
return vs, nil
|
return vs, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user