code generated by script for MatchLabelKeys in TopologySpreadConstraint

Signed-off-by: Alex Wang <wangqingcan1990@gmail.com>

Kubernetes-commit: 86a2a85e7dd0a650020bf407a6eb85b956653539
This commit is contained in:
Alex Wang
2022-07-30 13:24:55 +08:00
committed by Kubernetes Publisher
parent 95367f2044
commit 2190b2f23b
2 changed files with 17 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ type TopologySpreadConstraintApplyConfiguration struct {
MinDomains *int32 `json:"minDomains,omitempty"`
NodeAffinityPolicy *v1.NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty"`
NodeTaintsPolicy *v1.NodeInclusionPolicy `json:"nodeTaintsPolicy,omitempty"`
MatchLabelKeys []string `json:"matchLabelKeys,omitempty"`
}
// TopologySpreadConstraintApplyConfiguration constructs an declarative configuration of the TopologySpreadConstraint type for use with
@@ -96,3 +97,13 @@ func (b *TopologySpreadConstraintApplyConfiguration) WithNodeTaintsPolicy(value
b.NodeTaintsPolicy = &value
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 *TopologySpreadConstraintApplyConfiguration) WithMatchLabelKeys(values ...string) *TopologySpreadConstraintApplyConfiguration {
for i := range values {
b.MatchLabelKeys = append(b.MatchLabelKeys, values[i])
}
return b
}