update membercluster and work API, mark conditions optional

Signed-off-by: Kevin Wang <kevinwzf0126@gmail.com>
This commit is contained in:
Kevin Wang 2020-11-23 09:55:21 +08:00 committed by Hongcai Ren
parent e6ed8df1e5
commit e2a0eeda76
3 changed files with 8 additions and 5 deletions

View File

@ -250,12 +250,9 @@ spec:
- version
type: object
required:
- conditions
- identifier
type: object
type: array
required:
- conditions
type: object
required:
- spec

View File

@ -99,9 +99,11 @@ type MemberClusterStatus struct {
APIEnablements []APIEnablement `json:"apiEnablements,omitempty"`
// Conditions is an array of current cluster conditions.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// NodeSummary represents the summary of nodes status in the member cluster.
// +optional
NodeSummary NodeSummary `json:"nodeSummary,omitempty"`
}
@ -132,5 +134,7 @@ type NodeSummary struct {
type MemberClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items holds a list of MemberCluster.
Items []MemberCluster `json:"items"`
}

View File

@ -49,7 +49,8 @@ type PropagationWorkStatus struct {
// 3. Available represents workload in PropagationWork exists on the managed cluster.
// 4. Degraded represents the current state of workload does not match the desired
// state for a certain period.
Conditions []metav1.Condition `json:"conditions"`
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ManifestConditions represents the conditions of each Kubernetes resource in work
// deployed on managed cluster.
@ -64,7 +65,8 @@ type ManifestCondition struct {
Identifier ResourceIdentifier `json:"identifier"`
// Conditions represents the conditions of this resource on the managed cluster
Conditions []metav1.Condition `json:"conditions"`
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
// ResourceIdentifier provides the identifiers needed to interact with any arbitrary object.