Kubernetes-commit: ea2f8881093b01f27807ee4fa4e6ca2b88a7bc71
This commit is contained in:
Cici Huang
2025-03-18 07:16:21 +00:00
committed by Kubernetes Publisher
parent b0ed7301c5
commit 379ed45313
12 changed files with 570 additions and 18 deletions

View File

@@ -12606,6 +12606,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.resource.v1alpha3.BasicDevice
map:
fields:
- name: allNodes
type:
scalar: boolean
- name: attributes
type:
map:
@@ -12616,6 +12619,18 @@ var schemaYAML = typed.YAMLObject(`types:
map:
elementType:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: consumesCounter
type:
list:
elementType:
namedType: io.k8s.api.resource.v1alpha3.DeviceCounterConsumption
elementRelationship: atomic
- name: nodeName
type:
scalar: string
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: taints
type:
list:
@@ -12629,6 +12644,24 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.Counter
map:
fields:
- name: value
type:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: io.k8s.api.resource.v1alpha3.CounterSet
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1alpha3.Counter
- name: name
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.Device
map:
fields:
@@ -12768,6 +12801,18 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: string
elementRelationship: atomic
- name: io.k8s.api.resource.v1alpha3.DeviceCounterConsumption
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1alpha3.Counter
- name: sharedCounter
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.DeviceRequest
map:
fields:
@@ -13130,10 +13175,19 @@ var schemaYAML = typed.YAMLObject(`types:
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: perDeviceNodeSelection
type:
scalar: boolean
- name: pool
type:
namedType: io.k8s.api.resource.v1alpha3.ResourcePool
default: {}
- name: sharedCounters
type:
list:
elementType:
namedType: io.k8s.api.resource.v1alpha3.CounterSet
elementRelationship: atomic
- name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus
map:
fields:
@@ -13176,6 +13230,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.resource.v1beta1.BasicDevice
map:
fields:
- name: allNodes
type:
scalar: boolean
- name: attributes
type:
map:
@@ -13186,6 +13243,18 @@ var schemaYAML = typed.YAMLObject(`types:
map:
elementType:
namedType: io.k8s.api.resource.v1beta1.DeviceCapacity
- name: consumesCounter
type:
list:
elementType:
namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption
elementRelationship: atomic
- name: nodeName
type:
scalar: string
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: taints
type:
list:
@@ -13199,6 +13268,24 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1beta1.Counter
map:
fields:
- name: value
type:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: io.k8s.api.resource.v1beta1.CounterSet
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1beta1.Counter
- name: name
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1beta1.Device
map:
fields:
@@ -13344,6 +13431,18 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: string
elementRelationship: atomic
- name: io.k8s.api.resource.v1beta1.DeviceCounterConsumption
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1beta1.Counter
- name: sharedCounter
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1beta1.DeviceRequest
map:
fields:
@@ -13658,10 +13757,19 @@ var schemaYAML = typed.YAMLObject(`types:
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: perDeviceNodeSelection
type:
scalar: boolean
- name: pool
type:
namedType: io.k8s.api.resource.v1beta1.ResourcePool
default: {}
- name: sharedCounters
type:
list:
elementType:
namedType: io.k8s.api.resource.v1beta1.CounterSet
elementRelationship: atomic
- name: io.k8s.api.scheduling.v1.PriorityClass
map:
fields:

View File

@@ -21,14 +21,19 @@ package v1alpha3
import (
resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
resource "k8s.io/apimachinery/pkg/api/resource"
v1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use
// with apply.
type BasicDeviceApplyConfiguration struct {
Attributes map[resourcev1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
Attributes map[resourcev1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"`
ConsumesCounter []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounter,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
}
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
@@ -65,6 +70,43 @@ func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1alpha
return b
}
// WithConsumesCounter adds the given value to the ConsumesCounter 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 ConsumesCounter field.
func (b *BasicDeviceApplyConfiguration) WithConsumesCounter(values ...*DeviceCounterConsumptionApplyConfiguration) *BasicDeviceApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConsumesCounter")
}
b.ConsumesCounter = append(b.ConsumesCounter, *values[i])
}
return b
}
// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeName(value string) *BasicDeviceApplyConfiguration {
b.NodeName = &value
return b
}
// WithNodeSelector sets the NodeSelector 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 NodeSelector field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *BasicDeviceApplyConfiguration {
b.NodeSelector = value
return b
}
// WithAllNodes sets the AllNodes 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 AllNodes field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithAllNodes(value bool) *BasicDeviceApplyConfiguration {
b.AllNodes = &value
return b
}
// WithTaints adds the given value to the Taints 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 Taints field.

View File

@@ -0,0 +1,43 @@
/*
Copyright The Kubernetes 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 v1alpha3
import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
// CounterApplyConfiguration represents a declarative configuration of the Counter type for use
// with apply.
type CounterApplyConfiguration struct {
Value *resource.Quantity `json:"value,omitempty"`
}
// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with
// apply.
func Counter() *CounterApplyConfiguration {
return &CounterApplyConfiguration{}
}
// WithValue sets the Value 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 Value field is set to the value of the last call.
func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration {
b.Value = &value
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes 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 v1alpha3
// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use
// with apply.
type CounterSetApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with
// apply.
func CounterSet() *CounterSetApplyConfiguration {
return &CounterSetApplyConfiguration{}
}
// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration {
b.Name = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes 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 v1alpha3
// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use
// with apply.
type DeviceCounterConsumptionApplyConfiguration struct {
SharedCounter *string `json:"sharedCounter,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with
// apply.
func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration {
return &DeviceCounterConsumptionApplyConfiguration{}
}
// WithSharedCounter sets the SharedCounter 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 SharedCounter field is set to the value of the last call.
func (b *DeviceCounterConsumptionApplyConfiguration) WithSharedCounter(value string) *DeviceCounterConsumptionApplyConfiguration {
b.SharedCounter = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -25,12 +25,14 @@ import (
// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use
// with apply.
type ResourceSliceSpecApplyConfiguration struct {
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"`
SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"`
}
// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with
@@ -91,3 +93,24 @@ func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApply
}
return b
}
// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection 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 PerDeviceNodeSelection field is set to the value of the last call.
func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration {
b.PerDeviceNodeSelection = &value
return b
}
// WithSharedCounters adds the given value to the SharedCounters 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 SharedCounters field.
func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithSharedCounters")
}
b.SharedCounters = append(b.SharedCounters, *values[i])
}
return b
}

View File

@@ -20,14 +20,19 @@ package v1beta1
import (
resourcev1beta1 "k8s.io/api/resource/v1beta1"
v1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use
// with apply.
type BasicDeviceApplyConfiguration struct {
Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"`
ConsumesCounter []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounter,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
}
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
@@ -64,6 +69,43 @@ func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1beta1
return b
}
// WithConsumesCounter adds the given value to the ConsumesCounter 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 ConsumesCounter field.
func (b *BasicDeviceApplyConfiguration) WithConsumesCounter(values ...*DeviceCounterConsumptionApplyConfiguration) *BasicDeviceApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConsumesCounter")
}
b.ConsumesCounter = append(b.ConsumesCounter, *values[i])
}
return b
}
// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeName(value string) *BasicDeviceApplyConfiguration {
b.NodeName = &value
return b
}
// WithNodeSelector sets the NodeSelector 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 NodeSelector field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *BasicDeviceApplyConfiguration {
b.NodeSelector = value
return b
}
// WithAllNodes sets the AllNodes 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 AllNodes field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithAllNodes(value bool) *BasicDeviceApplyConfiguration {
b.AllNodes = &value
return b
}
// WithTaints adds the given value to the Taints 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 Taints field.

View File

@@ -0,0 +1,43 @@
/*
Copyright The Kubernetes 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 (
resource "k8s.io/apimachinery/pkg/api/resource"
)
// CounterApplyConfiguration represents a declarative configuration of the Counter type for use
// with apply.
type CounterApplyConfiguration struct {
Value *resource.Quantity `json:"value,omitempty"`
}
// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with
// apply.
func Counter() *CounterApplyConfiguration {
return &CounterApplyConfiguration{}
}
// WithValue sets the Value 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 Value field is set to the value of the last call.
func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration {
b.Value = &value
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes 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
// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use
// with apply.
type CounterSetApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with
// apply.
func CounterSet() *CounterSetApplyConfiguration {
return &CounterSetApplyConfiguration{}
}
// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration {
b.Name = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes 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
// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use
// with apply.
type DeviceCounterConsumptionApplyConfiguration struct {
SharedCounter *string `json:"sharedCounter,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with
// apply.
func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration {
return &DeviceCounterConsumptionApplyConfiguration{}
}
// WithSharedCounter sets the SharedCounter 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 SharedCounter field is set to the value of the last call.
func (b *DeviceCounterConsumptionApplyConfiguration) WithSharedCounter(value string) *DeviceCounterConsumptionApplyConfiguration {
b.SharedCounter = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -25,12 +25,14 @@ import (
// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use
// with apply.
type ResourceSliceSpecApplyConfiguration struct {
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"`
SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"`
}
// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with
@@ -91,3 +93,24 @@ func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApply
}
return b
}
// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection 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 PerDeviceNodeSelection field is set to the value of the last call.
func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration {
b.PerDeviceNodeSelection = &value
return b
}
// WithSharedCounters adds the given value to the SharedCounters 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 SharedCounters field.
func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithSharedCounters")
}
b.SharedCounters = append(b.SharedCounters, *values[i])
}
return b
}

View File

@@ -1616,6 +1616,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &resourcev1alpha3.BasicDeviceApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"):
return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("Counter"):
return &resourcev1alpha3.CounterApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("CounterSet"):
return &resourcev1alpha3.CounterSetApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("Device"):
return &resourcev1alpha3.DeviceApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"):
@@ -1638,6 +1642,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"):
return &resourcev1alpha3.DeviceConstraintApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceCounterConsumption"):
return &resourcev1alpha3.DeviceCounterConsumptionApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequest"):
return &resourcev1alpha3.DeviceRequestApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"):
@@ -1688,6 +1694,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsresourcev1beta1.BasicDeviceApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("CELDeviceSelector"):
return &applyconfigurationsresourcev1beta1.CELDeviceSelectorApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("Counter"):
return &applyconfigurationsresourcev1beta1.CounterApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("CounterSet"):
return &applyconfigurationsresourcev1beta1.CounterSetApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("Device"):
return &applyconfigurationsresourcev1beta1.DeviceApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"):
@@ -1712,6 +1722,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsresourcev1beta1.DeviceConfigurationApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceConstraint"):
return &applyconfigurationsresourcev1beta1.DeviceConstraintApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceCounterConsumption"):
return &applyconfigurationsresourcev1beta1.DeviceCounterConsumptionApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequest"):
return &applyconfigurationsresourcev1beta1.DeviceRequestApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"):