Skip to content

Commit

Permalink
fix: disk attach/detach failure with track2 sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Feb 6, 2025
1 parent 4c500b1 commit 54b9daa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/provider/azure_controller_standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (as *availabilitySet) AttachDisk(ctx context.Context, nodeName types.NodeNa
DataDisks: disks,
},
},
Location: vm.Location,
}
klog.V(2).Infof("azureDisk - update(%s): vm(%s) - attach disk list(%v)", nodeResourceGroup, vmName, diskMap)

Expand Down Expand Up @@ -190,6 +191,7 @@ func (as *availabilitySet) DetachDisk(ctx context.Context, nodeName types.NodeNa
DataDisks: disks,
},
},
Location: vm.Location,
}
klog.V(2).Infof("azureDisk - update(%s): vm(%s) node(%s)- detach disk list(%s)", nodeResourceGroup, vmName, nodeName, diskMap)

Expand Down
4 changes: 2 additions & 2 deletions pkg/provider/azure_controller_vmss.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, dis

var disks []*armcompute.DataDisk

if vm != nil && vm.VirtualMachineProperties != nil {
storageProfile := vm.VirtualMachineProperties.StorageProfile
if vm != nil && vm.VirtualMachineScaleSetVMProperties != nil {
storageProfile := vm.VirtualMachineScaleSetVMProperties.StorageProfile
if storageProfile != nil && storageProfile.DataDisks != nil {
disks = make([]*armcompute.DataDisk, len(storageProfile.DataDisks))
copy(disks, storageProfile.DataDisks)
Expand Down
2 changes: 2 additions & 0 deletions pkg/provider/azure_controller_vmssflex.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (fs *FlexScaleSet) AttachDisk(ctx context.Context, nodeName types.NodeName,
DataDisks: disks,
},
},
Location: vm.Location,
}

klog.V(2).Infof("azureDisk - update: rg(%s) vm(%s) - attach disk list(%+v)", nodeResourceGroup, vmName, diskMap)
Expand Down Expand Up @@ -184,6 +185,7 @@ func (fs *FlexScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName,
DataDisks: disks,
},
},
Location: vm.Location,
}

var result *armcompute.VirtualMachine
Expand Down

0 comments on commit 54b9daa

Please sign in to comment.