@@ -230,8 +230,11 @@ func (c *CloudNodeLifecycleController) getProviderID(ctx context.Context, node *
230
230
func (c * CloudNodeLifecycleController ) shutdownInCloudProvider (ctx context.Context , node * v1.Node ) (bool , error ) {
231
231
if instanceV2 , ok := c .cloud .InstancesV2 (); ok {
232
232
shutDown , err := instanceV2 .InstanceShutdown (ctx , node )
233
+ if err != nil {
234
+ return shutDown , fmt .Errorf ("failed to get instance shutdown status: %w" , err )
235
+ }
233
236
234
- return shutDown , fmt . Errorf ( "failed to get instance shutdown status: %w" , err )
237
+ return shutDown , nil
235
238
}
236
239
237
240
instances , ok := c .cloud .Instances ()
@@ -264,8 +267,11 @@ func (c *CloudNodeLifecycleController) shutdownInCloudProvider(ctx context.Conte
264
267
func (c * CloudNodeLifecycleController ) ensureNodeExistsByProviderID (ctx context.Context , node * v1.Node ) (bool , error ) {
265
268
if instanceV2 , ok := c .cloud .InstancesV2 (); ok {
266
269
exists , err := instanceV2 .InstanceExists (ctx , node )
270
+ if err != nil {
271
+ return exists , fmt .Errorf ("failed to get instance existence: %w" , err )
272
+ }
267
273
268
- return exists , fmt . Errorf ( "failed to get instance existence: %w" , err )
274
+ return exists , nil
269
275
}
270
276
271
277
instances , ok := c .cloud .Instances ()
0 commit comments