Fix machineID getting for vmss nodes when using instance metadata

pull/8/head
Pengfei Ni 2018-04-16 13:28:46 +08:00
parent 860403dada
commit 8a287d2114
1 changed files with 4 additions and 0 deletions

View File

@ -162,6 +162,10 @@ func (az *Cloud) InstanceID(ctx context.Context, name types.NodeName) (string, e
}
ssName, instanceID, err := extractVmssVMName(metadataName)
if err != nil {
if err == ErrorNotVmssInstance {
// Compose machineID for standard Node.
return az.getStandardMachineID(nodeName), nil
}
return "", err
}
// Compose instanceID based on ssName and instanceID for vmss instance.