From 561474f652a083e5049a9a5885b9942894c65f0d Mon Sep 17 00:00:00 2001 From: Garrybest Date: Sat, 30 Oct 2021 20:33:47 +0800 Subject: [PATCH] change StaticWeightList to optional Signed-off-by: Garrybest --- .../bases/policy.karmada.io_clusterpropagationpolicies.yaml | 2 -- charts/_crds/bases/policy.karmada.io_propagationpolicies.yaml | 2 -- .../bases/policy.karmada.io_replicaschedulingpolicies.yaml | 2 -- pkg/apis/policy/v1alpha1/replicascheduling_types.go | 4 ++-- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/charts/_crds/bases/policy.karmada.io_clusterpropagationpolicies.yaml b/charts/_crds/bases/policy.karmada.io_clusterpropagationpolicies.yaml index b33d8ddb9..7e6d3d433 100644 --- a/charts/_crds/bases/policy.karmada.io_clusterpropagationpolicies.yaml +++ b/charts/_crds/bases/policy.karmada.io_clusterpropagationpolicies.yaml @@ -384,8 +384,6 @@ spec: - weight type: object type: array - required: - - staticWeightList type: object type: object spreadConstraints: diff --git a/charts/_crds/bases/policy.karmada.io_propagationpolicies.yaml b/charts/_crds/bases/policy.karmada.io_propagationpolicies.yaml index 667d65a29..90b2bfc39 100644 --- a/charts/_crds/bases/policy.karmada.io_propagationpolicies.yaml +++ b/charts/_crds/bases/policy.karmada.io_propagationpolicies.yaml @@ -380,8 +380,6 @@ spec: - weight type: object type: array - required: - - staticWeightList type: object type: object spreadConstraints: diff --git a/charts/_crds/bases/policy.karmada.io_replicaschedulingpolicies.yaml b/charts/_crds/bases/policy.karmada.io_replicaschedulingpolicies.yaml index 6febc8419..27a7eff0e 100644 --- a/charts/_crds/bases/policy.karmada.io_replicaschedulingpolicies.yaml +++ b/charts/_crds/bases/policy.karmada.io_replicaschedulingpolicies.yaml @@ -173,8 +173,6 @@ spec: - weight type: object type: array - required: - - staticWeightList type: object resourceSelectors: description: ResourceSelectors used to select resources. diff --git a/pkg/apis/policy/v1alpha1/replicascheduling_types.go b/pkg/apis/policy/v1alpha1/replicascheduling_types.go index 164af0e4c..512818567 100644 --- a/pkg/apis/policy/v1alpha1/replicascheduling_types.go +++ b/pkg/apis/policy/v1alpha1/replicascheduling_types.go @@ -35,8 +35,8 @@ type ReplicaSchedulingSpec struct { // ClusterPreferences describes weight for each cluster or for each group of cluster. type ClusterPreferences struct { // StaticWeightList defines the static cluster weight. - // +required - StaticWeightList []StaticClusterWeight `json:"staticWeightList"` + // +optional + StaticWeightList []StaticClusterWeight `json:"staticWeightList,omitempty"` // DynamicWeight specifies the factor to generates dynamic weight list. // If specified, StaticWeightList will be ignored. // +kubebuilder:validation:Enum=AvailableReplicas