DRA API: rename DeviceCapacity.Quantity to DeviceCapacity.Value

Based on review
feedback (https://github.com/kubernetes/kubernetes/pull/127511#discussion_r1823521172).

Kubernetes-commit: 30f52826560129839922e1756730b02f184f0ef9
This commit is contained in:
Patrick Ohly 2024-10-31 21:30:28 +01:00 committed by Kubernetes Publisher
parent f65974c297
commit 4e05c623ae
2 changed files with 6 additions and 6 deletions

View File

@ -12821,7 +12821,7 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.resource.v1beta1.DeviceCapacity
map:
fields:
- name: quantity
- name: value
type:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: io.k8s.api.resource.v1beta1.DeviceClaim

View File

@ -25,7 +25,7 @@ import (
// DeviceCapacityApplyConfiguration represents a declarative configuration of the DeviceCapacity type for use
// with apply.
type DeviceCapacityApplyConfiguration struct {
Quantity *resource.Quantity `json:"quantity,omitempty"`
Value *resource.Quantity `json:"value,omitempty"`
}
// DeviceCapacityApplyConfiguration constructs a declarative configuration of the DeviceCapacity type for use with
@ -34,10 +34,10 @@ func DeviceCapacity() *DeviceCapacityApplyConfiguration {
return &DeviceCapacityApplyConfiguration{}
}
// WithQuantity sets the Quantity field in the declarative configuration to the given value
// 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 Quantity field is set to the value of the last call.
func (b *DeviceCapacityApplyConfiguration) WithQuantity(value resource.Quantity) *DeviceCapacityApplyConfiguration {
b.Quantity = &value
// If called multiple times, the Value field is set to the value of the last call.
func (b *DeviceCapacityApplyConfiguration) WithValue(value resource.Quantity) *DeviceCapacityApplyConfiguration {
b.Value = &value
return b
}