@@ -276,8 +276,9 @@ 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 only if
280+ // 1) NumberOfClusters in spec is specified;
281+ // 2) NumberOfSelectedClusters in status is less than NumberOfClusters in spec;
281282 PlacementConditionSatisfied string = "PlacementSatisfied"
282283)
283284
@@ -303,13 +304,6 @@ type PlacementList struct {
303304// PlacementDecision indicates a decision from a placement
304305// PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name}
305306// 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.
313307type PlacementDecision struct {
314308 metav1.TypeMeta `json:",inline"`
315309 metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -322,7 +316,8 @@ type PlacementDecision struct {
322316// PlacementDecisionStatus represents the current status of the PlacementDecision.
323317type PlacementDecisionStatus struct {
324318 // Decisions is a slice of decisions according to a placement
325- // The number of decisions should not be larger than 100
319+ // The number of decisions should not be larger than 100.
320+ // The slice should not include any empty ClusterDecision.
326321 // +kubebuilder:validation:Required
327322 // +required
328323 Decisions []ClusterDecision `json:"decisions"`
@@ -331,8 +326,8 @@ type PlacementDecisionStatus struct {
331326// ClusterDecision represents a decision from a placement
332327// An empty ClusterDecision indicates it is not scheduled yet.
333328type 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.
329+ // ClusterName is the name of the ManagedCluster. Its value should be unique cross all
330+ // placement decisions for a certian Placement.
336331 // +kubebuilder:validation:Required
337332 // +required
338333 ClusterName string `json:"clusterName"`
0 commit comments