Add more comments about filed selector in cluster affinity.

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
This commit is contained in:
RainbowMango 2023-03-07 11:52:39 +08:00
parent eb569ff9b6
commit 75f27339ce
9 changed files with 88 additions and 40 deletions

View File

@ -15052,7 +15052,7 @@
} }
}, },
"fieldSelector": { "fieldSelector": {
"description": "FieldSelector is a filter to select member clusters by fields. If non-nil and non-empty, only the clusters match this filter will be selected.", "description": "FieldSelector is a filter to select member clusters by fields. The key(field) of the match expression should be 'provider', 'region', or 'zone', and the operator of the match expression should be 'In' or 'NotIn'. If non-nil and non-empty, only the clusters match this filter will be selected.",
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldSelector" "$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldSelector"
}, },
"labelSelector": { "labelSelector": {
@ -15090,7 +15090,7 @@
} }
}, },
"fieldSelector": { "fieldSelector": {
"description": "FieldSelector is a filter to select member clusters by fields. If non-nil and non-empty, only the clusters match this filter will be selected.", "description": "FieldSelector is a filter to select member clusters by fields. The key(field) of the match expression should be 'provider', 'region', or 'zone', and the operator of the match expression should be 'In' or 'NotIn'. If non-nil and non-empty, only the clusters match this filter will be selected.",
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldSelector" "$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldSelector"
}, },
"labelSelector": { "labelSelector": {

View File

@ -281,8 +281,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the clusters by fields. The key(field) of the match expression
clusters match this filter will be selected. should be 'provider', 'region', or 'zone', and the operator
of the match expression should be 'In' or 'NotIn'. If
non-nil and non-empty, only the clusters match this filter
will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -669,8 +672,10 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member clusters description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match by fields. The key(field) of the match expression should be
this filter will be selected. 'provider', 'region', or 'zone', and the operator of the match
expression should be 'In' or 'NotIn'. If non-nil and non-empty,
only the clusters match this filter will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.

View File

@ -109,8 +109,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the clusters by fields. The key(field) of the match expression
clusters match this filter will be selected. should be 'provider', 'region', or 'zone', and the operator
of the match expression should be 'In' or 'NotIn'. If
non-nil and non-empty, only the clusters match this filter
will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -217,8 +220,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member clusters description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match by fields. The key(field) of the match expression should
this filter will be selected. be 'provider', 'region', or 'zone', and the operator of
the match expression should be 'In' or 'NotIn'. If non-nil
and non-empty, only the clusters match this filter will
be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -412,9 +418,12 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select description: FieldSelector is a filter to select
member clusters by fields. If non-nil and member clusters by fields. The key(field)
non-empty, only the clusters match this filter of the match expression should be 'provider',
will be selected. 'region', or 'zone', and the operator of the
match expression should be 'In' or 'NotIn'.
If non-nil and non-empty, only the clusters
match this filter will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.

View File

@ -281,8 +281,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the clusters by fields. The key(field) of the match expression
clusters match this filter will be selected. should be 'provider', 'region', or 'zone', and the operator
of the match expression should be 'In' or 'NotIn'. If
non-nil and non-empty, only the clusters match this filter
will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -669,8 +672,10 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member clusters description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match by fields. The key(field) of the match expression should be
this filter will be selected. 'provider', 'region', or 'zone', and the operator of the match
expression should be 'In' or 'NotIn'. If non-nil and non-empty,
only the clusters match this filter will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.

View File

@ -105,8 +105,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the clusters by fields. The key(field) of the match expression
clusters match this filter will be selected. should be 'provider', 'region', or 'zone', and the operator
of the match expression should be 'In' or 'NotIn'. If
non-nil and non-empty, only the clusters match this filter
will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -213,8 +216,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member clusters description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match by fields. The key(field) of the match expression should
this filter will be selected. be 'provider', 'region', or 'zone', and the operator of
the match expression should be 'In' or 'NotIn'. If non-nil
and non-empty, only the clusters match this filter will
be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -408,9 +414,12 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select description: FieldSelector is a filter to select
member clusters by fields. If non-nil and member clusters by fields. The key(field)
non-empty, only the clusters match this filter of the match expression should be 'provider',
will be selected. 'region', or 'zone', and the operator of the
match expression should be 'In' or 'NotIn'.
If non-nil and non-empty, only the clusters
match this filter will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.

View File

@ -372,8 +372,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the clusters by fields. The key(field) of the match expression
clusters match this filter will be selected. should be 'provider', 'region', or 'zone', and the operator
of the match expression should be 'In' or 'NotIn'. If
non-nil and non-empty, only the clusters match this filter
will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -480,8 +483,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member clusters description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match by fields. The key(field) of the match expression should
this filter will be selected. be 'provider', 'region', or 'zone', and the operator of
the match expression should be 'In' or 'NotIn'. If non-nil
and non-empty, only the clusters match this filter will
be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -675,9 +681,12 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select description: FieldSelector is a filter to select
member clusters by fields. If non-nil and member clusters by fields. The key(field)
non-empty, only the clusters match this filter of the match expression should be 'provider',
will be selected. 'region', or 'zone', and the operator of the
match expression should be 'In' or 'NotIn'.
If non-nil and non-empty, only the clusters
match this filter will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.

View File

@ -372,8 +372,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the clusters by fields. The key(field) of the match expression
clusters match this filter will be selected. should be 'provider', 'region', or 'zone', and the operator
of the match expression should be 'In' or 'NotIn'. If
non-nil and non-empty, only the clusters match this filter
will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -480,8 +483,11 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select member clusters description: FieldSelector is a filter to select member clusters
by fields. If non-nil and non-empty, only the clusters match by fields. The key(field) of the match expression should
this filter will be selected. be 'provider', 'region', or 'zone', and the operator of
the match expression should be 'In' or 'NotIn'. If non-nil
and non-empty, only the clusters match this filter will
be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.
@ -675,9 +681,12 @@ spec:
type: array type: array
fieldSelector: fieldSelector:
description: FieldSelector is a filter to select description: FieldSelector is a filter to select
member clusters by fields. If non-nil and member clusters by fields. The key(field)
non-empty, only the clusters match this filter of the match expression should be 'provider',
will be selected. 'region', or 'zone', and the operator of the
match expression should be 'In' or 'NotIn'.
If non-nil and non-empty, only the clusters
match this filter will be selected.
properties: properties:
matchExpressions: matchExpressions:
description: A list of field selector requirements. description: A list of field selector requirements.

View File

@ -248,6 +248,8 @@ type ClusterAffinity struct {
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
// FieldSelector is a filter to select member clusters by fields. // FieldSelector is a filter to select member clusters by fields.
// The key(field) of the match expression should be 'provider', 'region', or 'zone',
// and the operator of the match expression should be 'In' or 'NotIn'.
// If non-nil and non-empty, only the clusters match this filter will be selected. // If non-nil and non-empty, only the clusters match this filter will be selected.
// +optional // +optional
FieldSelector *FieldSelector `json:"fieldSelector,omitempty"` FieldSelector *FieldSelector `json:"fieldSelector,omitempty"`

View File

@ -2160,7 +2160,7 @@ func schema_pkg_apis_policy_v1alpha1_ClusterAffinity(ref common.ReferenceCallbac
}, },
"fieldSelector": { "fieldSelector": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "FieldSelector is a filter to select member clusters by fields. If non-nil and non-empty, only the clusters match this filter will be selected.", Description: "FieldSelector is a filter to select member clusters by fields. The key(field) of the match expression should be 'provider', 'region', or 'zone', and the operator of the match expression should be 'In' or 'NotIn'. If non-nil and non-empty, only the clusters match this filter will be selected.",
Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.FieldSelector"), Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.FieldSelector"),
}, },
}, },
@ -2225,7 +2225,7 @@ func schema_pkg_apis_policy_v1alpha1_ClusterAffinityTerm(ref common.ReferenceCal
}, },
"fieldSelector": { "fieldSelector": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "FieldSelector is a filter to select member clusters by fields. If non-nil and non-empty, only the clusters match this filter will be selected.", Description: "FieldSelector is a filter to select member clusters by fields. The key(field) of the match expression should be 'provider', 'region', or 'zone', and the operator of the match expression should be 'In' or 'NotIn'. If non-nil and non-empty, only the clusters match this filter will be selected.",
Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.FieldSelector"), Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.FieldSelector"),
}, },
}, },