mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #59539 from feiskyer/meta
Automatic merge from submit-queue (batch tested with PRs 59539, 59309). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Set instanceID to azure resource ID format while useInstanceMetadata is enabled **What this PR does / why we need it**: This PR sets instanceID to azure resource ID format while useInstanceMetadata is enabled. Before this PR, it is `azure://d84a1c30-0c9f-11e8-8a34-000d3a919531`. With this PR, it becomes `azure:///subscriptions/<id>/resourceGroups/<rg>/providers/Microsoft.Compute/virtualMachines/<node-name>` **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: This PR is only for vmas and could be cherry-picked to old releases. There will be another PR for vmss after this. Should cherry-pick to release 1.8 and 1.9. **Release note**: ```release-note Node's providerID is following Azure resource ID format now when useInstanceMetadata is enabled ```
This commit is contained in:
commit
b133434911
@ -112,10 +112,8 @@ func (az *Cloud) InstanceID(ctx context.Context, name types.NodeName) (string, e
|
||||
return "", err
|
||||
}
|
||||
if isLocalInstance {
|
||||
externalInstanceID, err := az.metadata.Text("instance/compute/vmId")
|
||||
if err == nil {
|
||||
return externalInstanceID, nil
|
||||
}
|
||||
nodeName := mapNodeNameToVMName(name)
|
||||
return az.getMachineID(nodeName), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user