1 /* 2 Copyright The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1 20 21 import ( 22 v1 "k8s.io/client-go/applyconfigurations/meta/v1" 23 ) 24 25 // PodAffinityTermApplyConfiguration represents an declarative configuration of the PodAffinityTerm type for use 26 // with apply. 27 type PodAffinityTermApplyConfiguration struct { 28 LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` 29 Namespaces []string `json:"namespaces,omitempty"` 30 TopologyKey *string `json:"topologyKey,omitempty"` 31 NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` 32 MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` 33 MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` 34 } 35 36 // PodAffinityTermApplyConfiguration constructs an declarative configuration of the PodAffinityTerm type for use with 37 // apply. 38 func PodAffinityTerm() *PodAffinityTermApplyConfiguration { 39 return &PodAffinityTermApplyConfiguration{} 40 } 41 42 // WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value 43 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 // If called multiple times, the LabelSelector field is set to the value of the last call. 45 func (b *PodAffinityTermApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *PodAffinityTermApplyConfiguration { 46 b.LabelSelector = value 47 return b 48 } 49 50 // WithNamespaces adds the given value to the Namespaces field in the declarative configuration 51 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 52 // If called multiple times, values provided by each call will be appended to the Namespaces field. 53 func (b *PodAffinityTermApplyConfiguration) WithNamespaces(values ...string) *PodAffinityTermApplyConfiguration { 54 for i := range values { 55 b.Namespaces = append(b.Namespaces, values[i]) 56 } 57 return b 58 } 59 60 // WithTopologyKey sets the TopologyKey field in the declarative configuration to the given value 61 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 62 // If called multiple times, the TopologyKey field is set to the value of the last call. 63 func (b *PodAffinityTermApplyConfiguration) WithTopologyKey(value string) *PodAffinityTermApplyConfiguration { 64 b.TopologyKey = &value 65 return b 66 } 67 68 // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value 69 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 70 // If called multiple times, the NamespaceSelector field is set to the value of the last call. 71 func (b *PodAffinityTermApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *PodAffinityTermApplyConfiguration { 72 b.NamespaceSelector = value 73 return b 74 } 75 76 // WithMatchLabelKeys adds the given value to the MatchLabelKeys field in the declarative configuration 77 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 78 // If called multiple times, values provided by each call will be appended to the MatchLabelKeys field. 79 func (b *PodAffinityTermApplyConfiguration) WithMatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { 80 for i := range values { 81 b.MatchLabelKeys = append(b.MatchLabelKeys, values[i]) 82 } 83 return b 84 } 85 86 // WithMismatchLabelKeys adds the given value to the MismatchLabelKeys field in the declarative configuration 87 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 88 // If called multiple times, values provided by each call will be appended to the MismatchLabelKeys field. 89 func (b *PodAffinityTermApplyConfiguration) WithMismatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { 90 for i := range values { 91 b.MismatchLabelKeys = append(b.MismatchLabelKeys, values[i]) 92 } 93 return b 94 } 95