From e2a0eeda76dade363b292f52935a69ea03422d55 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Mon, 23 Nov 2020 09:55:21 +0800 Subject: [PATCH] update membercluster and work API, mark conditions optional Signed-off-by: Kevin Wang --- .../propagationstrategy.karmada.io_propagationworks.yaml | 3 --- pkg/apis/membercluster/v1alpha1/types.go | 4 ++++ pkg/apis/propagationstrategy/v1alpha1/work_types.go | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/artifacts/deploy/propagationstrategy.karmada.io_propagationworks.yaml b/artifacts/deploy/propagationstrategy.karmada.io_propagationworks.yaml index 1097da8b1..5ed169006 100644 --- a/artifacts/deploy/propagationstrategy.karmada.io_propagationworks.yaml +++ b/artifacts/deploy/propagationstrategy.karmada.io_propagationworks.yaml @@ -250,12 +250,9 @@ spec: - version type: object required: - - conditions - identifier type: object type: array - required: - - conditions type: object required: - spec diff --git a/pkg/apis/membercluster/v1alpha1/types.go b/pkg/apis/membercluster/v1alpha1/types.go index 060868a3c..6b27fb130 100644 --- a/pkg/apis/membercluster/v1alpha1/types.go +++ b/pkg/apis/membercluster/v1alpha1/types.go @@ -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"` } diff --git a/pkg/apis/propagationstrategy/v1alpha1/work_types.go b/pkg/apis/propagationstrategy/v1alpha1/work_types.go index 5c13446e5..a9280ff4f 100644 --- a/pkg/apis/propagationstrategy/v1alpha1/work_types.go +++ b/pkg/apis/propagationstrategy/v1alpha1/work_types.go @@ -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.