mirror of https://github.com/k3s-io/k3s
fix comments
parent
f533e378ec
commit
ee290fe42e
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue