@@ -1049,11 +1049,23 @@ func setAllWorkAppliedCondition(works map[string]*fleetv1beta1.Work, binding *fl
10491049 case len (works ) == 0 :
10501050 // No Work objects are associated with the binding.
10511051 klog .V (2 ).InfoS ("No works are associated with the binding" , "binding" , klog .KObj (binding ))
1052+ cond := binding .GetCondition (string (fleetv1beta1 .ResourceBindingOverridden ))
1053+ if cond != nil && cond .Reason == condition .OverriddenSucceededReason {
1054+ // The resources were deleted by override operation
1055+ binding .SetConditions (metav1.Condition {
1056+ Status : metav1 .ConditionTrue ,
1057+ Type : string (fleetv1beta1 .ResourceBindingApplied ),
1058+ Reason : condition .AllWorkAppliedReason ,
1059+ Message : "All corresponding work objects are applied" ,
1060+ ObservedGeneration : binding .GetGeneration (),
1061+ })
1062+ return workConditionSummarizedStatusTrue
1063+ }
10521064 binding .SetConditions (metav1.Condition {
10531065 Status : metav1 .ConditionFalse ,
10541066 Type : string (fleetv1beta1 .ResourceBindingApplied ),
10551067 Reason : condition .WorkNotAppliedReason ,
1056- Message : "No work objects are associated with the binding because no resources were selected. Update CRP spec to select resources. " ,
1068+ Message : "No resources were selected. Update CRP spec to select existing resources or create resources on hub cluster " ,
10571069 ObservedGeneration : binding .GetGeneration (),
10581070 })
10591071 return workConditionSummarizedStatusFalse
0 commit comments