extended resource backed by DRA: codegen

Kubernetes-commit: 3068b60b830fb77694300c2274144de13a220481
This commit is contained in:
yliao 2025-07-17 16:45:05 +00:00 committed by Kubernetes Publisher
parent bb115818ba
commit 3b7d818a7f
8 changed files with 213 additions and 23 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -26,23 +26,24 @@ import (
// PodStatusApplyConfiguration represents a declarative configuration of the PodStatus type for use // PodStatusApplyConfiguration represents a declarative configuration of the PodStatus type for use
// with apply. // with apply.
type PodStatusApplyConfiguration struct { type PodStatusApplyConfiguration struct {
ObservedGeneration *int64 `json:"observedGeneration,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
Phase *corev1.PodPhase `json:"phase,omitempty"` Phase *corev1.PodPhase `json:"phase,omitempty"`
Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"` Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"`
Message *string `json:"message,omitempty"` Message *string `json:"message,omitempty"`
Reason *string `json:"reason,omitempty"` Reason *string `json:"reason,omitempty"`
NominatedNodeName *string `json:"nominatedNodeName,omitempty"` NominatedNodeName *string `json:"nominatedNodeName,omitempty"`
HostIP *string `json:"hostIP,omitempty"` HostIP *string `json:"hostIP,omitempty"`
HostIPs []HostIPApplyConfiguration `json:"hostIPs,omitempty"` HostIPs []HostIPApplyConfiguration `json:"hostIPs,omitempty"`
PodIP *string `json:"podIP,omitempty"` PodIP *string `json:"podIP,omitempty"`
PodIPs []PodIPApplyConfiguration `json:"podIPs,omitempty"` PodIPs []PodIPApplyConfiguration `json:"podIPs,omitempty"`
StartTime *metav1.Time `json:"startTime,omitempty"` StartTime *metav1.Time `json:"startTime,omitempty"`
InitContainerStatuses []ContainerStatusApplyConfiguration `json:"initContainerStatuses,omitempty"` InitContainerStatuses []ContainerStatusApplyConfiguration `json:"initContainerStatuses,omitempty"`
ContainerStatuses []ContainerStatusApplyConfiguration `json:"containerStatuses,omitempty"` ContainerStatuses []ContainerStatusApplyConfiguration `json:"containerStatuses,omitempty"`
QOSClass *corev1.PodQOSClass `json:"qosClass,omitempty"` QOSClass *corev1.PodQOSClass `json:"qosClass,omitempty"`
EphemeralContainerStatuses []ContainerStatusApplyConfiguration `json:"ephemeralContainerStatuses,omitempty"` EphemeralContainerStatuses []ContainerStatusApplyConfiguration `json:"ephemeralContainerStatuses,omitempty"`
Resize *corev1.PodResizeStatus `json:"resize,omitempty"` Resize *corev1.PodResizeStatus `json:"resize,omitempty"`
ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"`
ExtendedResourceClaimStatus *PodExtendedResourceClaimStatusApplyConfiguration `json:"extendedResourceClaimStatus,omitempty"`
} }
// PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with // PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with
@ -221,3 +222,11 @@ func (b *PodStatusApplyConfiguration) WithResourceClaimStatuses(values ...*PodRe
} }
return b 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
}

View File

@ -5379,6 +5379,21 @@ var schemaYAML = typed.YAMLObject(`types:
- name: workingDir - name: workingDir
type: type:
scalar: string 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 - name: io.k8s.api.core.v1.ContainerImage
map: map:
fields: fields:
@ -7323,6 +7338,19 @@ var schemaYAML = typed.YAMLObject(`types:
- name: value - name: value
type: type:
scalar: string 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 - name: io.k8s.api.core.v1.PodIP
map: map:
fields: fields:
@ -7628,6 +7656,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementType: elementType:
namedType: io.k8s.api.core.v1.ContainerStatus namedType: io.k8s.api.core.v1.ContainerStatus
elementRelationship: atomic elementRelationship: atomic
- name: extendedResourceClaimStatus
type:
namedType: io.k8s.api.core.v1.PodExtendedResourceClaimStatus
- name: hostIP - name: hostIP
type: type:
scalar: string scalar: string
@ -13005,6 +13036,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementType: elementType:
namedType: io.k8s.api.resource.v1.DeviceClassConfiguration namedType: io.k8s.api.resource.v1.DeviceClassConfiguration
elementRelationship: atomic elementRelationship: atomic
- name: extendedResourceName
type:
scalar: string
- name: selectors - name: selectors
type: type:
list: list:
@ -13701,6 +13735,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementType: elementType:
namedType: io.k8s.api.resource.v1beta1.DeviceClassConfiguration namedType: io.k8s.api.resource.v1beta1.DeviceClassConfiguration
elementRelationship: atomic elementRelationship: atomic
- name: extendedResourceName
type:
scalar: string
- name: selectors - name: selectors
type: type:
list: list:
@ -14307,6 +14344,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementType: elementType:
namedType: io.k8s.api.resource.v1beta2.DeviceClassConfiguration namedType: io.k8s.api.resource.v1beta2.DeviceClassConfiguration
elementRelationship: atomic elementRelationship: atomic
- name: extendedResourceName
type:
scalar: string
- name: selectors - name: selectors
type: type:
list: list:

View File

@ -21,8 +21,9 @@ package v1
// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use
// with apply. // with apply.
type DeviceClassSpecApplyConfiguration struct { type DeviceClassSpecApplyConfiguration struct {
Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"`
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
} }
// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with
@ -56,3 +57,11 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon
} }
return b 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
}

View File

@ -21,8 +21,9 @@ package v1beta1
// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use
// with apply. // with apply.
type DeviceClassSpecApplyConfiguration struct { type DeviceClassSpecApplyConfiguration struct {
Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"`
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
} }
// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with
@ -56,3 +57,11 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon
} }
return b 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
}

View File

@ -21,8 +21,9 @@ package v1beta2
// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use
// with apply. // with apply.
type DeviceClassSpecApplyConfiguration struct { type DeviceClassSpecApplyConfiguration struct {
Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"`
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
} }
// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with
@ -56,3 +57,11 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon
} }
return b 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
}

View File

@ -720,6 +720,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.ConfigMapVolumeSourceApplyConfiguration{} return &applyconfigurationscorev1.ConfigMapVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("Container"): case corev1.SchemeGroupVersion.WithKind("Container"):
return &applyconfigurationscorev1.ContainerApplyConfiguration{} return &applyconfigurationscorev1.ContainerApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ContainerExtendedResourceRequest"):
return &applyconfigurationscorev1.ContainerExtendedResourceRequestApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ContainerImage"): case corev1.SchemeGroupVersion.WithKind("ContainerImage"):
return &applyconfigurationscorev1.ContainerImageApplyConfiguration{} return &applyconfigurationscorev1.ContainerImageApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ContainerPort"): case corev1.SchemeGroupVersion.WithKind("ContainerPort"):
@ -930,6 +932,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.PodDNSConfigApplyConfiguration{} return &applyconfigurationscorev1.PodDNSConfigApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("PodDNSConfigOption"): case corev1.SchemeGroupVersion.WithKind("PodDNSConfigOption"):
return &applyconfigurationscorev1.PodDNSConfigOptionApplyConfiguration{} return &applyconfigurationscorev1.PodDNSConfigOptionApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("PodExtendedResourceClaimStatus"):
return &applyconfigurationscorev1.PodExtendedResourceClaimStatusApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("PodIP"): case corev1.SchemeGroupVersion.WithKind("PodIP"):
return &applyconfigurationscorev1.PodIPApplyConfiguration{} return &applyconfigurationscorev1.PodIPApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("PodOS"): case corev1.SchemeGroupVersion.WithKind("PodOS"):