@@ -276,8 +276,15 @@ type PlacementStatus struct {
276276
277277const (
278278 // PlacementConditionSatisfied means Placement requirements are satisfied.
279- // A placement is not satisfied only if there is empty ClusterDecision in the status.decisions
280- // of PlacementDecisions.
279+ // A placement is not satisfied if
280+ // 1) No ManagedClusterSetBinding is found in the placement namespace;
281+ // 2) ClusterSets in spec is specified and none of them is bound to the placement namespace;
282+ // 3) No memeber ManagedCluster is found for all eligible ManagedClusterSets; A ManagedClusterSet
283+ // is eligible for a placement if
284+ // a) It is bound to the placement namespace;
285+ // b) And if ClusterSets in spec is specified, it is in the list;
286+ // 4) No ManagedCluster matches any of the cluster predicates of the placement;
287+ // 5) NumberOfClusters in spec is specified and NumberOfSelectedClusters in status is less than it;
281288 PlacementConditionSatisfied string = "PlacementSatisfied"
282289)
283290
@@ -303,13 +310,6 @@ type PlacementList struct {
303310// PlacementDecision indicates a decision from a placement
304311// PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name}
305312// to reference a certain placement.
306- //
307- // If a placement has spec.numberOfClusters specified, the total number of decisions contained in
308- // status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total
309- // number of decisions should be the number of ManagedClusters which match the placement requirements.
310- //
311- // Some of the decisions might be empty when there are no enough ManagedClusters meet the placement
312- // requirements.
313313type PlacementDecision struct {
314314 metav1.TypeMeta `json:",inline"`
315315 metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -322,17 +322,19 @@ type PlacementDecision struct {
322322// PlacementDecisionStatus represents the current status of the PlacementDecision.
323323type PlacementDecisionStatus struct {
324324 // Decisions is a slice of decisions according to a placement
325- // The number of decisions should not be larger than 100
325+ // The number of decisions should not be larger than 100.
326+ // The slice should not include any empty ClusterDecision.
326327 // +kubebuilder:validation:Required
328+ // +kubebuilder:validation:MaxItems=100
327329 // +required
328330 Decisions []ClusterDecision `json:"decisions"`
329331}
330332
331333// ClusterDecision represents a decision from a placement
332334// An empty ClusterDecision indicates it is not scheduled yet.
333335type ClusterDecision struct {
334- // ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all
335- // placement decisions for the Placement.
336+ // ClusterName is the name of the ManagedCluster. Its value should be unique cross all
337+ // placement decisions for a certian Placement.
336338 // +kubebuilder:validation:Required
337339 // +required
338340 ClusterName string `json:"clusterName"`
0 commit comments