@@ -109,13 +109,14 @@ func (ss *scaleSet) AttachDisk(isManagedDisk bool, diskName, diskURI string, nod
109
109
klog .Errorf ("azureDisk - begin to filterNonExistingDisks(%s, %s) on rg(%s) vm(%s)" , diskName , diskURI , nodeResourceGroup , nodeName )
110
110
disks := ss .filterNonExistingDisks (ctx , * newVM .VirtualMachineScaleSetVMProperties .StorageProfile .DataDisks )
111
111
newVM .VirtualMachineScaleSetVMProperties .StorageProfile .DataDisks = & disks
112
- if rerr = ss .VirtualMachineScaleSetVMsClient .Update (ctx , nodeResourceGroup , ssName , instanceID , newVM , "attach_disk" ); rerr != nil {
113
- return rerr .Error ()
114
- }
112
+ rerr = ss .VirtualMachineScaleSetVMsClient .Update (ctx , nodeResourceGroup , ssName , instanceID , newVM , "attach_disk" )
115
113
}
116
114
}
117
115
118
- klog .V (2 ).Infof ("azureDisk - update(%s): vm(%s) - attach disk(%s, %s) succeeded" , nodeResourceGroup , nodeName , diskName , diskURI )
116
+ klog .V (2 ).Infof ("azureDisk - update(%s): vm(%s) - attach disk(%s, %s) returned with %v" , nodeResourceGroup , nodeName , diskName , diskURI , rerr )
117
+ if rerr != nil {
118
+ return rerr .Error ()
119
+ }
119
120
return nil
120
121
}
121
122
@@ -181,14 +182,14 @@ func (ss *scaleSet) DetachDisk(diskName, diskURI string, nodeName types.NodeName
181
182
klog .Errorf ("azureDisk - begin to filterNonExistingDisks(%s, %s) on rg(%s) vm(%s)" , diskName , diskURI , nodeResourceGroup , nodeName )
182
183
disks := ss .filterNonExistingDisks (ctx , * newVM .VirtualMachineScaleSetVMProperties .StorageProfile .DataDisks )
183
184
newVM .VirtualMachineScaleSetVMProperties .StorageProfile .DataDisks = & disks
184
- if rerr = ss .VirtualMachineScaleSetVMsClient .Update (ctx , nodeResourceGroup , ssName , instanceID , newVM , "detach_disk" ); rerr != nil {
185
- return rerr .Error ()
186
- }
185
+ rerr = ss .VirtualMachineScaleSetVMsClient .Update (ctx , nodeResourceGroup , ssName , instanceID , newVM , "detach_disk" )
187
186
}
188
187
}
189
188
190
- klog .V (2 ).Infof ("azureDisk - update(%s): vm(%s) - detach disk(%s, %s) succeeded" , nodeResourceGroup , nodeName , diskName , diskURI )
191
-
189
+ klog .V (2 ).Infof ("azureDisk - update(%s): vm(%s) - detach disk(%s, %s) returned with %v" , nodeResourceGroup , nodeName , diskName , diskURI , rerr )
190
+ if rerr != nil {
191
+ return rerr .Error ()
192
+ }
192
193
return nil
193
194
}
194
195
0 commit comments