mirror of https://github.com/volcano-sh/apis.git
129 lines
5.9 KiB
Go
129 lines
5.9 KiB
Go
/*
|
|
Copyright The Volcano Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
|
|
|
package v1beta1
|
|
|
|
import (
|
|
v1 "k8s.io/api/core/v1"
|
|
)
|
|
|
|
// QueueSpecApplyConfiguration represents a declarative configuration of the QueueSpec type for use
|
|
// with apply.
|
|
type QueueSpecApplyConfiguration struct {
|
|
Weight *int32 `json:"weight,omitempty"`
|
|
Capability *v1.ResourceList `json:"capability,omitempty"`
|
|
Reclaimable *bool `json:"reclaimable,omitempty"`
|
|
ExtendClusters []ClusterApplyConfiguration `json:"extendClusters,omitempty"`
|
|
Guarantee *GuaranteeApplyConfiguration `json:"guarantee,omitempty"`
|
|
Affinity *AffinityApplyConfiguration `json:"affinity,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
Parent *string `json:"parent,omitempty"`
|
|
Deserved *v1.ResourceList `json:"deserved,omitempty"`
|
|
Priority *int32 `json:"priority,omitempty"`
|
|
}
|
|
|
|
// QueueSpecApplyConfiguration constructs a declarative configuration of the QueueSpec type for use with
|
|
// apply.
|
|
func QueueSpec() *QueueSpecApplyConfiguration {
|
|
return &QueueSpecApplyConfiguration{}
|
|
}
|
|
|
|
// WithWeight sets the Weight field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Weight field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithWeight(value int32) *QueueSpecApplyConfiguration {
|
|
b.Weight = &value
|
|
return b
|
|
}
|
|
|
|
// WithCapability sets the Capability field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Capability field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithCapability(value v1.ResourceList) *QueueSpecApplyConfiguration {
|
|
b.Capability = &value
|
|
return b
|
|
}
|
|
|
|
// WithReclaimable sets the Reclaimable field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Reclaimable field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithReclaimable(value bool) *QueueSpecApplyConfiguration {
|
|
b.Reclaimable = &value
|
|
return b
|
|
}
|
|
|
|
// WithExtendClusters adds the given value to the ExtendClusters 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 ExtendClusters field.
|
|
func (b *QueueSpecApplyConfiguration) WithExtendClusters(values ...*ClusterApplyConfiguration) *QueueSpecApplyConfiguration {
|
|
for i := range values {
|
|
if values[i] == nil {
|
|
panic("nil value passed to WithExtendClusters")
|
|
}
|
|
b.ExtendClusters = append(b.ExtendClusters, *values[i])
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithGuarantee sets the Guarantee field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Guarantee field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithGuarantee(value *GuaranteeApplyConfiguration) *QueueSpecApplyConfiguration {
|
|
b.Guarantee = value
|
|
return b
|
|
}
|
|
|
|
// WithAffinity sets the Affinity field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Affinity field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithAffinity(value *AffinityApplyConfiguration) *QueueSpecApplyConfiguration {
|
|
b.Affinity = value
|
|
return b
|
|
}
|
|
|
|
// WithType sets the Type field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Type field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithType(value string) *QueueSpecApplyConfiguration {
|
|
b.Type = &value
|
|
return b
|
|
}
|
|
|
|
// WithParent sets the Parent field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Parent field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithParent(value string) *QueueSpecApplyConfiguration {
|
|
b.Parent = &value
|
|
return b
|
|
}
|
|
|
|
// WithDeserved sets the Deserved field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Deserved field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithDeserved(value v1.ResourceList) *QueueSpecApplyConfiguration {
|
|
b.Deserved = &value
|
|
return b
|
|
}
|
|
|
|
// WithPriority sets the Priority field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Priority field is set to the value of the last call.
|
|
func (b *QueueSpecApplyConfiguration) WithPriority(value int32) *QueueSpecApplyConfiguration {
|
|
b.Priority = &value
|
|
return b
|
|
}
|