Fix panic when using kubeadm init
with vsphere cloud-provider
This commit is contained in:
@@ -262,6 +262,10 @@ func getVMName(client *govmomi.Client, cfg *VSphereConfig) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if svm == nil {
|
||||
return "", fmt.Errorf("unable to find machine reference by UUID")
|
||||
}
|
||||
|
||||
var vm mo.VirtualMachine
|
||||
err = s.Properties(ctx, svm.Reference(), []string{"name"}, &vm)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user