1/* 2Copyright The Kubernetes Authors. 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13See the License for the specific language governing permissions and 14limitations under the License. 15*/ 16 17// Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19package v1 20 21// NodeSpecApplyConfiguration represents an declarative configuration of the NodeSpec type for use 22// with apply. 23type NodeSpecApplyConfiguration struct { 24 PodCIDR *string `json:"podCIDR,omitempty"` 25 PodCIDRs []string `json:"podCIDRs,omitempty"` 26 ProviderID *string `json:"providerID,omitempty"` 27 Unschedulable *bool `json:"unschedulable,omitempty"` 28 Taints []TaintApplyConfiguration `json:"taints,omitempty"` 29 ConfigSource *NodeConfigSourceApplyConfiguration `json:"configSource,omitempty"` 30 DoNotUseExternalID *string `json:"externalID,omitempty"` 31} 32 33// NodeSpecApplyConfiguration constructs an declarative configuration of the NodeSpec type for use with 34// apply. 35func NodeSpec() *NodeSpecApplyConfiguration { 36 return &NodeSpecApplyConfiguration{} 37} 38 39// WithPodCIDR sets the PodCIDR field in the declarative configuration to the given value 40// and returns the receiver, so that objects can be built by chaining "With" function invocations. 41// If called multiple times, the PodCIDR field is set to the value of the last call. 42func (b *NodeSpecApplyConfiguration) WithPodCIDR(value string) *NodeSpecApplyConfiguration { 43 b.PodCIDR = &value 44 return b 45} 46 47// WithPodCIDRs adds the given value to the PodCIDRs field in the declarative configuration 48// and returns the receiver, so that objects can be build by chaining "With" function invocations. 49// If called multiple times, values provided by each call will be appended to the PodCIDRs field. 50func (b *NodeSpecApplyConfiguration) WithPodCIDRs(values ...string) *NodeSpecApplyConfiguration { 51 for i := range values { 52 b.PodCIDRs = append(b.PodCIDRs, values[i]) 53 } 54 return b 55} 56 57// WithProviderID sets the ProviderID field in the declarative configuration to the given value 58// and returns the receiver, so that objects can be built by chaining "With" function invocations. 59// If called multiple times, the ProviderID field is set to the value of the last call. 60func (b *NodeSpecApplyConfiguration) WithProviderID(value string) *NodeSpecApplyConfiguration { 61 b.ProviderID = &value 62 return b 63} 64 65// WithUnschedulable sets the Unschedulable field in the declarative configuration to the given value 66// and returns the receiver, so that objects can be built by chaining "With" function invocations. 67// If called multiple times, the Unschedulable field is set to the value of the last call. 68func (b *NodeSpecApplyConfiguration) WithUnschedulable(value bool) *NodeSpecApplyConfiguration { 69 b.Unschedulable = &value 70 return b 71} 72 73// WithTaints adds the given value to the Taints field in the declarative configuration 74// and returns the receiver, so that objects can be build by chaining "With" function invocations. 75// If called multiple times, values provided by each call will be appended to the Taints field. 76func (b *NodeSpecApplyConfiguration) WithTaints(values ...*TaintApplyConfiguration) *NodeSpecApplyConfiguration { 77 for i := range values { 78 if values[i] == nil { 79 panic("nil value passed to WithTaints") 80 } 81 b.Taints = append(b.Taints, *values[i]) 82 } 83 return b 84} 85 86// WithConfigSource sets the ConfigSource field in the declarative configuration to the given value 87// and returns the receiver, so that objects can be built by chaining "With" function invocations. 88// If called multiple times, the ConfigSource field is set to the value of the last call. 89func (b *NodeSpecApplyConfiguration) WithConfigSource(value *NodeConfigSourceApplyConfiguration) *NodeSpecApplyConfiguration { 90 b.ConfigSource = value 91 return b 92} 93 94// WithDoNotUseExternalID sets the DoNotUseExternalID field in the declarative configuration to the given value 95// and returns the receiver, so that objects can be built by chaining "With" function invocations. 96// If called multiple times, the DoNotUseExternalID field is set to the value of the last call. 97func (b *NodeSpecApplyConfiguration) WithDoNotUseExternalID(value string) *NodeSpecApplyConfiguration { 98 b.DoNotUseExternalID = &value 99 return b 100} 101