@@ -338,9 +338,9 @@ func TestDecisionEngine_Evaluate_CustomExpressions(t *testing.T) {
338338 t .Run ("condition function with custom condition name" , func (t * testing.T ) {
339339 cfg := & config.MessageDecisionConfig {
340340 Params : []config.Param {
341- {Name : "is_available " , Expr : `condition("Available ").status == "True"` },
341+ {Name : "is_last_known_reconciled " , Expr : `condition("LastKnownReconciled ").status == "True"` },
342342 },
343- Result : "is_available " ,
343+ Result : "is_last_known_reconciled " ,
344344 }
345345 engine , err := NewDecisionEngine (cfg )
346346 if err != nil {
@@ -353,17 +353,17 @@ func TestDecisionEngine_Evaluate_CustomExpressions(t *testing.T) {
353353 Generation : 1 ,
354354 Status : client.ResourceStatus {
355355 Conditions : []client.Condition {
356- {Type : "Available " , Status : "True" , LastUpdatedTime : now },
356+ {Type : "LastKnownReconciled " , Status : "True" , LastUpdatedTime : now },
357357 },
358358 },
359359 }
360360
361361 decision := engine .Evaluate (resource , now )
362362 if ! decision .ShouldPublish {
363- t .Error ("expected ShouldPublish=true for Available =True condition" )
363+ t .Error ("expected ShouldPublish=true for LastKnownReconciled =True condition" )
364364 }
365365
366- // Missing Available condition → zero-value → status="" → false
366+ // Missing LastKnownReconciled condition → zero-value → status="" → false
367367 resource2 := & client.Resource {
368368 ID : testResourceID ,
369369 Kind : testResourceKind ,
@@ -377,7 +377,7 @@ func TestDecisionEngine_Evaluate_CustomExpressions(t *testing.T) {
377377
378378 decision2 := engine .Evaluate (resource2 , now )
379379 if decision2 .ShouldPublish {
380- t .Error ("expected ShouldPublish=false when Available condition is missing" )
380+ t .Error ("expected ShouldPublish=false when LastKnownReconciled condition is missing" )
381381 }
382382 })
383383}
@@ -466,7 +466,7 @@ func TestBuildConditionsLookup(t *testing.T) {
466466 ObservedGeneration : 3 ,
467467 },
468468 {
469- Type : "Available " ,
469+ Type : "LastKnownReconciled " ,
470470 Status : "False" ,
471471 LastUpdatedTime : now .Add (- 5 * time .Minute ),
472472 LastTransitionTime : now .Add (- 10 * time .Minute ),
@@ -491,12 +491,12 @@ func TestBuildConditionsLookup(t *testing.T) {
491491 t .Errorf ("Reconciled observed_generation = %v, want 3" , reconciled ["observed_generation" ])
492492 }
493493
494- avail , ok := lookup ["Available " ]
494+ avail , ok := lookup ["LastKnownReconciled " ]
495495 if ! ok {
496- t .Fatal ("missing Available condition" )
496+ t .Fatal ("missing LastKnownReconciled condition" )
497497 }
498498 if avail ["status" ] != "False" {
499- t .Errorf ("Available status = %v, want False" , avail ["status" ])
499+ t .Errorf ("LastKnownReconciled status = %v, want False" , avail ["status" ])
500500 }
501501}
502502
0 commit comments