feat: add NodeInclusionPolicy to TopologySpreadConstraint in PodSpec

Signed-off-by: kerthcet <kerthcet@gmail.com>

Kubernetes-commit: 02f0a3ee91e43d39da80df926f552b8934a4646d
This commit is contained in:
kerthcet 2022-05-10 12:54:49 +08:00 committed by Kubernetes Publisher
parent 24209264f7
commit 5bb1a76702
2 changed files with 29 additions and 5 deletions

View File

@ -26,11 +26,13 @@ import (
// TopologySpreadConstraintApplyConfiguration represents an declarative configuration of the TopologySpreadConstraint type for use
// with apply.
type TopologySpreadConstraintApplyConfiguration struct {
MaxSkew *int32 `json:"maxSkew,omitempty"`
TopologyKey *string `json:"topologyKey,omitempty"`
WhenUnsatisfiable *v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable,omitempty"`
LabelSelector *metav1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"`
MinDomains *int32 `json:"minDomains,omitempty"`
MaxSkew *int32 `json:"maxSkew,omitempty"`
TopologyKey *string `json:"topologyKey,omitempty"`
WhenUnsatisfiable *v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable,omitempty"`
LabelSelector *metav1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"`
MinDomains *int32 `json:"minDomains,omitempty"`
NodeAffinityPolicy *v1.NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty"`
NodeTaintsPolicy *v1.NodeInclusionPolicy `json:"nodeTaintsPolicy,omitempty"`
}
// TopologySpreadConstraintApplyConfiguration constructs an declarative configuration of the TopologySpreadConstraint type for use with
@ -78,3 +80,19 @@ func (b *TopologySpreadConstraintApplyConfiguration) WithMinDomains(value int32)
b.MinDomains = &value
return b
}
// WithNodeAffinityPolicy sets the NodeAffinityPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeAffinityPolicy field is set to the value of the last call.
func (b *TopologySpreadConstraintApplyConfiguration) WithNodeAffinityPolicy(value v1.NodeInclusionPolicy) *TopologySpreadConstraintApplyConfiguration {
b.NodeAffinityPolicy = &value
return b
}
// WithNodeTaintsPolicy sets the NodeTaintsPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeTaintsPolicy field is set to the value of the last call.
func (b *TopologySpreadConstraintApplyConfiguration) WithNodeTaintsPolicy(value v1.NodeInclusionPolicy) *TopologySpreadConstraintApplyConfiguration {
b.NodeTaintsPolicy = &value
return b
}

View File

@ -6865,6 +6865,12 @@ var schemaYAML = typed.YAMLObject(`types:
- name: minDomains
type:
scalar: numeric
- name: nodeAffinityPolicy
type:
scalar: string
- name: nodeTaintsPolicy
type:
scalar: string
- name: topologyKey
type:
scalar: string