sigs.k8s.io/kueue@v0.6.2/client-go/applyconfiguration/kueue/v1beta1/clusterqueuespec.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/apimachinery/pkg/apis/meta/v1" 22 kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1" 23 ) 24 25 // ClusterQueueSpecApplyConfiguration represents an declarative configuration of the ClusterQueueSpec type for use 26 // with apply. 27 type ClusterQueueSpecApplyConfiguration struct { 28 ResourceGroups []ResourceGroupApplyConfiguration `json:"resourceGroups,omitempty"` 29 Cohort *string `json:"cohort,omitempty"` 30 QueueingStrategy *kueuev1beta1.QueueingStrategy `json:"queueingStrategy,omitempty"` 31 NamespaceSelector *v1.LabelSelector `json:"namespaceSelector,omitempty"` 32 FlavorFungibility *FlavorFungibilityApplyConfiguration `json:"flavorFungibility,omitempty"` 33 Preemption *ClusterQueuePreemptionApplyConfiguration `json:"preemption,omitempty"` 34 AdmissionChecks []string `json:"admissionChecks,omitempty"` 35 StopPolicy *kueuev1beta1.StopPolicy `json:"stopPolicy,omitempty"` 36 } 37 38 // ClusterQueueSpecApplyConfiguration constructs an declarative configuration of the ClusterQueueSpec type for use with 39 // apply. 40 func ClusterQueueSpec() *ClusterQueueSpecApplyConfiguration { 41 return &ClusterQueueSpecApplyConfiguration{} 42 } 43 44 // WithResourceGroups adds the given value to the ResourceGroups field in the declarative configuration 45 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 46 // If called multiple times, values provided by each call will be appended to the ResourceGroups field. 47 func (b *ClusterQueueSpecApplyConfiguration) WithResourceGroups(values ...*ResourceGroupApplyConfiguration) *ClusterQueueSpecApplyConfiguration { 48 for i := range values { 49 if values[i] == nil { 50 panic("nil value passed to WithResourceGroups") 51 } 52 b.ResourceGroups = append(b.ResourceGroups, *values[i]) 53 } 54 return b 55 } 56 57 // WithCohort sets the Cohort 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 Cohort field is set to the value of the last call. 60 func (b *ClusterQueueSpecApplyConfiguration) WithCohort(value string) *ClusterQueueSpecApplyConfiguration { 61 b.Cohort = &value 62 return b 63 } 64 65 // WithQueueingStrategy sets the QueueingStrategy 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 QueueingStrategy field is set to the value of the last call. 68 func (b *ClusterQueueSpecApplyConfiguration) WithQueueingStrategy(value kueuev1beta1.QueueingStrategy) *ClusterQueueSpecApplyConfiguration { 69 b.QueueingStrategy = &value 70 return b 71 } 72 73 // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value 74 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 75 // If called multiple times, the NamespaceSelector field is set to the value of the last call. 76 func (b *ClusterQueueSpecApplyConfiguration) WithNamespaceSelector(value v1.LabelSelector) *ClusterQueueSpecApplyConfiguration { 77 b.NamespaceSelector = &value 78 return b 79 } 80 81 // WithFlavorFungibility sets the FlavorFungibility field in the declarative configuration to the given value 82 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 83 // If called multiple times, the FlavorFungibility field is set to the value of the last call. 84 func (b *ClusterQueueSpecApplyConfiguration) WithFlavorFungibility(value *FlavorFungibilityApplyConfiguration) *ClusterQueueSpecApplyConfiguration { 85 b.FlavorFungibility = value 86 return b 87 } 88 89 // WithPreemption sets the Preemption field in the declarative configuration to the given value 90 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 91 // If called multiple times, the Preemption field is set to the value of the last call. 92 func (b *ClusterQueueSpecApplyConfiguration) WithPreemption(value *ClusterQueuePreemptionApplyConfiguration) *ClusterQueueSpecApplyConfiguration { 93 b.Preemption = value 94 return b 95 } 96 97 // WithAdmissionChecks adds the given value to the AdmissionChecks field in the declarative configuration 98 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 99 // If called multiple times, values provided by each call will be appended to the AdmissionChecks field. 100 func (b *ClusterQueueSpecApplyConfiguration) WithAdmissionChecks(values ...string) *ClusterQueueSpecApplyConfiguration { 101 for i := range values { 102 b.AdmissionChecks = append(b.AdmissionChecks, values[i]) 103 } 104 return b 105 } 106 107 // WithStopPolicy sets the StopPolicy field in the declarative configuration to the given value 108 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 109 // If called multiple times, the StopPolicy field is set to the value of the last call. 110 func (b *ClusterQueueSpecApplyConfiguration) WithStopPolicy(value kueuev1beta1.StopPolicy) *ClusterQueueSpecApplyConfiguration { 111 b.StopPolicy = &value 112 return b 113 }