@@ -57,6 +57,11 @@ import (
57
57
"sigs.k8s.io/cluster-api/util/predicates"
58
58
)
59
59
60
+ const (
61
+ // NodeTypeAL2023 represents the AL2023 node type.
62
+ NodeTypeAL2023 = "al2023"
63
+ )
64
+
60
65
// EKSConfigReconciler reconciles a EKSConfig object.
61
66
type EKSConfigReconciler struct {
62
67
client.Client
@@ -229,7 +234,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1
229
234
230
235
// For AL2023, requeue to ensure we retry when control plane is ready
231
236
// For AL2, follow upstream behavior and return nil
232
- if config .Spec .NodeType == "al2023" {
237
+ if config .Spec .NodeType == NodeTypeAL2023 {
233
238
log .Info ("AL2023 detected, returning requeue after 30 seconds" )
234
239
return ctrl.Result {RequeueAfter : 30 * time .Second }, nil
235
240
}
@@ -244,16 +249,16 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1
244
249
}
245
250
246
251
// Check if control plane is ready (skip in test environments for AL2023)
247
- if config .Spec .NodeType == "al2023" && ! conditions .IsTrue (controlPlane , ekscontrolplanev1 .EKSControlPlaneReadyCondition ) {
248
- // In test environments, skip the control plane readiness check for AL2023
249
- if os .Getenv ("TEST_ENV" ) == "true" {
250
- // Skipping control plane readiness check for AL2023 in test environment
251
- } else {
252
+ if config .Spec .NodeType == NodeTypeAL2023 && ! conditions .IsTrue (controlPlane , ekscontrolplanev1 .EKSControlPlaneReadyCondition ) {
253
+ // Skip control plane readiness check for AL2023 in test environment
254
+ if os .Getenv ("TEST_ENV" ) != "true" {
255
+ log .Info ("AL2023 detected, waiting for control plane to be ready" )
252
256
conditions .MarkFalse (config , eksbootstrapv1 .DataSecretAvailableCondition ,
253
257
eksbootstrapv1 .DataSecretGenerationFailedReason ,
254
258
clusterv1 .ConditionSeverityInfo , "Control plane is not ready yet" )
255
259
return ctrl.Result {RequeueAfter : 30 * time .Second }, nil
256
260
}
261
+ log .Info ("Skipping control plane readiness check for AL2023 in test environment" )
257
262
}
258
263
log .Info ("Control plane is ready, proceeding with userdata generation" )
259
264
@@ -304,7 +309,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1
304
309
}
305
310
306
311
// Set AMI family type and AL2023-specific fields if needed
307
- if config .Spec .NodeType == "al2023" {
312
+ if config .Spec .NodeType == NodeTypeAL2023 {
308
313
log .Info ("Processing AL2023 node type" )
309
314
nodeInput .AMIFamilyType = userdata .AMIFamilyAL2023
310
315
0 commit comments