From 3b7d818a7f3528adee4571bcd1aa2cb6489fd52b Mon Sep 17 00:00:00 2001 From: yliao Date: Thu, 17 Jul 2025 16:45:05 +0000 Subject: [PATCH] extended resource backed by DRA: codegen Kubernetes-commit: 3068b60b830fb77694300c2274144de13a220481 --- .../v1/containerextendedresourcerequest.go | 57 +++++++++++++++++++ .../core/v1/podextendedresourceclaimstatus.go | 53 +++++++++++++++++ applyconfigurations/core/v1/podstatus.go | 43 ++++++++------ applyconfigurations/internal/internal.go | 40 +++++++++++++ .../resource/v1/deviceclassspec.go | 13 ++++- .../resource/v1beta1/deviceclassspec.go | 13 ++++- .../resource/v1beta2/deviceclassspec.go | 13 ++++- applyconfigurations/utils.go | 4 ++ 8 files changed, 213 insertions(+), 23 deletions(-) create mode 100644 applyconfigurations/core/v1/containerextendedresourcerequest.go create mode 100644 applyconfigurations/core/v1/podextendedresourceclaimstatus.go diff --git a/applyconfigurations/core/v1/containerextendedresourcerequest.go b/applyconfigurations/core/v1/containerextendedresourcerequest.go new file mode 100644 index 00000000..0b83b382 --- /dev/null +++ b/applyconfigurations/core/v1/containerextendedresourcerequest.go @@ -0,0 +1,57 @@ +/* +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 v1 + +// ContainerExtendedResourceRequestApplyConfiguration represents a declarative configuration of the ContainerExtendedResourceRequest type for use +// with apply. +type ContainerExtendedResourceRequestApplyConfiguration struct { + ContainerName *string `json:"containerName,omitempty"` + ResourceName *string `json:"resourceName,omitempty"` + RequestName *string `json:"requestName,omitempty"` +} + +// ContainerExtendedResourceRequestApplyConfiguration constructs a declarative configuration of the ContainerExtendedResourceRequest type for use with +// apply. +func ContainerExtendedResourceRequest() *ContainerExtendedResourceRequestApplyConfiguration { + return &ContainerExtendedResourceRequestApplyConfiguration{} +} + +// WithContainerName sets the ContainerName 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 ContainerName field is set to the value of the last call. +func (b *ContainerExtendedResourceRequestApplyConfiguration) WithContainerName(value string) *ContainerExtendedResourceRequestApplyConfiguration { + b.ContainerName = &value + return b +} + +// WithResourceName sets the ResourceName 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 ResourceName field is set to the value of the last call. +func (b *ContainerExtendedResourceRequestApplyConfiguration) WithResourceName(value string) *ContainerExtendedResourceRequestApplyConfiguration { + b.ResourceName = &value + return b +} + +// WithRequestName sets the RequestName 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 RequestName field is set to the value of the last call. +func (b *ContainerExtendedResourceRequestApplyConfiguration) WithRequestName(value string) *ContainerExtendedResourceRequestApplyConfiguration { + b.RequestName = &value + return b +} diff --git a/applyconfigurations/core/v1/podextendedresourceclaimstatus.go b/applyconfigurations/core/v1/podextendedresourceclaimstatus.go new file mode 100644 index 00000000..d4378863 --- /dev/null +++ b/applyconfigurations/core/v1/podextendedresourceclaimstatus.go @@ -0,0 +1,53 @@ +/* +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 v1 + +// PodExtendedResourceClaimStatusApplyConfiguration represents a declarative configuration of the PodExtendedResourceClaimStatus type for use +// with apply. +type PodExtendedResourceClaimStatusApplyConfiguration struct { + RequestMappings []ContainerExtendedResourceRequestApplyConfiguration `json:"requestMappings,omitempty"` + ResourceClaimName *string `json:"resourceClaimName,omitempty"` +} + +// PodExtendedResourceClaimStatusApplyConfiguration constructs a declarative configuration of the PodExtendedResourceClaimStatus type for use with +// apply. +func PodExtendedResourceClaimStatus() *PodExtendedResourceClaimStatusApplyConfiguration { + return &PodExtendedResourceClaimStatusApplyConfiguration{} +} + +// WithRequestMappings adds the given value to the RequestMappings 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 RequestMappings field. +func (b *PodExtendedResourceClaimStatusApplyConfiguration) WithRequestMappings(values ...*ContainerExtendedResourceRequestApplyConfiguration) *PodExtendedResourceClaimStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequestMappings") + } + b.RequestMappings = append(b.RequestMappings, *values[i]) + } + return b +} + +// WithResourceClaimName sets the ResourceClaimName 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 ResourceClaimName field is set to the value of the last call. +func (b *PodExtendedResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *PodExtendedResourceClaimStatusApplyConfiguration { + b.ResourceClaimName = &value + return b +} diff --git a/applyconfigurations/core/v1/podstatus.go b/applyconfigurations/core/v1/podstatus.go index 28ad57ba..4e643420 100644 --- a/applyconfigurations/core/v1/podstatus.go +++ b/applyconfigurations/core/v1/podstatus.go @@ -26,23 +26,24 @@ import ( // PodStatusApplyConfiguration represents a declarative configuration of the PodStatus type for use // with apply. type PodStatusApplyConfiguration struct { - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` - Phase *corev1.PodPhase `json:"phase,omitempty"` - Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"` - Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - NominatedNodeName *string `json:"nominatedNodeName,omitempty"` - HostIP *string `json:"hostIP,omitempty"` - HostIPs []HostIPApplyConfiguration `json:"hostIPs,omitempty"` - PodIP *string `json:"podIP,omitempty"` - PodIPs []PodIPApplyConfiguration `json:"podIPs,omitempty"` - StartTime *metav1.Time `json:"startTime,omitempty"` - InitContainerStatuses []ContainerStatusApplyConfiguration `json:"initContainerStatuses,omitempty"` - ContainerStatuses []ContainerStatusApplyConfiguration `json:"containerStatuses,omitempty"` - QOSClass *corev1.PodQOSClass `json:"qosClass,omitempty"` - EphemeralContainerStatuses []ContainerStatusApplyConfiguration `json:"ephemeralContainerStatuses,omitempty"` - Resize *corev1.PodResizeStatus `json:"resize,omitempty"` - ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + Phase *corev1.PodPhase `json:"phase,omitempty"` + Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + NominatedNodeName *string `json:"nominatedNodeName,omitempty"` + HostIP *string `json:"hostIP,omitempty"` + HostIPs []HostIPApplyConfiguration `json:"hostIPs,omitempty"` + PodIP *string `json:"podIP,omitempty"` + PodIPs []PodIPApplyConfiguration `json:"podIPs,omitempty"` + StartTime *metav1.Time `json:"startTime,omitempty"` + InitContainerStatuses []ContainerStatusApplyConfiguration `json:"initContainerStatuses,omitempty"` + ContainerStatuses []ContainerStatusApplyConfiguration `json:"containerStatuses,omitempty"` + QOSClass *corev1.PodQOSClass `json:"qosClass,omitempty"` + EphemeralContainerStatuses []ContainerStatusApplyConfiguration `json:"ephemeralContainerStatuses,omitempty"` + Resize *corev1.PodResizeStatus `json:"resize,omitempty"` + ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` + ExtendedResourceClaimStatus *PodExtendedResourceClaimStatusApplyConfiguration `json:"extendedResourceClaimStatus,omitempty"` } // PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with @@ -221,3 +222,11 @@ func (b *PodStatusApplyConfiguration) WithResourceClaimStatuses(values ...*PodRe } return b } + +// WithExtendedResourceClaimStatus sets the ExtendedResourceClaimStatus 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 ExtendedResourceClaimStatus field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithExtendedResourceClaimStatus(value *PodExtendedResourceClaimStatusApplyConfiguration) *PodStatusApplyConfiguration { + b.ExtendedResourceClaimStatus = value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 003e2fdd..a9debaaa 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5379,6 +5379,21 @@ var schemaYAML = typed.YAMLObject(`types: - name: workingDir type: scalar: string +- name: io.k8s.api.core.v1.ContainerExtendedResourceRequest + map: + fields: + - name: containerName + type: + scalar: string + default: "" + - name: requestName + type: + scalar: string + default: "" + - name: resourceName + type: + scalar: string + default: "" - name: io.k8s.api.core.v1.ContainerImage map: fields: @@ -7323,6 +7338,19 @@ var schemaYAML = typed.YAMLObject(`types: - name: value type: scalar: string +- name: io.k8s.api.core.v1.PodExtendedResourceClaimStatus + map: + fields: + - name: requestMappings + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerExtendedResourceRequest + elementRelationship: atomic + - name: resourceClaimName + type: + scalar: string + default: "" - name: io.k8s.api.core.v1.PodIP map: fields: @@ -7628,6 +7656,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.core.v1.ContainerStatus elementRelationship: atomic + - name: extendedResourceClaimStatus + type: + namedType: io.k8s.api.core.v1.PodExtendedResourceClaimStatus - name: hostIP type: scalar: string @@ -13005,6 +13036,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1.DeviceClassConfiguration elementRelationship: atomic + - name: extendedResourceName + type: + scalar: string - name: selectors type: list: @@ -13701,6 +13735,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta1.DeviceClassConfiguration elementRelationship: atomic + - name: extendedResourceName + type: + scalar: string - name: selectors type: list: @@ -14307,6 +14344,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta2.DeviceClassConfiguration elementRelationship: atomic + - name: extendedResourceName + type: + scalar: string - name: selectors type: list: diff --git a/applyconfigurations/resource/v1/deviceclassspec.go b/applyconfigurations/resource/v1/deviceclassspec.go index 0ad738a6..09500361 100644 --- a/applyconfigurations/resource/v1/deviceclassspec.go +++ b/applyconfigurations/resource/v1/deviceclassspec.go @@ -21,8 +21,9 @@ package v1 // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // with apply. type DeviceClassSpecApplyConfiguration struct { - Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` - Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + ExtendedResourceName *string `json:"extendedResourceName,omitempty"` } // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with @@ -56,3 +57,11 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon } return b } + +// WithExtendedResourceName sets the ExtendedResourceName 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 ExtendedResourceName field is set to the value of the last call. +func (b *DeviceClassSpecApplyConfiguration) WithExtendedResourceName(value string) *DeviceClassSpecApplyConfiguration { + b.ExtendedResourceName = &value + return b +} diff --git a/applyconfigurations/resource/v1beta1/deviceclassspec.go b/applyconfigurations/resource/v1beta1/deviceclassspec.go index 901b0800..171149eb 100644 --- a/applyconfigurations/resource/v1beta1/deviceclassspec.go +++ b/applyconfigurations/resource/v1beta1/deviceclassspec.go @@ -21,8 +21,9 @@ package v1beta1 // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // with apply. type DeviceClassSpecApplyConfiguration struct { - Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` - Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + ExtendedResourceName *string `json:"extendedResourceName,omitempty"` } // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with @@ -56,3 +57,11 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon } return b } + +// WithExtendedResourceName sets the ExtendedResourceName 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 ExtendedResourceName field is set to the value of the last call. +func (b *DeviceClassSpecApplyConfiguration) WithExtendedResourceName(value string) *DeviceClassSpecApplyConfiguration { + b.ExtendedResourceName = &value + return b +} diff --git a/applyconfigurations/resource/v1beta2/deviceclassspec.go b/applyconfigurations/resource/v1beta2/deviceclassspec.go index c92a83e6..b181fd68 100644 --- a/applyconfigurations/resource/v1beta2/deviceclassspec.go +++ b/applyconfigurations/resource/v1beta2/deviceclassspec.go @@ -21,8 +21,9 @@ package v1beta2 // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // with apply. type DeviceClassSpecApplyConfiguration struct { - Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` - Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + ExtendedResourceName *string `json:"extendedResourceName,omitempty"` } // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with @@ -56,3 +57,11 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon } return b } + +// WithExtendedResourceName sets the ExtendedResourceName 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 ExtendedResourceName field is set to the value of the last call. +func (b *DeviceClassSpecApplyConfiguration) WithExtendedResourceName(value string) *DeviceClassSpecApplyConfiguration { + b.ExtendedResourceName = &value + return b +} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 6c5959d9..e0f2b420 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -720,6 +720,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.ConfigMapVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Container"): return &applyconfigurationscorev1.ContainerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerExtendedResourceRequest"): + return &applyconfigurationscorev1.ContainerExtendedResourceRequestApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerImage"): return &applyconfigurationscorev1.ContainerImageApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerPort"): @@ -930,6 +932,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.PodDNSConfigApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodDNSConfigOption"): return &applyconfigurationscorev1.PodDNSConfigOptionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodExtendedResourceClaimStatus"): + return &applyconfigurationscorev1.PodExtendedResourceClaimStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodIP"): return &applyconfigurationscorev1.PodIPApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodOS"):