Skip to content

Commit f2242bc

Browse files
committed
Fix EC2NodeClass readiness to not stuck in False
We observed some EC2NodeClasses stuck in Ready=False with message of `Failed to detect the cluster CIDR`. We believe this is caused by a bug in Karpenter, and this commit fixes that. The previous commit adds a failing test to reproduce and the demonstrate the issue, and this commit fixes the implementation.
1 parent ce96cdd commit f2242bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controllers/nodeclass/readiness.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ func (n Readiness) Reconcile(ctx context.Context, nodeClass *v1.EC2NodeClass) (r
4646
nodeClass.StatusConditions().SetFalse(status.ConditionReady, "NodeClassNotReady", "Failed to detect the cluster CIDR")
4747
return reconcile.Result{}, fmt.Errorf("failed to detect the cluster CIDR, %w", err)
4848
}
49+
// Ensure the ready condition is set to true once the cluster CIDR is resolved,
50+
// to not stuck in Failed state indefinitely.
51+
nodeClass.StatusConditions().SetTrue(status.ConditionReady)
4952
}
5053
return reconcile.Result{}, nil
5154
}

0 commit comments

Comments
 (0)