@@ -796,6 +796,7 @@ var _ = Describe("DeliverableReconciler", func() {
796796 var retrieveError cerrors.RetrieveOutputError
797797 var wrappedError error
798798 var stampedObject * unstructured.Unstructured
799+ var healthy metav1.ConditionStatus
799800
800801 JustBeforeEach (func () {
801802 stampedObject = & unstructured.Unstructured {}
@@ -814,6 +815,7 @@ var _ = Describe("DeliverableReconciler", func() {
814815 BlueprintType : cerrors .Delivery ,
815816 StampedObject : stampedObject ,
816817 QualifiedResource : "mything.thing.io" ,
818+ Healthy : healthy ,
817819 }
818820
819821 rlzr .RealizeStub = func (ctx context.Context , resourceRealizer realizer.ResourceRealizer , deliveryName string , resources []realizer.OwnerResource , statuses statuses.ResourceStatuses ) error {
@@ -950,9 +952,37 @@ var _ = Describe("DeliverableReconciler", func() {
950952 wrappedError = stamp .NewJsonPathError ("this.wont.find.anything" , errors .New ("some error" ))
951953 })
952954
953- It ("calls the condition manager to report" , func () {
954- _ , _ = reconciler .Reconcile (ctx , req )
955- Expect (conditionManager .AddPositiveArgsForCall (1 )).To (Equal (conditions .MissingValueAtPathCondition (true , stampedObject , "this.wont.find.anything" , "mything.thing.io" )))
955+ Context ("and the RetrieveOutputError reports object as healthy" , func () {
956+ BeforeEach (func () {
957+ healthy = metav1 .ConditionTrue
958+ })
959+
960+ It ("calls the condition manager to report" , func () {
961+ _ , _ = reconciler .Reconcile (ctx , req )
962+ Expect (conditionManager .AddPositiveArgsForCall (1 )).To (Equal (conditions .MissingValueAtPathCondition (true , stampedObject , "this.wont.find.anything" , "mything.thing.io" , metav1 .ConditionTrue )))
963+ })
964+ })
965+
966+ Context ("and the RetrieveOutputError reports object as unhealthy" , func () {
967+ BeforeEach (func () {
968+ healthy = metav1 .ConditionFalse
969+ })
970+
971+ It ("calls the condition manager to report" , func () {
972+ _ , _ = reconciler .Reconcile (ctx , req )
973+ Expect (conditionManager .AddPositiveArgsForCall (1 )).To (Equal (conditions .MissingValueAtPathCondition (true , stampedObject , "this.wont.find.anything" , "mything.thing.io" , metav1 .ConditionFalse )))
974+ })
975+ })
976+
977+ Context ("and the RetrieveOutputError reports object health as unknown" , func () {
978+ BeforeEach (func () {
979+ healthy = metav1 .ConditionUnknown
980+ })
981+
982+ It ("calls the condition manager to report" , func () {
983+ _ , _ = reconciler .Reconcile (ctx , req )
984+ Expect (conditionManager .AddPositiveArgsForCall (1 )).To (Equal (conditions .MissingValueAtPathCondition (true , stampedObject , "this.wont.find.anything" , "mything.thing.io" , metav1 .ConditionUnknown )))
985+ })
956986 })
957987
958988 It ("does not return an error" , func () {
0 commit comments