Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelawyu committed Jan 18, 2025
1 parent 0d057e7 commit 4540d2f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/controllers/clusterresourceplacement/placement_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ func (r *Reconciler) setScheduledResourcePlacementStatuses(
clusterDecision := selected[idx]
rps := &fleetv1beta1.ResourcePlacementStatus{}

// Port back the old conditions.
// This is necessary for Fleet to track the last transition times correctly.
if oldConds, ok := oldRPSMap[clusterDecision.ClusterName]; ok {
rps.Conditions = oldConds
}

// Set the scheduled condition.
scheduledCondition := metav1.Condition{
Status: metav1.ConditionTrue,
Expand All @@ -159,12 +165,6 @@ func (r *Reconciler) setScheduledResourcePlacementStatuses(
// Set the cluster name.
rps.ClusterName = clusterDecision.ClusterName

// Port back the old conditions.
// This is necessary for Fleet to track the last transition times correctly.
if oldConds, ok := oldRPSMap[clusterDecision.ClusterName]; ok {
rps.Conditions = oldConds
}

// Prepare the new conditions.
binding := bindingMap[clusterDecision.ClusterName]
setStatusByCondType, err := r.setResourcePlacementStatusPerCluster(crp, latestClusterResourceSnapshot, binding, rps, expectedCondTypes)
Expand Down

0 comments on commit 4540d2f

Please sign in to comment.