@@ -276,8 +276,15 @@ type PlacementStatus struct {
276
276
277
277
const (
278
278
// 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;
281
288
PlacementConditionSatisfied string = "PlacementSatisfied"
282
289
)
283
290
@@ -303,13 +310,6 @@ type PlacementList struct {
303
310
// PlacementDecision indicates a decision from a placement
304
311
// PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name}
305
312
// 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.
313
313
type PlacementDecision struct {
314
314
metav1.TypeMeta `json:",inline"`
315
315
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -322,17 +322,19 @@ type PlacementDecision struct {
322
322
// PlacementDecisionStatus represents the current status of the PlacementDecision.
323
323
type PlacementDecisionStatus struct {
324
324
// 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.
326
327
// +kubebuilder:validation:Required
328
+ // +kubebuilder:validation:MaxItems=100
327
329
// +required
328
330
Decisions []ClusterDecision `json:"decisions"`
329
331
}
330
332
331
333
// ClusterDecision represents a decision from a placement
332
334
// An empty ClusterDecision indicates it is not scheduled yet.
333
335
type 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.
336
338
// +kubebuilder:validation:Required
337
339
// +required
338
340
ClusterName string `json:"clusterName"`
0 commit comments