sigs.k8s.io/kueue@v0.6.2/client-go/applyconfiguration/kueue/v1beta1/podsetupdate.go (about)

     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  // Code generated by applyconfiguration-gen. DO NOT EDIT.
    17  
    18  package v1beta1
    19  
    20  import (
    21  	v1 "k8s.io/api/core/v1"
    22  )
    23  
    24  // PodSetUpdateApplyConfiguration represents an declarative configuration of the PodSetUpdate type for use
    25  // with apply.
    26  type PodSetUpdateApplyConfiguration struct {
    27  	Name         *string           `json:"name,omitempty"`
    28  	Labels       map[string]string `json:"labels,omitempty"`
    29  	Annotations  map[string]string `json:"annotations,omitempty"`
    30  	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
    31  	Tolerations  []v1.Toleration   `json:"tolerations,omitempty"`
    32  }
    33  
    34  // PodSetUpdateApplyConfiguration constructs an declarative configuration of the PodSetUpdate type for use with
    35  // apply.
    36  func PodSetUpdate() *PodSetUpdateApplyConfiguration {
    37  	return &PodSetUpdateApplyConfiguration{}
    38  }
    39  
    40  // WithName sets the Name field in the declarative configuration to the given value
    41  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    42  // If called multiple times, the Name field is set to the value of the last call.
    43  func (b *PodSetUpdateApplyConfiguration) WithName(value string) *PodSetUpdateApplyConfiguration {
    44  	b.Name = &value
    45  	return b
    46  }
    47  
    48  // WithLabels puts the entries into the Labels field in the declarative configuration
    49  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    50  // If called multiple times, the entries provided by each call will be put on the Labels field,
    51  // overwriting an existing map entries in Labels field with the same key.
    52  func (b *PodSetUpdateApplyConfiguration) WithLabels(entries map[string]string) *PodSetUpdateApplyConfiguration {
    53  	if b.Labels == nil && len(entries) > 0 {
    54  		b.Labels = make(map[string]string, len(entries))
    55  	}
    56  	for k, v := range entries {
    57  		b.Labels[k] = v
    58  	}
    59  	return b
    60  }
    61  
    62  // WithAnnotations puts the entries into the Annotations field in the declarative configuration
    63  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    64  // If called multiple times, the entries provided by each call will be put on the Annotations field,
    65  // overwriting an existing map entries in Annotations field with the same key.
    66  func (b *PodSetUpdateApplyConfiguration) WithAnnotations(entries map[string]string) *PodSetUpdateApplyConfiguration {
    67  	if b.Annotations == nil && len(entries) > 0 {
    68  		b.Annotations = make(map[string]string, len(entries))
    69  	}
    70  	for k, v := range entries {
    71  		b.Annotations[k] = v
    72  	}
    73  	return b
    74  }
    75  
    76  // WithNodeSelector puts the entries into the NodeSelector 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, the entries provided by each call will be put on the NodeSelector field,
    79  // overwriting an existing map entries in NodeSelector field with the same key.
    80  func (b *PodSetUpdateApplyConfiguration) WithNodeSelector(entries map[string]string) *PodSetUpdateApplyConfiguration {
    81  	if b.NodeSelector == nil && len(entries) > 0 {
    82  		b.NodeSelector = make(map[string]string, len(entries))
    83  	}
    84  	for k, v := range entries {
    85  		b.NodeSelector[k] = v
    86  	}
    87  	return b
    88  }
    89  
    90  // WithTolerations adds the given value to the Tolerations field in the declarative configuration
    91  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    92  // If called multiple times, values provided by each call will be appended to the Tolerations field.
    93  func (b *PodSetUpdateApplyConfiguration) WithTolerations(values ...v1.Toleration) *PodSetUpdateApplyConfiguration {
    94  	for i := range values {
    95  		b.Tolerations = append(b.Tolerations, values[i])
    96  	}
    97  	return b
    98  }