You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
annErr:=fmt.Errorf("%w: the policySnapshot `%s` doesn't have valid cluster count annotation", err, latestPolicySnapshot.Name)
124
-
klog.ErrorS(controller.NewUnexpectedBehaviorError(annErr), "Failed to get the cluster count from the latestPolicySnapshot", "clusterResourcePlacement", placementName, "latestPolicySnapshot", latestPolicySnapshot.Name, "clusterStagedUpdateRun", updateRunRef)
122
+
iflatestPolicySnapshot.Spec.Policy==nil {
123
+
nopolicyErr:=fmt.Errorf("policy snapshot `%s` does not have a policy", latestPolicySnapshot.Name)
124
+
klog.ErrorS(controller.NewUnexpectedBehaviorError(nopolicyErr), "Failed to get the policy from the latestPolicySnapshot", "clusterResourcePlacement", placementName, "latestPolicySnapshot", latestPolicySnapshot.Name, "clusterStagedUpdateRun", updateRunRef)
annErr:=fmt.Errorf("%w: the policy snapshot `%s` doesn't have valid cluster count annotation", err, latestPolicySnapshot.Name)
134
+
klog.ErrorS(controller.NewUnexpectedBehaviorError(annErr), "Failed to get the cluster count from the latestPolicySnapshot", "clusterResourcePlacement", placementName, "latestPolicySnapshot", latestPolicySnapshot.Name, "clusterStagedUpdateRun", updateRunRef)
scheduleErr:=fmt.Errorf("policy snapshot `%s` not fully scheduled yet", latestPolicySnapshot.Name)
133
147
klog.ErrorS(scheduleErr, "The policy snapshot is not scheduled successfully", "clusterResourcePlacement", placementName, "latestPolicySnapshot", latestPolicySnapshot.Name, "clusterStagedUpdateRun", updateRunRef)
134
-
// hmmmm, should we retry and see if the policy snapshot is scheduled later?
returnnil, nil, controller.NewUnexpectedBehaviorError(fmt.Errorf("binding `%s`'s state %s is not scheduled or bound", binding.Name, binding.Spec.State))
emptyErr:=fmt.Errorf("stage `%s` has no clusters selected", stage.Name)
292
-
klog.ErrorS(emptyErr, "No cluster is selected for the stage", "clusterStagedUpdateStrategy", updateStrategyName, "stage name", stage.Name, "clusterStagedUpdateRun", updateRunRef)
// Sort the clusters in the stage based on the SortingLabelKey and cluster name.
298
-
sort.Slice(curStageClusters, func(i, jint) bool {
299
-
ifstage.SortingLabelKey==nil {
303
+
// since we allow no selected bindings, a stage can be empty.
304
+
klog.InfoS("No cluster is selected for the stage", "clusterStagedUpdateStrategy", updateStrategyName, "stage name", stage.Name, "clusterStagedUpdateRun", updateRunRef)
305
+
} else {
306
+
// Sort the clusters in the stage based on the SortingLabelKey and cluster name.
0 commit comments