Skip to content

Commit 6d86cfb

Browse files
committed
update placement doc
Signed-off-by: Yang Le <[email protected]>
1 parent a6845f2 commit 6d86cfb

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

cluster/v1alpha1/0000_04_clusters.open-cluster-management.io_placementdecisions.crd.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ spec:
1515
- name: v1alpha1
1616
schema:
1717
openAPIV3Schema:
18-
description: "PlacementDecision indicates a decision from a placement PlacementDecision
18+
description: PlacementDecision indicates a decision from a placement PlacementDecision
1919
should has a label cluster.open-cluster-management.io/placement={placement
20-
name} to reference a certain placement. \n If a placement has spec.numberOfClusters
21-
specified, the total number of decisions contained in status.decisions of
22-
PlacementDecisions should always be NumberOfClusters; otherwise, the total
23-
number of decisions should be the number of ManagedClusters which match
24-
the placement requirements. \n Some of the decisions might be empty when
25-
there are no enough ManagedClusters meet the placement requirements."
20+
name} to reference a certain placement.
2621
type: object
2722
properties:
2823
apiVersion:
@@ -45,7 +40,8 @@ spec:
4540
properties:
4641
decisions:
4742
description: Decisions is a slice of decisions according to a placement
48-
The number of decisions should not be larger than 100
43+
The number of decisions should not be larger than 100. The slice
44+
should not include any empty ClusterDecision.
4945
type: array
5046
items:
5147
description: ClusterDecision represents a decision from a placement
@@ -57,8 +53,8 @@ spec:
5753
properties:
5854
clusterName:
5955
description: ClusterName is the name of the ManagedCluster.
60-
If it is not empty, its value should be unique cross all placement
61-
decisions for the Placement.
56+
Its value should be unique cross all placement decisions for
57+
a certian Placement.
6258
type: string
6359
reason:
6460
description: Reason represents the reason why the ManagedCluster

cluster/v1alpha1/types.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,9 @@ type PlacementStatus struct {
276276

277277
const (
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.
313307
type 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.
323317
type 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.
333328
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.
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"`

cluster/v1alpha1/zz_generated.swagger_doc_generated.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)