From ff60d1bd909b078a4f1c70bcd1653fae1fd9febe Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Tue, 7 Mar 2023 11:35:08 +0000 Subject: [PATCH] Update generated code for resource.k8s.io/v1alpha2 Signed-off-by: Kevin Klues Kubernetes-commit: 452f345c472a206b148bbe7e4e27f772841dc363 --- applyconfigurations/internal/internal.go | 16 ++++++- .../resource/v1alpha2/allocationresult.go | 17 ++++--- .../resource/v1alpha2/resourcehandle.go | 48 +++++++++++++++++++ applyconfigurations/utils.go | 2 + 4 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 applyconfigurations/resource/v1alpha2/resourcehandle.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 170dad8a43..d1f2c651db 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -11411,9 +11411,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: availableOnNodes type: namedType: io.k8s.api.core.v1.NodeSelector - - name: resourceHandle + - name: resourceHandles type: - scalar: string + list: + elementType: + namedType: io.k8s.api.resource.v1alpha2.ResourceHandle + elementRelationship: atomic - name: shareable type: scalar: boolean @@ -11627,6 +11630,15 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string +- name: io.k8s.api.resource.v1alpha2.ResourceHandle + map: + fields: + - name: data + type: + scalar: string + - name: driverName + type: + scalar: string - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: diff --git a/applyconfigurations/resource/v1alpha2/allocationresult.go b/applyconfigurations/resource/v1alpha2/allocationresult.go index ec97dc83ce..bc6078aa94 100644 --- a/applyconfigurations/resource/v1alpha2/allocationresult.go +++ b/applyconfigurations/resource/v1alpha2/allocationresult.go @@ -25,7 +25,7 @@ import ( // AllocationResultApplyConfiguration represents an declarative configuration of the AllocationResult type for use // with apply. type AllocationResultApplyConfiguration struct { - ResourceHandle *string `json:"resourceHandle,omitempty"` + ResourceHandles []ResourceHandleApplyConfiguration `json:"resourceHandles,omitempty"` AvailableOnNodes *v1.NodeSelectorApplyConfiguration `json:"availableOnNodes,omitempty"` Shareable *bool `json:"shareable,omitempty"` } @@ -36,11 +36,16 @@ func AllocationResult() *AllocationResultApplyConfiguration { return &AllocationResultApplyConfiguration{} } -// WithResourceHandle sets the ResourceHandle 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 ResourceHandle field is set to the value of the last call. -func (b *AllocationResultApplyConfiguration) WithResourceHandle(value string) *AllocationResultApplyConfiguration { - b.ResourceHandle = &value +// WithResourceHandles adds the given value to the ResourceHandles 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 ResourceHandles field. +func (b *AllocationResultApplyConfiguration) WithResourceHandles(values ...*ResourceHandleApplyConfiguration) *AllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceHandles") + } + b.ResourceHandles = append(b.ResourceHandles, *values[i]) + } return b } diff --git a/applyconfigurations/resource/v1alpha2/resourcehandle.go b/applyconfigurations/resource/v1alpha2/resourcehandle.go new file mode 100644 index 0000000000..028cbaa1a7 --- /dev/null +++ b/applyconfigurations/resource/v1alpha2/resourcehandle.go @@ -0,0 +1,48 @@ +/* +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 v1alpha2 + +// ResourceHandleApplyConfiguration represents an declarative configuration of the ResourceHandle type for use +// with apply. +type ResourceHandleApplyConfiguration struct { + DriverName *string `json:"driverName,omitempty"` + Data *string `json:"data,omitempty"` +} + +// ResourceHandleApplyConfiguration constructs an declarative configuration of the ResourceHandle type for use with +// apply. +func ResourceHandle() *ResourceHandleApplyConfiguration { + return &ResourceHandleApplyConfiguration{} +} + +// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. +func (b *ResourceHandleApplyConfiguration) WithDriverName(value string) *ResourceHandleApplyConfiguration { + b.DriverName = &value + return b +} + +// WithData sets the Data 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 Data field is set to the value of the last call. +func (b *ResourceHandleApplyConfiguration) WithData(value string) *ResourceHandleApplyConfiguration { + b.Data = &value + return b +} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index fc6488a04d..98c743274e 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1483,6 +1483,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha2.ResourceClassApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParametersReference"): return &resourcev1alpha2.ResourceClassParametersReferenceApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ResourceHandle"): + return &resourcev1alpha2.ResourceHandleApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"):