@@ -69,20 +69,6 @@ func NewValidationReconciler(ec2api sdk.EC2API, amiProvider amifamily.Provider,
69
69
70
70
// nolint:gocyclo
71
71
func (v * Validation ) Reconcile (ctx context.Context , nodeClass * v1.EC2NodeClass ) (reconcile.Result , error ) {
72
- if val , ok := v .cache .Get (v .cacheKey (nodeClass )); ok {
73
- // We still update the status condition even if it's cached since we may have had a conflict error previously
74
- if val == "" {
75
- nodeClass .StatusConditions ().SetTrue (v1 .ConditionTypeValidationSucceeded )
76
- } else {
77
- nodeClass .StatusConditions ().SetFalse (
78
- v1 .ConditionTypeValidationSucceeded ,
79
- val .(string ),
80
- ValidationConditionMessages [val .(string )],
81
- )
82
- }
83
- return reconcile.Result {}, nil
84
- }
85
-
86
72
for _ , cond := range []string {
87
73
v1 .ConditionTypeAMIsReady ,
88
74
v1 .ConditionTypeInstanceProfileReady ,
@@ -100,6 +86,20 @@ func (v *Validation) Reconcile(ctx context.Context, nodeClass *v1.EC2NodeClass)
100
86
return reconcile.Result {}, nil
101
87
}
102
88
89
+ if val , ok := v .cache .Get (v .cacheKey (nodeClass )); ok {
90
+ // We still update the status condition even if it's cached since we may have had a conflict error previously
91
+ if val == "" {
92
+ nodeClass .StatusConditions ().SetTrue (v1 .ConditionTypeValidationSucceeded )
93
+ } else {
94
+ nodeClass .StatusConditions ().SetFalse (
95
+ v1 .ConditionTypeValidationSucceeded ,
96
+ val .(string ),
97
+ ValidationConditionMessages [val .(string )],
98
+ )
99
+ }
100
+ return reconcile.Result {}, nil
101
+ }
102
+
103
103
nodeClaim := & karpv1.NodeClaim {
104
104
Spec : karpv1.NodeClaimSpec {
105
105
NodeClassRef : & karpv1.NodeClassReference {
0 commit comments