mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
specify external resource group in ResizeDisk
fix issue
This commit is contained in:
parent
e6fdcb4af3
commit
f533e378ec
@ -148,11 +148,17 @@ func (c *ManagedDiskController) getDisk(diskName string) (string, string, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ResizeDisk Expand the disk to new size
|
// ResizeDisk Expand the disk to new size
|
||||||
func (c *ManagedDiskController) ResizeDisk(diskName string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error) {
|
func (c *ManagedDiskController) ResizeDisk(diskURI string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error) {
|
||||||
ctx, cancel := getContextWithCancel()
|
ctx, cancel := getContextWithCancel()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
result, err := c.common.cloud.DisksClient.Get(ctx, c.common.resourceGroup, diskName)
|
diskName := path.Base(diskURI)
|
||||||
|
resourceGroup, err := getResourceGroupFromDiskURI(diskURI)
|
||||||
|
if err != nil {
|
||||||
|
return oldSize, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return oldSize, err
|
return oldSize, err
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ type DiskController interface {
|
|||||||
DeleteVolume(diskURI string) error
|
DeleteVolume(diskURI string) error
|
||||||
|
|
||||||
// Expand the disk to new size
|
// Expand the disk to new size
|
||||||
ResizeDisk(diskName string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)
|
ResizeDisk(diskURI string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type azureDataDiskPlugin struct {
|
type azureDataDiskPlugin struct {
|
||||||
@ -242,7 +242,7 @@ func (plugin *azureDataDiskPlugin) ExpandVolumeDevice(
|
|||||||
return oldSize, err
|
return oldSize, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return diskController.ResizeDisk(spec.PersistentVolume.Spec.AzureDisk.DiskName, oldSize, newSize)
|
return diskController.ResizeDisk(spec.PersistentVolume.Spec.AzureDisk.DataDiskURI, oldSize, newSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *azureDataDiskPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) {
|
func (plugin *azureDataDiskPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user