Skip to content

Commit

Permalink
update placement doc
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Le <[email protected]>
  • Loading branch information
elgnay committed Jun 3, 2021
1 parent a6845f2 commit b90308d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: "PlacementDecision indicates a decision from a placement PlacementDecision
description: PlacementDecision indicates a decision from a placement PlacementDecision
should has a label cluster.open-cluster-management.io/placement={placement
name} to reference a certain placement. \n If a placement has spec.numberOfClusters
specified, the total number of decisions contained in status.decisions of
PlacementDecisions should always be NumberOfClusters; otherwise, the total
number of decisions should be the number of ManagedClusters which match
the placement requirements. \n Some of the decisions might be empty when
there are no enough ManagedClusters meet the placement requirements."
name} to reference a certain placement.
type: object
properties:
apiVersion:
Expand All @@ -45,8 +40,10 @@ spec:
properties:
decisions:
description: Decisions is a slice of decisions according to a placement
The number of decisions should not be larger than 100
The number of decisions should not be larger than 100. The slice
should not include any empty ClusterDecision.
type: array
maxItems: 100
items:
description: ClusterDecision represents a decision from a placement
An empty ClusterDecision indicates it is not scheduled yet.
Expand All @@ -57,8 +54,8 @@ spec:
properties:
clusterName:
description: ClusterName is the name of the ManagedCluster.
If it is not empty, its value should be unique cross all placement
decisions for the Placement.
Its value should be unique cross all placement decisions for
a certian Placement.
type: string
reason:
description: Reason represents the reason why the ManagedCluster
Expand Down
20 changes: 8 additions & 12 deletions cluster/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@ type PlacementStatus struct {

const (
// PlacementConditionSatisfied means Placement requirements are satisfied.
// A placement is not satisfied only if there is empty ClusterDecision in the status.decisions
// of PlacementDecisions.
// A placement is not satisfied only if
// 1) No ManagedClusterSetBinding is found in the placement namespace;
// 2) NumberOfClusters in spec is specified and NumberOfSelectedClusters in status is less than it;
PlacementConditionSatisfied string = "PlacementSatisfied"
)

Expand All @@ -303,13 +304,6 @@ type PlacementList struct {
// PlacementDecision indicates a decision from a placement
// PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name}
// to reference a certain placement.
//
// If a placement has spec.numberOfClusters specified, the total number of decisions contained in
// status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total
// number of decisions should be the number of ManagedClusters which match the placement requirements.
//
// Some of the decisions might be empty when there are no enough ManagedClusters meet the placement
// requirements.
type PlacementDecision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -322,17 +316,19 @@ type PlacementDecision struct {
// PlacementDecisionStatus represents the current status of the PlacementDecision.
type PlacementDecisionStatus struct {
// Decisions is a slice of decisions according to a placement
// The number of decisions should not be larger than 100
// The number of decisions should not be larger than 100.
// The slice should not include any empty ClusterDecision.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxItems=100
// +required
Decisions []ClusterDecision `json:"decisions"`
}

// ClusterDecision represents a decision from a placement
// An empty ClusterDecision indicates it is not scheduled yet.
type ClusterDecision struct {
// ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all
// placement decisions for the Placement.
// ClusterName is the name of the ManagedCluster. Its value should be unique cross all
// placement decisions for a certian Placement.
// +kubebuilder:validation:Required
// +required
ClusterName string `json:"clusterName"`
Expand Down
6 changes: 3 additions & 3 deletions cluster/v1alpha1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b90308d

Please sign in to comment.