mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
fix comments
This commit is contained in:
@@ -193,10 +193,11 @@ func (c *ManagedDiskController) ResizeDisk(diskURI string, oldSize resource.Quan
|
|||||||
|
|
||||||
// get resource group name from a managed disk URI, e.g. return {group-name} according to
|
// get resource group name from a managed disk URI, e.g. return {group-name} according to
|
||||||
// /subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id}
|
// /subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id}
|
||||||
|
// according to https://docs.microsoft.com/en-us/rest/api/compute/disks/get
|
||||||
func getResourceGroupFromDiskURI(diskURI string) (string, error) {
|
func getResourceGroupFromDiskURI(diskURI string) (string, error) {
|
||||||
fields := strings.Split(diskURI, "/")
|
fields := strings.Split(diskURI, "/")
|
||||||
if len(fields) != 9 {
|
if len(fields) != 9 || fields[3] != "resourceGroups" {
|
||||||
return "", fmt.Errorf("disk URI(%s) is not expected", diskURI)
|
return "", fmt.Errorf("invalid disk URI: %s", diskURI)
|
||||||
}
|
}
|
||||||
return fields[4], nil
|
return fields[4], nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user