Skip to content

Commit 785b7ff

Browse files
author
Mickaël Le Baillif
committed
Enhance error logging in customUpdate for AutoMode config updates
1 parent d830271 commit 785b7ff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/resource/cluster/hook.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,17 @@ func (rm *resourceManager) customUpdate(
457457
if isAutoModeCluster(desired) {
458458
if err := rm.updateComputeConfig(ctx, desired); err != nil {
459459
awsErr, ok := extractAWSError(err)
460+
var awsErrorCode string
461+
if ok && awsErr != nil {
462+
awsErrorCode = awsErr.Code
463+
}
460464
rlog.Info("attempting to update AutoMode config",
461465
"error", err,
462466
"isAWSError", ok,
463-
"awsErrorCode", awsErr.Code)
467+
"awsErrorCode", awsErrorCode)
464468

465469
// Check to see if we've raced an async update call and need to requeue
466-
if ok && awsErr.Code == "ResourceInUseException" {
470+
if ok && awsErr != nil && awsErr.Code == "ResourceInUseException" {
467471
rlog.Info("resource in use, requeueing after async update")
468472
return nil, requeueAfterAsyncUpdate()
469473
}

0 commit comments

Comments
 (0)