mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-18 17:21:23 +00:00
feature(scheduler): implement matchLabelKeys in PodAffinity and PodAntiAffinity
Kubernetes-commit: d5d3c26337af418555fe6f62f86b9aaf38dc59d3
This commit is contained in:
parent
5f697abdfd
commit
a46288252b
@ -29,6 +29,8 @@ type PodAffinityTermApplyConfiguration struct {
|
|||||||
Namespaces []string `json:"namespaces,omitempty"`
|
Namespaces []string `json:"namespaces,omitempty"`
|
||||||
TopologyKey *string `json:"topologyKey,omitempty"`
|
TopologyKey *string `json:"topologyKey,omitempty"`
|
||||||
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
|
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
|
||||||
|
MatchLabelKeys []string `json:"matchLabelKeys,omitempty"`
|
||||||
|
MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodAffinityTermApplyConfiguration constructs an declarative configuration of the PodAffinityTerm type for use with
|
// PodAffinityTermApplyConfiguration constructs an declarative configuration of the PodAffinityTerm type for use with
|
||||||
@ -70,3 +72,23 @@ func (b *PodAffinityTermApplyConfiguration) WithNamespaceSelector(value *v1.Labe
|
|||||||
b.NamespaceSelector = value
|
b.NamespaceSelector = value
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithMatchLabelKeys adds the given value to the MatchLabelKeys field in the declarative configuration
|
||||||
|
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||||
|
// If called multiple times, values provided by each call will be appended to the MatchLabelKeys field.
|
||||||
|
func (b *PodAffinityTermApplyConfiguration) WithMatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration {
|
||||||
|
for i := range values {
|
||||||
|
b.MatchLabelKeys = append(b.MatchLabelKeys, values[i])
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithMismatchLabelKeys adds the given value to the MismatchLabelKeys field in the declarative configuration
|
||||||
|
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||||
|
// If called multiple times, values provided by each call will be appended to the MismatchLabelKeys field.
|
||||||
|
func (b *PodAffinityTermApplyConfiguration) WithMismatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration {
|
||||||
|
for i := range values {
|
||||||
|
b.MismatchLabelKeys = append(b.MismatchLabelKeys, values[i])
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
@ -6272,6 +6272,18 @@ var schemaYAML = typed.YAMLObject(`types:
|
|||||||
- name: labelSelector
|
- name: labelSelector
|
||||||
type:
|
type:
|
||||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
||||||
|
- name: matchLabelKeys
|
||||||
|
type:
|
||||||
|
list:
|
||||||
|
elementType:
|
||||||
|
scalar: string
|
||||||
|
elementRelationship: atomic
|
||||||
|
- name: mismatchLabelKeys
|
||||||
|
type:
|
||||||
|
list:
|
||||||
|
elementType:
|
||||||
|
scalar: string
|
||||||
|
elementRelationship: atomic
|
||||||
- name: namespaceSelector
|
- name: namespaceSelector
|
||||||
type:
|
type:
|
||||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
||||||
|
Loading…
Reference in New Issue
Block a user