Commit ee290fe4 authored by andyzhangx's avatar andyzhangx

fix comments

parent f533e378
......@@ -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
// /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) {
fields := strings.Split(diskURI, "/")
if len(fields) != 9 {
return "", fmt.Errorf("disk URI(%s) is not expected", diskURI)
if len(fields) != 9 || fields[3] != "resourceGroups" {
return "", fmt.Errorf("invalid disk URI: %s", diskURI)
}
return fields[4], nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment