@@ -276,8 +276,9 @@ 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 only if
280
+ // 1) No ManagedClusterSetBinding is found in the placement namespace;
281
+ // 2) NumberOfClusters in spec is specified and NumberOfSelectedClusters in status is less than it;
281
282
PlacementConditionSatisfied string = "PlacementSatisfied"
282
283
)
283
284
@@ -303,13 +304,6 @@ type PlacementList struct {
303
304
// PlacementDecision indicates a decision from a placement
304
305
// PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name}
305
306
// 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
307
type PlacementDecision struct {
314
308
metav1.TypeMeta `json:",inline"`
315
309
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -322,17 +316,19 @@ type PlacementDecision struct {
322
316
// PlacementDecisionStatus represents the current status of the PlacementDecision.
323
317
type PlacementDecisionStatus struct {
324
318
// 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.
326
321
// +kubebuilder:validation:Required
322
+ // +kubebuilder:validation:MaxItems=100
327
323
// +required
328
324
Decisions []ClusterDecision `json:"decisions"`
329
325
}
330
326
331
327
// ClusterDecision represents a decision from a placement
332
328
// An empty ClusterDecision indicates it is not scheduled yet.
333
329
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.
330
+ // ClusterName is the name of the ManagedCluster. Its value should be unique cross all
331
+ // placement decisions for a certian Placement.
336
332
// +kubebuilder:validation:Required
337
333
// +required
338
334
ClusterName string `json:"clusterName"`
0 commit comments