mirror of
https://github.com/kubernetes/client-go.git
synced 2026-06-13 20:56:36 +00:00
Compare commits
90 Commits
v0.36.0-al
...
v0.36.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
877f535934 | ||
|
|
f22a53e627 | ||
|
|
a948641f81 | ||
|
|
7e44ffcaa9 | ||
|
|
df2d882697 | ||
|
|
4eece5291a | ||
|
|
3d35c51207 | ||
|
|
0434117726 | ||
|
|
ba785be0ac | ||
|
|
4a9c8783a9 | ||
|
|
0131054016 | ||
|
|
9b29e67df1 | ||
|
|
4c2ee9a3e2 | ||
|
|
2fb6b9cac0 | ||
|
|
b2267f3d75 | ||
|
|
382d307f87 | ||
|
|
6c21384776 | ||
|
|
69d2e66589 | ||
|
|
bb93391625 | ||
|
|
828813ca69 | ||
|
|
27bd9ce449 | ||
|
|
15a9dffb52 | ||
|
|
ea7a7e7cf9 | ||
|
|
61a40f5111 | ||
|
|
39f55294aa | ||
|
|
c73e37f377 | ||
|
|
9dc763689d | ||
|
|
c07c271a94 | ||
|
|
2517e8773a | ||
|
|
3505da0deb | ||
|
|
97ac09639d | ||
|
|
9cdd63fee2 | ||
|
|
32a3ac47cf | ||
|
|
e807f52104 | ||
|
|
a179e3b9fb | ||
|
|
4bf554630d | ||
|
|
2e882c6ea6 | ||
|
|
6f2c112d22 | ||
|
|
2f31bfec5d | ||
|
|
88da827ca3 | ||
|
|
c826020ed9 | ||
|
|
c3a1049f7e | ||
|
|
989fb5d38c | ||
|
|
294ecb1d8c | ||
|
|
c7f8506da0 | ||
|
|
78536fe27c | ||
|
|
06163fb266 | ||
|
|
388997a877 | ||
|
|
a72ad3ccbc | ||
|
|
9f41e94324 | ||
|
|
d91024383a | ||
|
|
aae801378e | ||
|
|
3e4de9e6b4 | ||
|
|
e45d8623ff | ||
|
|
187c42c884 | ||
|
|
2dd466fcfe | ||
|
|
486be0fbf9 | ||
|
|
e243a98fa8 | ||
|
|
f6c2d7ca65 | ||
|
|
55e741a004 | ||
|
|
27966b2574 | ||
|
|
8776b282cc | ||
|
|
9926c67348 | ||
|
|
c86837f7ed | ||
|
|
2f21ae3478 | ||
|
|
b59431fbc5 | ||
|
|
54ee8fecae | ||
|
|
f037d681ac | ||
|
|
99791c7452 | ||
|
|
1f07d6645b | ||
|
|
efbad1b7ed | ||
|
|
73f4fa85e7 | ||
|
|
f66040b9dc | ||
|
|
b840391f92 | ||
|
|
1349319d7c | ||
|
|
8a32b4087c | ||
|
|
f1d9ba91c7 | ||
|
|
e8eab37058 | ||
|
|
f6cd0c0583 | ||
|
|
67f0d98034 | ||
|
|
97646e5606 | ||
|
|
103162f118 | ||
|
|
78fb6ed2e1 | ||
|
|
1d4002e88b | ||
|
|
a63d33951d | ||
|
|
d6503fcc3e | ||
|
|
f5fc1e5f67 | ||
|
|
e924e3f2c5 | ||
|
|
1f85fd1a13 | ||
|
|
7bb07cbe8e |
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// NodeAllocatableResourceClaimStatusApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceClaimStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.
|
||||
type NodeAllocatableResourceClaimStatusApplyConfiguration struct {
|
||||
// ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.
|
||||
ResourceClaimName *string `json:"resourceClaimName,omitempty"`
|
||||
// Containers lists the names of all containers in this pod that reference the claim.
|
||||
Containers []string `json:"containers,omitempty"`
|
||||
// Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim.
|
||||
Resources map[corev1.ResourceName]resource.Quantity `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceClaimStatusApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceClaimStatus type for use with
|
||||
// apply.
|
||||
func NodeAllocatableResourceClaimStatus() *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
return &NodeAllocatableResourceClaimStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *NodeAllocatableResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
b.ResourceClaimName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithContainers adds the given value to the Containers 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 Containers field.
|
||||
func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithContainers(values ...string) *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Containers = append(b.Containers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResources puts the entries into the Resources 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 Resources field,
|
||||
// overwriting an existing map entries in Resources field with the same key.
|
||||
func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithResources(entries map[corev1.ResourceName]resource.Quantity) *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
if b.Resources == nil && len(entries) > 0 {
|
||||
b.Resources = make(map[corev1.ResourceName]resource.Quantity, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Resources[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -27,6 +27,14 @@ package v1
|
||||
//
|
||||
// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
|
||||
// Containers that need access to the ResourceClaim reference it with this name.
|
||||
//
|
||||
// When the DRAWorkloadResourceClaims feature gate is enabled and this Pod
|
||||
// belongs to a PodGroup, a PodResourceClaim is matched to a
|
||||
// PodGroupResourceClaim if all of their fields are equal (Name,
|
||||
// ResourceClaimName, and ResourceClaimTemplateName). A matched claim references
|
||||
// a single ResourceClaim shared across all Pods in the PodGroup, reserved for
|
||||
// the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual
|
||||
// Pods.
|
||||
type PodResourceClaimApplyConfiguration struct {
|
||||
// Name uniquely identifies this resource claim inside the pod.
|
||||
// This must be a DNS_LABEL.
|
||||
@@ -46,6 +54,16 @@ type PodResourceClaimApplyConfiguration struct {
|
||||
// generated component, will be used to form a unique name for the
|
||||
// ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
|
||||
//
|
||||
// When the DRAWorkloadResourceClaims feature gate is enabled and the pod
|
||||
// belongs to a PodGroup that defines a PodGroupResourceClaim with the same
|
||||
// Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the
|
||||
// ResourceClaim generated for the PodGroup. All pods in the group that
|
||||
// define an equivalent PodResourceClaim matching the
|
||||
// PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same
|
||||
// generated ResourceClaim. ResourceClaims generated for a PodGroup are
|
||||
// owned by the PodGroup and their lifecycles are tied to the PodGroup
|
||||
// instead of any individual pod.
|
||||
//
|
||||
// This field is immutable and no changes will be made to the
|
||||
// corresponding ResourceClaim by the control plane after creating the
|
||||
// ResourceClaim.
|
||||
|
||||
@@ -30,9 +30,16 @@ type PodResourceClaimStatusApplyConfiguration struct {
|
||||
// which implies that the string must be a DNS_LABEL.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ResourceClaimName is the name of the ResourceClaim that was
|
||||
// generated for the Pod in the namespace of the Pod. If this is
|
||||
// unset, then generating a ResourceClaim was not necessary. The
|
||||
// pod.spec.resourceClaims entry can be ignored in this case.
|
||||
// generated for the Pod in the namespace of the Pod.
|
||||
//
|
||||
// When the DRAWorkloadResourceClaims feature is enabled and the
|
||||
// corresponding PodResourceClaim matches a PodGroupResourceClaim
|
||||
// made by the Pod's PodGroup, then this is the name of the
|
||||
// ResourceClaim generated and reserved for the PodGroup.
|
||||
//
|
||||
// If this is unset, then generating a ResourceClaim was not
|
||||
// necessary. The pod.spec.resourceClaims entry can be ignored in
|
||||
// this case.
|
||||
ResourceClaimName *string `json:"resourceClaimName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
46
applyconfigurations/core/v1/podschedulinggroup.go
Normal file
46
applyconfigurations/core/v1/podschedulinggroup.go
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// PodSchedulingGroupApplyConfiguration represents a declarative configuration of the PodSchedulingGroup type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodSchedulingGroup identifies the runtime scheduling group instance that a Pod belongs to.
|
||||
// The scheduler uses this information to apply workload-aware scheduling semantics.
|
||||
// Exactly one field must be specified.
|
||||
type PodSchedulingGroupApplyConfiguration struct {
|
||||
// PodGroupName specifies the name of the standalone PodGroup object
|
||||
// that represents the runtime instance of this group.
|
||||
// Must be a DNS subdomain.
|
||||
PodGroupName *string `json:"podGroupName,omitempty"`
|
||||
}
|
||||
|
||||
// PodSchedulingGroupApplyConfiguration constructs a declarative configuration of the PodSchedulingGroup type for use with
|
||||
// apply.
|
||||
func PodSchedulingGroup() *PodSchedulingGroupApplyConfiguration {
|
||||
return &PodSchedulingGroupApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPodGroupName sets the PodGroupName 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 PodGroupName field is set to the value of the last call.
|
||||
func (b *PodSchedulingGroupApplyConfiguration) WithPodGroupName(value string) *PodSchedulingGroupApplyConfiguration {
|
||||
b.PodGroupName = &value
|
||||
return b
|
||||
}
|
||||
@@ -233,7 +233,6 @@ type PodSpecApplyConfiguration struct {
|
||||
// When set to false, a new userns is created for the pod. Setting false is useful for
|
||||
// mitigating container breakout vulnerabilities even allowing users to run their
|
||||
// containers as root without actually having root privileges on the host.
|
||||
// This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.
|
||||
HostUsers *bool `json:"hostUsers,omitempty"`
|
||||
// SchedulingGates is an opaque list of values that if specified will block scheduling the pod.
|
||||
// If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
|
||||
@@ -273,14 +272,19 @@ type PodSpecApplyConfiguration struct {
|
||||
// This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters.
|
||||
// Requires the HostnameOverride feature gate to be enabled.
|
||||
HostnameOverride *string `json:"hostnameOverride,omitempty"`
|
||||
// WorkloadRef provides a reference to the Workload object that this Pod belongs to.
|
||||
// This field is used by the scheduler to identify the PodGroup and apply the
|
||||
// correct group scheduling policies. The Workload object referenced
|
||||
// by this field may not exist at the time the Pod is created.
|
||||
// This field is immutable, but a Workload object with the same name
|
||||
// may be recreated with different policies. Doing this during pod scheduling
|
||||
// SchedulingGroup provides a reference to the immediate scheduling runtime
|
||||
// grouping object that this Pod belongs to.
|
||||
// This field is used by the scheduler to identify the group and apply the
|
||||
// correct group scheduling policies. The association with a group also
|
||||
// impacts other lifecycle aspects of a Pod that are relevant in a wider context
|
||||
// of scheduling like preemption, resource attachment, etc. If not specified,
|
||||
// the Pod is treated as a single unit in all of these aspects.
|
||||
// The group object referenced by this field may not exist at the time the
|
||||
// Pod is created.
|
||||
// This field is immutable, but a group object with the same name may be
|
||||
// recreated with different policies. Doing this during pod scheduling
|
||||
// may result in the placement not conforming to the expected policies.
|
||||
WorkloadRef *WorkloadReferenceApplyConfiguration `json:"workloadRef,omitempty"`
|
||||
SchedulingGroup *PodSchedulingGroupApplyConfiguration `json:"schedulingGroup,omitempty"`
|
||||
}
|
||||
|
||||
// PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with
|
||||
@@ -678,10 +682,10 @@ func (b *PodSpecApplyConfiguration) WithHostnameOverride(value string) *PodSpecA
|
||||
return b
|
||||
}
|
||||
|
||||
// WithWorkloadRef sets the WorkloadRef field in the declarative configuration to the given value
|
||||
// WithSchedulingGroup sets the SchedulingGroup 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 WorkloadRef field is set to the value of the last call.
|
||||
func (b *PodSpecApplyConfiguration) WithWorkloadRef(value *WorkloadReferenceApplyConfiguration) *PodSpecApplyConfiguration {
|
||||
b.WorkloadRef = value
|
||||
// If called multiple times, the SchedulingGroup field is set to the value of the last call.
|
||||
func (b *PodSpecApplyConfiguration) WithSchedulingGroup(value *PodSchedulingGroupApplyConfiguration) *PodSpecApplyConfiguration {
|
||||
b.SchedulingGroup = value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -139,6 +139,12 @@ type PodStatusApplyConfiguration struct {
|
||||
// applied at the pod level if pod-level requests or limits are set in
|
||||
// PodSpec.Resources
|
||||
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
|
||||
// NodeAllocatableResourceClaimStatuses contains the status of node-allocatable resources
|
||||
// that were allocated for this pod through DRA claims. This includes resources currently
|
||||
// reported in v1.Node `status.allocatable` that are not extended resources
|
||||
// (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources).
|
||||
// Examples include "cpu", "memory", "ephemeral-storage", and hugepages.
|
||||
NodeAllocatableResourceClaimStatuses []NodeAllocatableResourceClaimStatusApplyConfiguration `json:"nodeAllocatableResourceClaimStatuses,omitempty"`
|
||||
}
|
||||
|
||||
// PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with
|
||||
@@ -341,3 +347,16 @@ func (b *PodStatusApplyConfiguration) WithResources(value *ResourceRequirementsA
|
||||
b.Resources = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceClaimStatuses adds the given value to the NodeAllocatableResourceClaimStatuses 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 NodeAllocatableResourceClaimStatuses field.
|
||||
func (b *PodStatusApplyConfiguration) WithNodeAllocatableResourceClaimStatuses(values ...*NodeAllocatableResourceClaimStatusApplyConfiguration) *PodStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithNodeAllocatableResourceClaimStatuses")
|
||||
}
|
||||
b.NodeAllocatableResourceClaimStatuses = append(b.NodeAllocatableResourceClaimStatuses, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@ type ResourceHealthApplyConfiguration struct {
|
||||
//
|
||||
// In future we may want to introduce the PermanentlyUnhealthy Status.
|
||||
Health *corev1.ResourceHealthStatus `json:"health,omitempty"`
|
||||
// Message provides human-readable context for Health (e.g. "ECC error count exceeded threshold").
|
||||
// This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise.
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceHealthApplyConfiguration constructs a declarative configuration of the ResourceHealth type for use with
|
||||
@@ -64,3 +67,11 @@ func (b *ResourceHealthApplyConfiguration) WithHealth(value corev1.ResourceHealt
|
||||
b.Health = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMessage sets the Message 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 Message field is set to the value of the last call.
|
||||
func (b *ResourceHealthApplyConfiguration) WithMessage(value string) *ResourceHealthApplyConfiguration {
|
||||
b.Message = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ type SecurityContextApplyConfiguration struct {
|
||||
// procMount denotes the type of proc mount to use for the containers.
|
||||
// The default value is Default which uses the container runtime defaults for
|
||||
// readonly paths and masked paths.
|
||||
// This requires the ProcMountType feature flag to be enabled.
|
||||
// Note that this field cannot be set when spec.os.name is windows.
|
||||
ProcMount *corev1.ProcMountType `json:"procMount,omitempty"`
|
||||
// The seccomp options to use by this container. If seccomp options are
|
||||
|
||||
@@ -39,7 +39,7 @@ type VolumeMountStatusApplyConfiguration struct {
|
||||
RecursiveReadOnly *corev1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"`
|
||||
// volumeStatus represents volume-type-specific status about the mounted
|
||||
// volume.
|
||||
*VolumeStatusApplyConfiguration `json:"volumeStatus,omitempty"`
|
||||
VolumeStatus *VolumeStatusApplyConfiguration `json:"volumeStatus,omitempty"`
|
||||
}
|
||||
|
||||
// VolumeMountStatusApplyConfiguration constructs a declarative configuration of the VolumeMountStatus type for use with
|
||||
@@ -80,17 +80,10 @@ func (b *VolumeMountStatusApplyConfiguration) WithRecursiveReadOnly(value corev1
|
||||
return b
|
||||
}
|
||||
|
||||
// WithImage sets the Image field in the declarative configuration to the given value
|
||||
// WithVolumeStatus sets the VolumeStatus 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 Image field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithImage(value *ImageVolumeStatusApplyConfiguration) *VolumeMountStatusApplyConfiguration {
|
||||
b.ensureVolumeStatusApplyConfigurationExists()
|
||||
b.VolumeStatusApplyConfiguration.Image = value
|
||||
// If called multiple times, the VolumeStatus field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithVolumeStatus(value *VolumeStatusApplyConfiguration) *VolumeMountStatusApplyConfiguration {
|
||||
b.VolumeStatus = value
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *VolumeMountStatusApplyConfiguration) ensureVolumeStatusApplyConfigurationExists() {
|
||||
if b.VolumeStatusApplyConfiguration == nil {
|
||||
b.VolumeStatusApplyConfiguration = &VolumeStatusApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ type VolumeSourceApplyConfiguration struct {
|
||||
// A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
|
||||
// The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
|
||||
// The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
|
||||
// The volume will be mounted read-only (ro) and non-executable files (noexec).
|
||||
// The volume will be mounted read-only (ro).
|
||||
// Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33.
|
||||
// The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
|
||||
Image *ImageVolumeSourceApplyConfiguration `json:"image,omitempty"`
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// WorkloadReferenceApplyConfiguration represents a declarative configuration of the WorkloadReference type for use
|
||||
// with apply.
|
||||
//
|
||||
// WorkloadReference identifies the Workload object and PodGroup membership
|
||||
// that a Pod belongs to. The scheduler uses this information to apply
|
||||
// workload-aware scheduling semantics.
|
||||
type WorkloadReferenceApplyConfiguration struct {
|
||||
// Name defines the name of the Workload object this Pod belongs to.
|
||||
// Workload must be in the same namespace as the Pod.
|
||||
// If it doesn't match any existing Workload, the Pod will remain unschedulable
|
||||
// until a Workload object is created and observed by the kube-scheduler.
|
||||
// It must be a DNS subdomain.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// PodGroup is the name of the PodGroup within the Workload that this Pod
|
||||
// belongs to. If it doesn't match any existing PodGroup within the Workload,
|
||||
// the Pod will remain unschedulable until the Workload object is recreated
|
||||
// and observed by the kube-scheduler. It must be a DNS label.
|
||||
PodGroup *string `json:"podGroup,omitempty"`
|
||||
// PodGroupReplicaKey specifies the replica key of the PodGroup to which this
|
||||
// Pod belongs. It is used to distinguish pods belonging to different replicas
|
||||
// of the same pod group. The pod group policy is applied separately to each replica.
|
||||
// When set, it must be a DNS label.
|
||||
PodGroupReplicaKey *string `json:"podGroupReplicaKey,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadReferenceApplyConfiguration constructs a declarative configuration of the WorkloadReference type for use with
|
||||
// apply.
|
||||
func WorkloadReference() *WorkloadReferenceApplyConfiguration {
|
||||
return &WorkloadReferenceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *WorkloadReferenceApplyConfiguration) WithName(value string) *WorkloadReferenceApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroup sets the PodGroup 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 PodGroup field is set to the value of the last call.
|
||||
func (b *WorkloadReferenceApplyConfiguration) WithPodGroup(value string) *WorkloadReferenceApplyConfiguration {
|
||||
b.PodGroup = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroupReplicaKey sets the PodGroupReplicaKey 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 PodGroupReplicaKey field is set to the value of the last call.
|
||||
func (b *WorkloadReferenceApplyConfiguration) WithPodGroupReplicaKey(value string) *WorkloadReferenceApplyConfiguration {
|
||||
b.PodGroupReplicaKey = &value
|
||||
return b
|
||||
}
|
||||
@@ -6040,6 +6040,24 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: requiredDuringSchedulingIgnoredDuringExecution
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.NodeSelector
|
||||
- name: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus
|
||||
map:
|
||||
fields:
|
||||
- name: containers
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: resourceClaimName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resources
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: io.k8s.api.core.v1.NodeCondition
|
||||
map:
|
||||
fields:
|
||||
@@ -6873,6 +6891,16 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.core.v1.PodSchedulingGroup
|
||||
map:
|
||||
fields:
|
||||
- name: podGroupName
|
||||
type:
|
||||
scalar: string
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: podGroupName
|
||||
discriminatorValue: PodGroupName
|
||||
- name: io.k8s.api.core.v1.PodSecurityContext
|
||||
map:
|
||||
fields:
|
||||
@@ -7060,6 +7088,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: schedulingGroup
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.PodSchedulingGroup
|
||||
- name: securityContext
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.PodSecurityContext
|
||||
@@ -7104,9 +7135,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: workloadRef
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.WorkloadReference
|
||||
- name: io.k8s.api.core.v1.PodStatus
|
||||
map:
|
||||
fields:
|
||||
@@ -7156,6 +7184,12 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: nodeAllocatableResourceClaimStatuses
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus
|
||||
elementRelationship: atomic
|
||||
- name: nominatedNodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -7519,6 +7553,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: health
|
||||
type:
|
||||
scalar: string
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceID
|
||||
type:
|
||||
scalar: string
|
||||
@@ -8410,7 +8447,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: volumeStatus
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.VolumeStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.core.v1.VolumeNodeAffinity
|
||||
map:
|
||||
fields:
|
||||
@@ -8499,20 +8535,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: runAsUserName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.core.v1.WorkloadReference
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: podGroup
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: podGroupReplicaKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.discovery.v1.Endpoint
|
||||
map:
|
||||
fields:
|
||||
@@ -12454,6 +12476,11 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: nodeAllocatableResourceMappings
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1.NodeAllocatableResourceMapping
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -12503,15 +12530,39 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: bools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: boolean
|
||||
elementRelationship: atomic
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: versions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
@@ -12806,6 +12857,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1.NodeAllocatableResourceMapping
|
||||
map:
|
||||
fields:
|
||||
- name: allocationMultiplier
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: capacityKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -13053,6 +13113,94 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.PoolStatus
|
||||
map:
|
||||
fields:
|
||||
- name: allocatedDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: availableDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
- name: generation
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
- name: poolName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceSliceCount
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: totalDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: unavailableDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: validationError
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequest
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestStatus
|
||||
- name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestSpec
|
||||
map:
|
||||
fields:
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: limit
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 100
|
||||
- name: poolName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: poolCount
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: pools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha3.PoolStatus
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus
|
||||
map:
|
||||
fields:
|
||||
@@ -13138,6 +13286,11 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption
|
||||
elementRelationship: atomic
|
||||
- name: nodeAllocatableResourceMappings
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -13257,15 +13410,39 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: bools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: boolean
|
||||
elementRelationship: atomic
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: versions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
@@ -13554,6 +13731,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping
|
||||
map:
|
||||
fields:
|
||||
- name: allocationMultiplier
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: capacityKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -13879,6 +14065,11 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: nodeAllocatableResourceMappings
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -13928,15 +14119,39 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: bools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: boolean
|
||||
elementRelationship: atomic
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: versions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
@@ -14166,6 +14381,60 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: value
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceTaintRule
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaintRuleSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaintRuleStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceTaintRuleSpec
|
||||
map:
|
||||
fields:
|
||||
- name: deviceSelector
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaintSelector
|
||||
- name: taint
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaint
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceTaintRuleStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceTaintSelector
|
||||
map:
|
||||
fields:
|
||||
- name: device
|
||||
type:
|
||||
scalar: string
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceToleration
|
||||
map:
|
||||
fields:
|
||||
@@ -14231,6 +14500,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping
|
||||
map:
|
||||
fields:
|
||||
- name: allocationMultiplier
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: capacityKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -14433,7 +14711,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.scheduling.v1alpha1.BasicSchedulingPolicy
|
||||
- name: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy
|
||||
map:
|
||||
elementType:
|
||||
scalar: untyped
|
||||
@@ -14445,80 +14723,14 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
namedType: __untyped_deduced_
|
||||
elementRelationship: separable
|
||||
- name: io.k8s.api.scheduling.v1alpha1.GangSchedulingPolicy
|
||||
- name: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: minCount
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.scheduling.v1alpha1.PodGroup
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: policy
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.PodGroupPolicy
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha1.PodGroupPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: basic
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.BasicSchedulingPolicy
|
||||
- name: gang
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.GangSchedulingPolicy
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: basic
|
||||
discriminatorValue: Basic
|
||||
- fieldName: gang
|
||||
discriminatorValue: Gang
|
||||
- name: io.k8s.api.scheduling.v1alpha1.PriorityClass
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: description
|
||||
type:
|
||||
scalar: string
|
||||
- name: globalDefault
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: preemptionPolicy
|
||||
type:
|
||||
scalar: string
|
||||
- name: value
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.scheduling.v1alpha1.TypedLocalObjectReference
|
||||
map:
|
||||
fields:
|
||||
- name: apiGroup
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.scheduling.v1alpha1.Workload
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroup
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
@@ -14533,19 +14745,210 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.WorkloadSpec
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha1.WorkloadSpec
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resourceClaimName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceClaimTemplateName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resourceClaimName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints
|
||||
map:
|
||||
fields:
|
||||
- name: topology
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.TopologyConstraint
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: basic
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy
|
||||
- name: gang
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: basic
|
||||
discriminatorValue: Basic
|
||||
- fieldName: gang
|
||||
discriminatorValue: Gang
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupSpec
|
||||
map:
|
||||
fields:
|
||||
- name: disruptionMode
|
||||
type:
|
||||
scalar: string
|
||||
default: Pod
|
||||
- name: podGroupTemplateRef
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference
|
||||
- name: priority
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: priorityClassName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceClaims
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: schedulingConstraints
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints
|
||||
- name: schedulingPolicy
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: resourceClaimStatuses
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate
|
||||
map:
|
||||
fields:
|
||||
- name: disruptionMode
|
||||
type:
|
||||
scalar: string
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: priority
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: priorityClassName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceClaims
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: schedulingConstraints
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints
|
||||
- name: schedulingPolicy
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference
|
||||
map:
|
||||
fields:
|
||||
- name: workload
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: workload
|
||||
discriminatorValue: Workload
|
||||
- name: io.k8s.api.scheduling.v1alpha2.TopologyConstraint
|
||||
map:
|
||||
fields:
|
||||
- name: key
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference
|
||||
map:
|
||||
fields:
|
||||
- name: apiGroup
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.scheduling.v1alpha2.Workload
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.WorkloadSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference
|
||||
map:
|
||||
fields:
|
||||
- name: podGroupTemplateName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: workloadName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.scheduling.v1alpha2.WorkloadSpec
|
||||
map:
|
||||
fields:
|
||||
- name: controllerRef
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.TypedLocalObjectReference
|
||||
- name: podGroups
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference
|
||||
- name: podGroupTemplates
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.PodGroup
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
@@ -14607,6 +15010,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: podInfoOnMount
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: preventPodSchedulingIfMissing
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: requiresRepublish
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -15016,6 +15422,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: podInfoOnMount
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: preventPodSchedulingIfMissing
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: requiresRepublish
|
||||
type:
|
||||
scalar: boolean
|
||||
|
||||
@@ -36,7 +36,7 @@ type AllocationResultApplyConfiguration struct {
|
||||
// AllocationTimestamp stores the time when the resources were allocated.
|
||||
// This field is not guaranteed to be set, in which case that time is unknown.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gate.
|
||||
AllocationTimestamp *metav1.Time `json:"allocationTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ type CELDeviceSelectorApplyConfiguration struct {
|
||||
//
|
||||
// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled,
|
||||
// the includes() helper is available and it can work for both scalar
|
||||
// and list-type attributes. It was introduced to support smooth migration
|
||||
// from scalar attributes to list-type attributes while keeping
|
||||
// CEL expressions simple. For example:
|
||||
//
|
||||
// device.attributes["dra.example.com"].models.includes("some-model")
|
||||
//
|
||||
// The length of the expression must be smaller or equal to 10 Ki. The
|
||||
// cost of evaluating it is also limited based on the estimated number
|
||||
// of logical steps.
|
||||
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
apicorev1 "k8s.io/api/core/v1"
|
||||
resourcev1 "k8s.io/api/resource/v1"
|
||||
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
@@ -74,7 +75,7 @@ type DeviceApplyConfiguration struct {
|
||||
// any device in a ResourceSlice, then the maximum number of
|
||||
// allowed devices per ResourceSlice is 64 instead of 128.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -82,7 +83,7 @@ type DeviceApplyConfiguration struct {
|
||||
// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
|
||||
// to match the node where the allocation was made.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindsToNode *bool `json:"bindsToNode,omitempty"`
|
||||
// BindingConditions defines the conditions for proceeding with binding.
|
||||
@@ -94,7 +95,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -105,7 +106,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -113,6 +114,18 @@ type DeviceApplyConfiguration struct {
|
||||
// If AllowMultipleAllocations is set to true, the device can be allocated more than once,
|
||||
// and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.
|
||||
AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty"`
|
||||
// NodeAllocatableResourceMappings defines the mapping of node resources
|
||||
// that are managed by the DRA driver exposing this device. This includes resources currently
|
||||
// reported in v1.Node `status.allocatable` that are not extended resources
|
||||
// (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources).
|
||||
// Examples include "cpu", "memory", "ephemeral-storage", and hugepages.
|
||||
// In addition to standard requests made through the Pod `spec`, these resources
|
||||
// can also be requested through claims and allocated by the DRA driver.
|
||||
// For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory
|
||||
// dependencies of an accelerator device.
|
||||
// The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory").
|
||||
// Extended resource names are not permitted as keys.
|
||||
NodeAllocatableResourceMappings map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with
|
||||
@@ -242,3 +255,17 @@ func (b *DeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) *Dev
|
||||
b.AllowMultipleAllocations = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings 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 NodeAllocatableResourceMappings field,
|
||||
// overwriting an existing map entries in NodeAllocatableResourceMappings field with the same key.
|
||||
func (b *DeviceApplyConfiguration) WithNodeAllocatableResourceMappings(entries map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration) *DeviceApplyConfiguration {
|
||||
if b.NodeAllocatableResourceMappings == nil && len(entries) > 0 {
|
||||
b.NodeAllocatableResourceMappings = make(map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.NodeAllocatableResourceMappings[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -32,6 +32,22 @@ type DeviceAttributeApplyConfiguration struct {
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
IntValues []int64 `json:"ints,omitempty"`
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
BoolValues []bool `json:"bools,omitempty"`
|
||||
// StringValues is a non-empty list of strings.
|
||||
// Each string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
StringValues []string `json:"strings,omitempty"`
|
||||
// VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0.
|
||||
// Each version string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
VersionValues []string `json:"versions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
@@ -71,3 +87,43 @@ func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *Devi
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValues adds the given value to the IntValues 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 IntValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValues(values ...int64) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IntValues = append(b.IntValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValues adds the given value to the BoolValues 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 BoolValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValues(values ...bool) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.BoolValues = append(b.BoolValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValues adds the given value to the StringValues 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 StringValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.StringValues = append(b.StringValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValues adds the given value to the VersionValues 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 VersionValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.VersionValues = append(b.VersionValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type DeviceClassSpecApplyConfiguration struct {
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is an alpha field.
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,21 @@ type DeviceConstraintApplyConfiguration struct {
|
||||
// its specification, but if one device doesn't, then it also will not be
|
||||
// chosen.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics(i.e., element order and duplicates are ignored): list-valued attributes
|
||||
// match when the intersection across all devices is non-empty.
|
||||
// Scalar values are treated as single-element lists for backward compatibility.
|
||||
//
|
||||
// Must include the domain qualifier.
|
||||
MatchAttribute *resourcev1.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
// DistinctAttribute requires that all devices in question have this
|
||||
// attribute and that its type and value are unique across those devices.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics (i.e., element order and duplicates are ignored):
|
||||
// list-valued attributes must be pairwise disjoint across devices.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// This acts as the inverse of MatchAttribute.
|
||||
//
|
||||
// This constraint is used to avoid allocating multiple requests to the same device
|
||||
|
||||
@@ -57,8 +57,7 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
// administrative access. See the corresponding request field
|
||||
// for a definition of mode.
|
||||
//
|
||||
// This is an beta field and requires enabling the DRAAdminAccess
|
||||
// feature gate. Admin access is disabled if this field is unset or
|
||||
// Admin access is disabled if this field is unset or
|
||||
// set to false, otherwise it is enabled.
|
||||
AdminAccess *bool `json:"adminAccess,omitempty"`
|
||||
// A copy of all tolerations specified in the request at the time
|
||||
@@ -66,19 +65,19 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions contains a copy of the BindingFailureConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
|
||||
@@ -93,7 +93,7 @@ type DeviceSubRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *metav1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,7 @@ type ExactDeviceRequestApplyConfiguration struct {
|
||||
// all ordinary claims to the device with respect to access modes and
|
||||
// any resource allocations.
|
||||
//
|
||||
// This is an beta field and requires enabling the DRAAdminAccess
|
||||
// feature gate. Admin access is disabled if this field is unset or
|
||||
// Admin access is disabled if this field is unset or
|
||||
// set to false, otherwise it is enabled.
|
||||
AdminAccess *bool `json:"adminAccess,omitempty"`
|
||||
// If specified, the request's tolerations.
|
||||
@@ -91,7 +90,7 @@ type ExactDeviceRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -29,7 +29,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
// the allocated device. This might be the name of a physical or virtual
|
||||
// network interface being configured in the pod.
|
||||
//
|
||||
// Must not be longer than 256 characters.
|
||||
// Must not be longer than 256 bytes.
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
// This can include both IPv4 and IPv6 addresses.
|
||||
@@ -39,7 +39,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
|
||||
//
|
||||
// Must not be longer than 128 characters.
|
||||
// Must not be longer than 128 bytes.
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
resourcev1 "k8s.io/api/resource/v1"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// NodeAllocatableResourceMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceMapping type for use
|
||||
// with apply.
|
||||
//
|
||||
// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity
|
||||
// units requested to the corresponding quantity of the node allocatable resource.
|
||||
type NodeAllocatableResourceMappingApplyConfiguration struct {
|
||||
// CapacityKey references a capacity name defined as a key in the
|
||||
// `spec.devices[*].capacity` map. When this field is set, the value associated with
|
||||
// this key in the `status.allocation.devices.results[*].consumedCapacity` map
|
||||
// (for a specific claim allocation) determines the base quantity for
|
||||
// the node allocatable resource. If `allocationMultiplier` is also set, it is
|
||||
// multiplied with the base quantity.
|
||||
// For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi",
|
||||
// and this field is set to "dra.example.com/memory", then for a claim allocation
|
||||
// that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the
|
||||
// node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should
|
||||
// be omitted or set to "1".
|
||||
CapacityKey *resourcev1.QualifiedName `json:"capacityKey,omitempty"`
|
||||
// AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim.
|
||||
// It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set.
|
||||
// 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim.
|
||||
// a. A DRA driver representing each CPU core as a device would have
|
||||
// {ResourceName: "cpu", allocationMultiplier: "2"} in its
|
||||
// `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,
|
||||
// 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.
|
||||
// b. A GPU device that needs additional node memory per GPU allocation would
|
||||
// have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated
|
||||
// GPU device instance of this type will account for 2Gi of memory.
|
||||
//
|
||||
// 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.
|
||||
// The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.
|
||||
// For example, if a Device's capacity "dra.example.com/cores" is consumed,
|
||||
// and each "core" provides 2 "cpu"s, the mapping would be:
|
||||
// {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}.
|
||||
// If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16.
|
||||
AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty"`
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceMapping type for use with
|
||||
// apply.
|
||||
func NodeAllocatableResourceMapping() *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
return &NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithCapacityKey sets the CapacityKey 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 CapacityKey field is set to the value of the last call.
|
||||
func (b *NodeAllocatableResourceMappingApplyConfiguration) WithCapacityKey(value resourcev1.QualifiedName) *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
b.CapacityKey = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllocationMultiplier sets the AllocationMultiplier 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 AllocationMultiplier field is set to the value of the last call.
|
||||
func (b *NodeAllocatableResourceMappingApplyConfiguration) WithAllocationMultiplier(value resource.Quantity) *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
b.AllocationMultiplier = &value
|
||||
return b
|
||||
}
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1alpha3.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
152
applyconfigurations/resource/v1alpha3/poolstatus.go
Normal file
152
applyconfigurations/resource/v1alpha3/poolstatus.go
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// PoolStatusApplyConfiguration represents a declarative configuration of the PoolStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// PoolStatus contains status information for a single resource pool.
|
||||
type PoolStatusApplyConfiguration struct {
|
||||
// Driver is the DRA driver name for this pool.
|
||||
// Must be a DNS subdomain (e.g., "gpu.example.com").
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
// PoolName is the name of the pool.
|
||||
// Must be a valid resource pool name (DNS subdomains separated by "/").
|
||||
PoolName *string `json:"poolName,omitempty"`
|
||||
// Generation is the pool generation observed across all ResourceSlices
|
||||
// in this pool. Only the latest generation is reported. During a generation
|
||||
// rollout, if not all slices at the latest generation have been published,
|
||||
// the pool is included with a validationError and device counts unset.
|
||||
Generation *int64 `json:"generation,omitempty"`
|
||||
// ResourceSliceCount is the number of ResourceSlices that make up this pool.
|
||||
// May be unset when validationError is set.
|
||||
ResourceSliceCount *int32 `json:"resourceSliceCount,omitempty"`
|
||||
// TotalDevices is the total number of devices in the pool across all slices.
|
||||
// A value of 0 means the pool has no devices.
|
||||
// May be unset when validationError is set.
|
||||
TotalDevices *int32 `json:"totalDevices,omitempty"`
|
||||
// AllocatedDevices is the number of devices currently allocated to claims.
|
||||
// A value of 0 means no devices are allocated.
|
||||
// May be unset when validationError is set.
|
||||
AllocatedDevices *int32 `json:"allocatedDevices,omitempty"`
|
||||
// AvailableDevices is the number of devices available for allocation.
|
||||
// This equals TotalDevices - AllocatedDevices - UnavailableDevices.
|
||||
// A value of 0 means no devices are currently available.
|
||||
// May be unset when validationError is set.
|
||||
AvailableDevices *int32 `json:"availableDevices,omitempty"`
|
||||
// UnavailableDevices is the number of devices that are not available
|
||||
// due to taints or other conditions, but are not allocated.
|
||||
// A value of 0 means all unallocated devices are available.
|
||||
// May be unset when validationError is set.
|
||||
UnavailableDevices *int32 `json:"unavailableDevices,omitempty"`
|
||||
// NodeName is the node this pool is associated with.
|
||||
// When omitted, the pool is not associated with a specific node.
|
||||
// Must be a valid DNS subdomain name (RFC1123).
|
||||
NodeName *string `json:"nodeName,omitempty"`
|
||||
// ValidationError is set when the pool's data could not be fully
|
||||
// validated (e.g., incomplete slice publication). When set, device
|
||||
// count fields and ResourceSliceCount may be unset.
|
||||
ValidationError *string `json:"validationError,omitempty"`
|
||||
}
|
||||
|
||||
// PoolStatusApplyConfiguration constructs a declarative configuration of the PoolStatus type for use with
|
||||
// apply.
|
||||
func PoolStatus() *PoolStatusApplyConfiguration {
|
||||
return &PoolStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithDriver(value string) *PoolStatusApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPoolName sets the PoolName 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 PoolName field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithPoolName(value string) *PoolStatusApplyConfiguration {
|
||||
b.PoolName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithGeneration(value int64) *PoolStatusApplyConfiguration {
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceSliceCount sets the ResourceSliceCount 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 ResourceSliceCount field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithResourceSliceCount(value int32) *PoolStatusApplyConfiguration {
|
||||
b.ResourceSliceCount = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithTotalDevices sets the TotalDevices 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 TotalDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithTotalDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.TotalDevices = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllocatedDevices sets the AllocatedDevices 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 AllocatedDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithAllocatedDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.AllocatedDevices = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAvailableDevices sets the AvailableDevices 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 AvailableDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithAvailableDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.AvailableDevices = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUnavailableDevices sets the UnavailableDevices 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 UnavailableDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithUnavailableDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.UnavailableDevices = &value
|
||||
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 *PoolStatusApplyConfiguration) WithNodeName(value string) *PoolStatusApplyConfiguration {
|
||||
b.NodeName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithValidationError sets the ValidationError 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 ValidationError field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithValidationError(value string) *PoolStatusApplyConfiguration {
|
||||
b.ValidationError = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
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 (
|
||||
resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ResourcePoolStatusRequestApplyConfiguration represents a declarative configuration of the ResourcePoolStatusRequest type for use
|
||||
// with apply.
|
||||
//
|
||||
// ResourcePoolStatusRequest triggers a one-time calculation of resource pool status
|
||||
// based on the provided filters. Once status is set, the request is considered complete and will not be reprocessed.
|
||||
// Users should delete and recreate requests to get updated information.
|
||||
type ResourcePoolStatusRequestApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// Standard object metadata
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
// Spec defines the filters for which pools to include in the status.
|
||||
// The spec is immutable once created.
|
||||
Spec *ResourcePoolStatusRequestSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
// Status is populated by the controller with the calculated pool status.
|
||||
// When status is non-nil, the request is considered complete and the
|
||||
// entire object becomes immutable.
|
||||
Status *ResourcePoolStatusRequestStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequest constructs a declarative configuration of the ResourcePoolStatusRequest type for use with
|
||||
// apply.
|
||||
func ResourcePoolStatusRequest(name string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b := &ResourcePoolStatusRequestApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("ResourcePoolStatusRequest")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha3")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourcePoolStatusRequestFrom extracts the applied configuration owned by fieldManager from
|
||||
// resourcePoolStatusRequest for the specified subresource. Pass an empty string for subresource to extract
|
||||
// the main resource. Common subresources include "status", "scale", etc.
|
||||
// resourcePoolStatusRequest must be a unmodified ResourcePoolStatusRequest API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourcePoolStatusRequestFrom provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractResourcePoolStatusRequestFrom(resourcePoolStatusRequest *resourcev1alpha3.ResourcePoolStatusRequest, fieldManager string, subresource string) (*ResourcePoolStatusRequestApplyConfiguration, error) {
|
||||
b := &ResourcePoolStatusRequestApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourcePoolStatusRequest, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequest"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourcePoolStatusRequest.Name)
|
||||
|
||||
b.WithKind("ResourcePoolStatusRequest")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha3")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractResourcePoolStatusRequest extracts the applied configuration owned by fieldManager from
|
||||
// resourcePoolStatusRequest. If no managedFields are found in resourcePoolStatusRequest for fieldManager, a
|
||||
// ResourcePoolStatusRequestApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// resourcePoolStatusRequest must be a unmodified ResourcePoolStatusRequest API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourcePoolStatusRequest provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractResourcePoolStatusRequest(resourcePoolStatusRequest *resourcev1alpha3.ResourcePoolStatusRequest, fieldManager string) (*ResourcePoolStatusRequestApplyConfiguration, error) {
|
||||
return ExtractResourcePoolStatusRequestFrom(resourcePoolStatusRequest, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourcePoolStatusRequestStatus extracts the applied configuration owned by fieldManager from
|
||||
// resourcePoolStatusRequest for the status subresource.
|
||||
func ExtractResourcePoolStatusRequestStatus(resourcePoolStatusRequest *resourcev1alpha3.ResourcePoolStatusRequest, fieldManager string) (*ResourcePoolStatusRequestApplyConfiguration, error) {
|
||||
return ExtractResourcePoolStatusRequestFrom(resourcePoolStatusRequest, fieldManager, "status")
|
||||
}
|
||||
|
||||
func (b ResourcePoolStatusRequestApplyConfiguration) IsApplyConfiguration() {}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithKind(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithAPIVersion(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// 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 *ResourcePoolStatusRequestApplyConfiguration) WithName(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithGenerateName(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithNamespace(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithUID(value types.UID) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithResourceVersion(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithGeneration(value int64) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLabels puts the entries into the Labels 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 Labels field,
|
||||
// overwriting an existing map entries in Labels field with the same key.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithLabels(entries map[string]string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.ObjectMetaApplyConfiguration.Labels[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAnnotations puts the entries into the Annotations 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 Annotations field,
|
||||
// overwriting an existing map entries in Annotations field with the same key.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithAnnotations(entries map[string]string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.ObjectMetaApplyConfiguration.Annotations[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithFinalizers(values ...string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithSpec(value *ResourcePoolStatusRequestSpecApplyConfiguration) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status 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 Status field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) WithStatus(value *ResourcePoolStatusRequestStatusApplyConfiguration) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetKind retrieves the value of the Kind field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// ResourcePoolStatusRequestSpecApplyConfiguration represents a declarative configuration of the ResourcePoolStatusRequestSpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// ResourcePoolStatusRequestSpec defines the filters for the pool status request.
|
||||
type ResourcePoolStatusRequestSpecApplyConfiguration struct {
|
||||
// Driver specifies the DRA driver name to filter pools.
|
||||
// Only pools from ResourceSlices with this driver will be included.
|
||||
// Must be a DNS subdomain (e.g., "gpu.example.com").
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
// PoolName optionally filters to a specific pool name.
|
||||
// If not specified, all pools from the specified driver are included.
|
||||
// When specified, must be a non-empty valid resource pool name
|
||||
// (DNS subdomains separated by "/").
|
||||
PoolName *string `json:"poolName,omitempty"`
|
||||
// Limit optionally specifies the maximum number of pools to return in the status.
|
||||
// If more pools match the filter criteria, the response will be truncated
|
||||
// (i.e., len(status.pools) < status.poolCount).
|
||||
//
|
||||
// Default: 100
|
||||
// Minimum: 1
|
||||
// Maximum: 1000
|
||||
Limit *int32 `json:"limit,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequestSpecApplyConfiguration constructs a declarative configuration of the ResourcePoolStatusRequestSpec type for use with
|
||||
// apply.
|
||||
func ResourcePoolStatusRequestSpec() *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
return &ResourcePoolStatusRequestSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithDriver(value string) *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPoolName sets the PoolName 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 PoolName field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithPoolName(value string) *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
b.PoolName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLimit sets the Limit 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 Limit field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithLimit(value int32) *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
b.Limit = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
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 (
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ResourcePoolStatusRequestStatusApplyConfiguration represents a declarative configuration of the ResourcePoolStatusRequestStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// ResourcePoolStatusRequestStatus contains the calculated pool status information.
|
||||
type ResourcePoolStatusRequestStatusApplyConfiguration struct {
|
||||
// PoolCount is the total number of pools that matched the filter criteria,
|
||||
// regardless of truncation. This helps users understand how many pools exist
|
||||
// even when the response is truncated. A value of 0 means no pools matched
|
||||
// the filter criteria.
|
||||
PoolCount *int32 `json:"poolCount,omitempty"`
|
||||
// Pools contains the first `spec.limit` matching pools, sorted by driver
|
||||
// then pool name. If `len(pools) < poolCount`, the list was truncated.
|
||||
// When omitted, no pools matched the request filters.
|
||||
Pools []PoolStatusApplyConfiguration `json:"pools,omitempty"`
|
||||
// Conditions provide information about the state of the request.
|
||||
// A condition with type=Complete or type=Failed will always be set
|
||||
// when the status is populated.
|
||||
//
|
||||
// Known condition types:
|
||||
// - "Complete": True when the request has been processed successfully
|
||||
// - "Failed": True when the request could not be processed
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequestStatusApplyConfiguration constructs a declarative configuration of the ResourcePoolStatusRequestStatus type for use with
|
||||
// apply.
|
||||
func ResourcePoolStatusRequestStatus() *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
return &ResourcePoolStatusRequestStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPoolCount sets the PoolCount 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 PoolCount field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestStatusApplyConfiguration) WithPoolCount(value int32) *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
b.PoolCount = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPools adds the given value to the Pools 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 Pools field.
|
||||
func (b *ResourcePoolStatusRequestStatusApplyConfiguration) WithPools(values ...*PoolStatusApplyConfiguration) *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithPools")
|
||||
}
|
||||
b.Pools = append(b.Pools, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *ResourcePoolStatusRequestStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -36,7 +36,7 @@ type AllocationResultApplyConfiguration struct {
|
||||
// AllocationTimestamp stores the time when the resources were allocated.
|
||||
// This field is not guaranteed to be set, in which case that time is unknown.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gate.
|
||||
AllocationTimestamp *metav1.Time `json:"allocationTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
v1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
@@ -70,7 +71,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
// any device in a ResourceSlice, then the maximum number of
|
||||
// allowed devices per ResourceSlice is 64 instead of 128.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -78,7 +79,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
|
||||
// to match the node where the allocation was made.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindsToNode *bool `json:"bindsToNode,omitempty"`
|
||||
// BindingConditions defines the conditions for proceeding with binding.
|
||||
@@ -90,7 +91,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -101,7 +102,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -109,6 +110,18 @@ type BasicDeviceApplyConfiguration struct {
|
||||
// If AllowMultipleAllocations is set to true, the device can be allocated more than once,
|
||||
// and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.
|
||||
AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty"`
|
||||
// NodeAllocatableResourceMappings defines the mapping of node resources
|
||||
// that are managed by the DRA driver exposing this device. This includes resources currently
|
||||
// reported in v1.Node `status.allocatable` that are not extended resources
|
||||
// (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources).
|
||||
// Examples include "cpu", "memory", "ephemeral-storage", and hugepages.
|
||||
// In addition to standard requests made through the Pod `spec`, these resources
|
||||
// can also be requested through claims and allocated by the DRA driver.
|
||||
// For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory
|
||||
// dependencies of an accelerator device.
|
||||
// The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory").
|
||||
// Extended resource names are not permitted as keys.
|
||||
NodeAllocatableResourceMappings map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"`
|
||||
}
|
||||
|
||||
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
|
||||
@@ -230,3 +243,17 @@ func (b *BasicDeviceApplyConfiguration) WithAllowMultipleAllocations(value bool)
|
||||
b.AllowMultipleAllocations = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings 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 NodeAllocatableResourceMappings field,
|
||||
// overwriting an existing map entries in NodeAllocatableResourceMappings field with the same key.
|
||||
func (b *BasicDeviceApplyConfiguration) WithNodeAllocatableResourceMappings(entries map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration) *BasicDeviceApplyConfiguration {
|
||||
if b.NodeAllocatableResourceMappings == nil && len(entries) > 0 {
|
||||
b.NodeAllocatableResourceMappings = make(map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.NodeAllocatableResourceMappings[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ type CELDeviceSelectorApplyConfiguration struct {
|
||||
//
|
||||
// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled,
|
||||
// the includes() helper is available and it can work for both scalar
|
||||
// and list-type attributes. It was introduced to support smooth migration
|
||||
// from scalar attributes to list-type attributes while keeping
|
||||
// CEL expressions simple. For example:
|
||||
//
|
||||
// device.attributes["dra.example.com"].models.includes("some-model")
|
||||
//
|
||||
// The length of the expression must be smaller or equal to 10 Ki. The
|
||||
// cost of evaluating it is also limited based on the estimated number
|
||||
// of logical steps.
|
||||
|
||||
@@ -32,6 +32,22 @@ type DeviceAttributeApplyConfiguration struct {
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
IntValues []int64 `json:"ints,omitempty"`
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
BoolValues []bool `json:"bools,omitempty"`
|
||||
// StringValues is a non-empty list of strings.
|
||||
// Each string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
StringValues []string `json:"strings,omitempty"`
|
||||
// VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0.
|
||||
// Each version string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
VersionValues []string `json:"versions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
@@ -71,3 +87,43 @@ func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *Devi
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValues adds the given value to the IntValues 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 IntValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValues(values ...int64) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IntValues = append(b.IntValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValues adds the given value to the BoolValues 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 BoolValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValues(values ...bool) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.BoolValues = append(b.BoolValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValues adds the given value to the StringValues 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 StringValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.StringValues = append(b.StringValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValues adds the given value to the VersionValues 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 VersionValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.VersionValues = append(b.VersionValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type DeviceClassSpecApplyConfiguration struct {
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is an alpha field.
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,21 @@ type DeviceConstraintApplyConfiguration struct {
|
||||
// its specification, but if one device doesn't, then it also will not be
|
||||
// chosen.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics(i.e., element order and duplicates are ignored): list-valued attributes
|
||||
// match when the intersection across all devices is non-empty.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// Must include the domain qualifier.
|
||||
MatchAttribute *resourcev1beta1.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
// DistinctAttribute requires that all devices in question have this
|
||||
// attribute and that its type and value are unique across those devices.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics (i.e., element order and duplicates are ignored):
|
||||
// list-valued attributes must be pairwise disjoint across devices.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// This acts as the inverse of MatchAttribute.
|
||||
//
|
||||
// This constraint is used to avoid allocating multiple requests to the same device
|
||||
|
||||
@@ -133,7 +133,7 @@ type DeviceRequestApplyConfiguration struct {
|
||||
// This field can only be set when deviceClassName is set and no subrequests
|
||||
// are specified in the firstAvailable list.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -66,19 +66,19 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions contains a copy of the BindingFailureConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
|
||||
@@ -94,7 +94,7 @@ type DeviceSubRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1beta1.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
// the allocated device. This might be the name of a physical or virtual
|
||||
// network interface being configured in the pod.
|
||||
//
|
||||
// Must not be longer than 256 characters.
|
||||
// Must not be longer than 256 bytes.
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
// This can include both IPv4 and IPv6 addresses.
|
||||
@@ -41,7 +41,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
|
||||
//
|
||||
// Must not be longer than 128 characters.
|
||||
// Must not be longer than 128 bytes.
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
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 (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// NodeAllocatableResourceMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceMapping type for use
|
||||
// with apply.
|
||||
//
|
||||
// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity
|
||||
// units requested to the corresponding quantity of the node allocatable resource.
|
||||
type NodeAllocatableResourceMappingApplyConfiguration struct {
|
||||
// CapacityKey references a capacity name defined as a key in the
|
||||
// `spec.devices[*].capacity` map. When this field is set, the value associated with
|
||||
// this key in the `status.allocation.devices.results[*].consumedCapacity` map
|
||||
// (for a specific claim allocation) determines the base quantity for
|
||||
// the node allocatable resource. If `allocationMultiplier` is also set, it is
|
||||
// multiplied with the base quantity.
|
||||
// For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi",
|
||||
// and this field is set to "dra.example.com/memory", then for a claim allocation
|
||||
// that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the
|
||||
// node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should
|
||||
// be omitted or set to "1".
|
||||
CapacityKey *resourcev1beta1.QualifiedName `json:"capacityKey,omitempty"`
|
||||
// AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim.
|
||||
// It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set.
|
||||
// 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim.
|
||||
// a. A DRA driver representing each CPU core as a device would have
|
||||
// {ResourceName: "cpu", allocationMultiplier: "2"} in its
|
||||
// `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,
|
||||
// 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.
|
||||
// b. A GPU device that needs additional node memory per GPU allocation would
|
||||
// have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated
|
||||
// GPU device instance of this type will account for 2Gi of memory.
|
||||
//
|
||||
// 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.
|
||||
// The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.
|
||||
// For example, if a Device's capacity "dra.example.com/cores" is consumed,
|
||||
// and each "core" provides 2 "cpu"s, the mapping would be:
|
||||
// {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}.
|
||||
// If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16.
|
||||
AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty"`
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceMapping type for use with
|
||||
// apply.
|
||||
func NodeAllocatableResourceMapping() *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
return &NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithCapacityKey sets the CapacityKey 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 CapacityKey field is set to the value of the last call.
|
||||
func (b *NodeAllocatableResourceMappingApplyConfiguration) WithCapacityKey(value resourcev1beta1.QualifiedName) *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
b.CapacityKey = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllocationMultiplier sets the AllocationMultiplier 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 AllocationMultiplier field is set to the value of the last call.
|
||||
func (b *NodeAllocatableResourceMappingApplyConfiguration) WithAllocationMultiplier(value resource.Quantity) *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
b.AllocationMultiplier = &value
|
||||
return b
|
||||
}
|
||||
@@ -36,7 +36,7 @@ type AllocationResultApplyConfiguration struct {
|
||||
// AllocationTimestamp stores the time when the resources were allocated.
|
||||
// This field is not guaranteed to be set, in which case that time is unknown.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gate.
|
||||
AllocationTimestamp *metav1.Time `json:"allocationTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ type CELDeviceSelectorApplyConfiguration struct {
|
||||
//
|
||||
// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled,
|
||||
// the includes() helper is available and it can work for both scalar
|
||||
// and list-type attributes. It was introduced to support smooth migration
|
||||
// from scalar attributes to list-type attributes while keeping
|
||||
// CEL expressions simple. For example:
|
||||
//
|
||||
// device.attributes["dra.example.com"].models.includes("some-model")
|
||||
//
|
||||
// The length of the expression must be smaller or equal to 10 Ki. The
|
||||
// cost of evaluating it is also limited based on the estimated number
|
||||
// of logical steps.
|
||||
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
v1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
@@ -74,7 +75,7 @@ type DeviceApplyConfiguration struct {
|
||||
// any device in a ResourceSlice, then the maximum number of
|
||||
// allowed devices per ResourceSlice is 64 instead of 128.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -82,7 +83,7 @@ type DeviceApplyConfiguration struct {
|
||||
// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
|
||||
// to match the node where the allocation was made.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindsToNode *bool `json:"bindsToNode,omitempty"`
|
||||
// BindingConditions defines the conditions for proceeding with binding.
|
||||
@@ -94,7 +95,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -105,7 +106,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -113,6 +114,18 @@ type DeviceApplyConfiguration struct {
|
||||
// If AllowMultipleAllocations is set to true, the device can be allocated more than once,
|
||||
// and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.
|
||||
AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty"`
|
||||
// NodeAllocatableResourceMappings defines the mapping of node resources
|
||||
// that are managed by the DRA driver exposing this device. This includes resources currently
|
||||
// reported in v1.Node `status.allocatable` that are not extended resources
|
||||
// (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources).
|
||||
// Examples include "cpu", "memory", "ephemeral-storage", and hugepages.
|
||||
// In addition to standard requests made through the Pod `spec`, these resources
|
||||
// can also be requested through claims and allocated by the DRA driver.
|
||||
// For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory
|
||||
// dependencies of an accelerator device.
|
||||
// The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory").
|
||||
// Extended resource names are not permitted as keys.
|
||||
NodeAllocatableResourceMappings map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with
|
||||
@@ -242,3 +255,17 @@ func (b *DeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) *Dev
|
||||
b.AllowMultipleAllocations = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings 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 NodeAllocatableResourceMappings field,
|
||||
// overwriting an existing map entries in NodeAllocatableResourceMappings field with the same key.
|
||||
func (b *DeviceApplyConfiguration) WithNodeAllocatableResourceMappings(entries map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration) *DeviceApplyConfiguration {
|
||||
if b.NodeAllocatableResourceMappings == nil && len(entries) > 0 {
|
||||
b.NodeAllocatableResourceMappings = make(map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.NodeAllocatableResourceMappings[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -32,6 +32,22 @@ type DeviceAttributeApplyConfiguration struct {
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
IntValues []int64 `json:"ints,omitempty"`
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
BoolValues []bool `json:"bools,omitempty"`
|
||||
// StringValues is a non-empty list of strings.
|
||||
// Each string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
StringValues []string `json:"strings,omitempty"`
|
||||
// VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0.
|
||||
// Each version string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
VersionValues []string `json:"versions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
@@ -71,3 +87,43 @@ func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *Devi
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValues adds the given value to the IntValues 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 IntValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValues(values ...int64) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IntValues = append(b.IntValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValues adds the given value to the BoolValues 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 BoolValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValues(values ...bool) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.BoolValues = append(b.BoolValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValues adds the given value to the StringValues 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 StringValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.StringValues = append(b.StringValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValues adds the given value to the VersionValues 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 VersionValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.VersionValues = append(b.VersionValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type DeviceClassSpecApplyConfiguration struct {
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is an alpha field.
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,21 @@ type DeviceConstraintApplyConfiguration struct {
|
||||
// its specification, but if one device doesn't, then it also will not be
|
||||
// chosen.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics(i.e., element order and duplicates are ignored): list-valued attributes
|
||||
// match when the intersection across all devices is non-empty.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// Must include the domain qualifier.
|
||||
MatchAttribute *resourcev1beta2.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
// DistinctAttribute requires that all devices in question have this
|
||||
// attribute and that its type and value are unique across those devices.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics (i.e., element order and duplicates are ignored):
|
||||
// list-valued attributes must be pairwise disjoint across devices.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// This acts as the inverse of MatchAttribute.
|
||||
//
|
||||
// This constraint is used to avoid allocating multiple requests to the same device
|
||||
|
||||
@@ -66,19 +66,19 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions contains a copy of the BindingFailureConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
|
||||
@@ -93,7 +93,7 @@ type DeviceSubRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1beta2.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
294
applyconfigurations/resource/v1beta2/devicetaintrule.go
Normal file
294
applyconfigurations/resource/v1beta2/devicetaintrule.go
Normal file
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
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 v1beta2
|
||||
|
||||
import (
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// DeviceTaintRuleApplyConfiguration represents a declarative configuration of the DeviceTaintRule type for use
|
||||
// with apply.
|
||||
//
|
||||
// DeviceTaintRule adds one taint to all devices which match the selector.
|
||||
// This has the same effect as if the taint was specified directly
|
||||
// in the ResourceSlice by the DRA driver.
|
||||
type DeviceTaintRuleApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// Standard object metadata
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
// Spec specifies the selector and one taint.
|
||||
//
|
||||
// Changing the spec automatically increments the metadata.generation number.
|
||||
Spec *DeviceTaintRuleSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
// Status provides information about what was requested in the spec.
|
||||
Status *DeviceTaintRuleStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceTaintRule constructs a declarative configuration of the DeviceTaintRule type for use with
|
||||
// apply.
|
||||
func DeviceTaintRule(name string) *DeviceTaintRuleApplyConfiguration {
|
||||
b := &DeviceTaintRuleApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("DeviceTaintRule")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractDeviceTaintRuleFrom extracts the applied configuration owned by fieldManager from
|
||||
// deviceTaintRule for the specified subresource. Pass an empty string for subresource to extract
|
||||
// the main resource. Common subresources include "status", "scale", etc.
|
||||
// deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API.
|
||||
// ExtractDeviceTaintRuleFrom provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractDeviceTaintRuleFrom(deviceTaintRule *resourcev1beta2.DeviceTaintRule, fieldManager string, subresource string) (*DeviceTaintRuleApplyConfiguration, error) {
|
||||
b := &DeviceTaintRuleApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(deviceTaintRule, internal.Parser().Type("io.k8s.api.resource.v1beta2.DeviceTaintRule"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(deviceTaintRule.Name)
|
||||
|
||||
b.WithKind("DeviceTaintRule")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractDeviceTaintRule extracts the applied configuration owned by fieldManager from
|
||||
// deviceTaintRule. If no managedFields are found in deviceTaintRule for fieldManager, a
|
||||
// DeviceTaintRuleApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API.
|
||||
// ExtractDeviceTaintRule provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractDeviceTaintRule(deviceTaintRule *resourcev1beta2.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error) {
|
||||
return ExtractDeviceTaintRuleFrom(deviceTaintRule, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractDeviceTaintRuleStatus extracts the applied configuration owned by fieldManager from
|
||||
// deviceTaintRule for the status subresource.
|
||||
func ExtractDeviceTaintRuleStatus(deviceTaintRule *resourcev1beta2.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error) {
|
||||
return ExtractDeviceTaintRuleFrom(deviceTaintRule, fieldManager, "status")
|
||||
}
|
||||
|
||||
func (b DeviceTaintRuleApplyConfiguration) IsApplyConfiguration() {}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithKind(value string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithAPIVersion(value string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// 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 *DeviceTaintRuleApplyConfiguration) WithName(value string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithGenerateName(value string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithNamespace(value string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithUID(value types.UID) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithResourceVersion(value string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithGeneration(value int64) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLabels puts the entries into the Labels 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 Labels field,
|
||||
// overwriting an existing map entries in Labels field with the same key.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithLabels(entries map[string]string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.ObjectMetaApplyConfiguration.Labels[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAnnotations puts the entries into the Annotations 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 Annotations field,
|
||||
// overwriting an existing map entries in Annotations field with the same key.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.ObjectMetaApplyConfiguration.Annotations[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithFinalizers(values ...string) *DeviceTaintRuleApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *DeviceTaintRuleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithSpec(value *DeviceTaintRuleSpecApplyConfiguration) *DeviceTaintRuleApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status 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 Status field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) WithStatus(value *DeviceTaintRuleStatusApplyConfiguration) *DeviceTaintRuleApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetKind retrieves the value of the Kind field in the declarative configuration.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
|
||||
func (b *DeviceTaintRuleApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
55
applyconfigurations/resource/v1beta2/devicetaintrulespec.go
Normal file
55
applyconfigurations/resource/v1beta2/devicetaintrulespec.go
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
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 v1beta2
|
||||
|
||||
// DeviceTaintRuleSpecApplyConfiguration represents a declarative configuration of the DeviceTaintRuleSpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// DeviceTaintRuleSpec specifies the selector and one taint.
|
||||
type DeviceTaintRuleSpecApplyConfiguration struct {
|
||||
// DeviceSelector defines which device(s) the taint is applied to.
|
||||
// All selector criteria must be satisfied for a device to
|
||||
// match. The empty selector matches all devices. Without
|
||||
// a selector, no devices are matches.
|
||||
DeviceSelector *DeviceTaintSelectorApplyConfiguration `json:"deviceSelector,omitempty"`
|
||||
// The taint that gets applied to matching devices.
|
||||
Taint *DeviceTaintApplyConfiguration `json:"taint,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceTaintRuleSpecApplyConfiguration constructs a declarative configuration of the DeviceTaintRuleSpec type for use with
|
||||
// apply.
|
||||
func DeviceTaintRuleSpec() *DeviceTaintRuleSpecApplyConfiguration {
|
||||
return &DeviceTaintRuleSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDeviceSelector sets the DeviceSelector 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 DeviceSelector field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleSpecApplyConfiguration) WithDeviceSelector(value *DeviceTaintSelectorApplyConfiguration) *DeviceTaintRuleSpecApplyConfiguration {
|
||||
b.DeviceSelector = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithTaint sets the Taint 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 Taint field is set to the value of the last call.
|
||||
func (b *DeviceTaintRuleSpecApplyConfiguration) WithTaint(value *DeviceTaintApplyConfiguration) *DeviceTaintRuleSpecApplyConfiguration {
|
||||
b.Taint = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
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 v1beta2
|
||||
|
||||
import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// DeviceTaintRuleStatusApplyConfiguration represents a declarative configuration of the DeviceTaintRuleStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// DeviceTaintRuleStatus provides information about an on-going pod eviction.
|
||||
type DeviceTaintRuleStatusApplyConfiguration struct {
|
||||
// Conditions provide information about the state of the DeviceTaintRule
|
||||
// and the cluster at some point in time,
|
||||
// in a machine-readable and human-readable format.
|
||||
//
|
||||
// The following condition is currently defined as part of this API, more may
|
||||
// get added:
|
||||
// - Type: EvictionInProgress
|
||||
// - Status: True if there are currently pods which need to be evicted, False otherwise
|
||||
// (includes the effects which don't cause eviction).
|
||||
// - Reason: not specified, may change
|
||||
// - Message: includes information about number of pending pods and already evicted pods
|
||||
// in a human-readable format, updated periodically, may change
|
||||
//
|
||||
// For `effect: None`, the condition above gets set once for each change to
|
||||
// the spec, with the message containing information about what would happen
|
||||
// if the effect was `NoExecute`. This feedback can be used to decide whether
|
||||
// changing the effect to `NoExecute` will work as intended. It only gets
|
||||
// set once to avoid having to constantly update the status.
|
||||
//
|
||||
// Must have 8 or fewer entries.
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceTaintRuleStatusApplyConfiguration constructs a declarative configuration of the DeviceTaintRuleStatus type for use with
|
||||
// apply.
|
||||
func DeviceTaintRuleStatus() *DeviceTaintRuleStatusApplyConfiguration {
|
||||
return &DeviceTaintRuleStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *DeviceTaintRuleStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *DeviceTaintRuleStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
76
applyconfigurations/resource/v1beta2/devicetaintselector.go
Normal file
76
applyconfigurations/resource/v1beta2/devicetaintselector.go
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
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 v1beta2
|
||||
|
||||
// DeviceTaintSelectorApplyConfiguration represents a declarative configuration of the DeviceTaintSelector type for use
|
||||
// with apply.
|
||||
//
|
||||
// DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to.
|
||||
// The empty selector matches all devices. Without a selector, no devices
|
||||
// are matched.
|
||||
type DeviceTaintSelectorApplyConfiguration struct {
|
||||
// If driver is set, only devices from that driver are selected.
|
||||
// This fields corresponds to slice.spec.driver.
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
// If pool is set, only devices in that pool are selected.
|
||||
//
|
||||
// Also setting the driver name may be useful to avoid
|
||||
// ambiguity when different drivers use the same pool name,
|
||||
// but this is not required because selecting pools from
|
||||
// different drivers may also be useful, for example when
|
||||
// drivers with node-local devices use the node name as
|
||||
// their pool name.
|
||||
Pool *string `json:"pool,omitempty"`
|
||||
// If device is set, only devices with that name are selected.
|
||||
// This field corresponds to slice.spec.devices[].name.
|
||||
//
|
||||
// Setting also driver and pool may be required to avoid ambiguity,
|
||||
// but is not required.
|
||||
Device *string `json:"device,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceTaintSelectorApplyConfiguration constructs a declarative configuration of the DeviceTaintSelector type for use with
|
||||
// apply.
|
||||
func DeviceTaintSelector() *DeviceTaintSelectorApplyConfiguration {
|
||||
return &DeviceTaintSelectorApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *DeviceTaintSelectorApplyConfiguration) WithDriver(value string) *DeviceTaintSelectorApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPool sets the Pool 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 Pool field is set to the value of the last call.
|
||||
func (b *DeviceTaintSelectorApplyConfiguration) WithPool(value string) *DeviceTaintSelectorApplyConfiguration {
|
||||
b.Pool = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevice sets the Device 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 Device field is set to the value of the last call.
|
||||
func (b *DeviceTaintSelectorApplyConfiguration) WithDevice(value string) *DeviceTaintSelectorApplyConfiguration {
|
||||
b.Device = &value
|
||||
return b
|
||||
}
|
||||
@@ -91,7 +91,7 @@ type ExactDeviceRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -29,7 +29,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
// the allocated device. This might be the name of a physical or virtual
|
||||
// network interface being configured in the pod.
|
||||
//
|
||||
// Must not be longer than 256 characters.
|
||||
// Must not be longer than 256 bytes.
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
// This can include both IPv4 and IPv6 addresses.
|
||||
@@ -39,7 +39,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
|
||||
//
|
||||
// Must not be longer than 128 characters.
|
||||
// Must not be longer than 128 bytes.
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
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 v1beta2
|
||||
|
||||
import (
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// NodeAllocatableResourceMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceMapping type for use
|
||||
// with apply.
|
||||
//
|
||||
// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity
|
||||
// units requested to the corresponding quantity of the node allocatable resource.
|
||||
type NodeAllocatableResourceMappingApplyConfiguration struct {
|
||||
// CapacityKey references a capacity name defined as a key in the
|
||||
// `spec.devices[*].capacity` map. When this field is set, the value associated with
|
||||
// this key in the `status.allocation.devices.results[*].consumedCapacity` map
|
||||
// (for a specific claim allocation) determines the base quantity for
|
||||
// the node allocatable resource. If `allocationMultiplier` is also set, it is
|
||||
// multiplied with the base quantity.
|
||||
// For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi",
|
||||
// and this field is set to "dra.example.com/memory", then for a claim allocation
|
||||
// that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the
|
||||
// node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should
|
||||
// be omitted or set to "1".
|
||||
CapacityKey *resourcev1beta2.QualifiedName `json:"capacityKey,omitempty"`
|
||||
// AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim.
|
||||
// It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set.
|
||||
// 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim.
|
||||
// a. A DRA driver representing each CPU core as a device would have
|
||||
// {ResourceName: "cpu", allocationMultiplier: "2"} in its
|
||||
// `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,
|
||||
// 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.
|
||||
// b. A GPU device that needs additional node memory per GPU allocation would
|
||||
// have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated
|
||||
// GPU device instance of this type will account for 2Gi of memory.
|
||||
//
|
||||
// 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.
|
||||
// The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.
|
||||
// For example, if a Device's capacity "dra.example.com/cores" is consumed,
|
||||
// and each "core" provides 2 "cpu"s, the mapping would be:
|
||||
// {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}.
|
||||
// If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16.
|
||||
AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty"`
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceMapping type for use with
|
||||
// apply.
|
||||
func NodeAllocatableResourceMapping() *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
return &NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithCapacityKey sets the CapacityKey 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 CapacityKey field is set to the value of the last call.
|
||||
func (b *NodeAllocatableResourceMappingApplyConfiguration) WithCapacityKey(value resourcev1beta2.QualifiedName) *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
b.CapacityKey = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllocationMultiplier sets the AllocationMultiplier 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 AllocationMultiplier field is set to the value of the last call.
|
||||
func (b *NodeAllocatableResourceMappingApplyConfiguration) WithAllocationMultiplier(value resource.Quantity) *NodeAllocatableResourceMappingApplyConfiguration {
|
||||
b.AllocationMultiplier = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
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 v1alpha1
|
||||
|
||||
// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroup represents a set of pods with a common scheduling policy.
|
||||
type PodGroupApplyConfiguration struct {
|
||||
// Name is a unique identifier for the PodGroup within the Workload.
|
||||
// It must be a DNS label. This field is immutable.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Policy defines the scheduling policy for this PodGroup.
|
||||
Policy *PodGroupPolicyApplyConfiguration `json:"policy,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupApplyConfiguration constructs a declarative configuration of the PodGroup type for use with
|
||||
// apply.
|
||||
func PodGroup() *PodGroupApplyConfiguration {
|
||||
return &PodGroupApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *PodGroupApplyConfiguration) WithName(value string) *PodGroupApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPolicy sets the Policy 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 Policy field is set to the value of the last call.
|
||||
func (b *PodGroupApplyConfiguration) WithPolicy(value *PodGroupPolicyApplyConfiguration) *PodGroupApplyConfiguration {
|
||||
b.Policy = value
|
||||
return b
|
||||
}
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
// GangSchedulingPolicyApplyConfiguration represents a declarative configuration of the GangSchedulingPolicy type for use
|
||||
// with apply.
|
||||
@@ -16,11 +16,10 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
@@ -28,85 +27,82 @@ import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use
|
||||
// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use
|
||||
// with apply.
|
||||
//
|
||||
// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass.
|
||||
// PriorityClass defines mapping from a priority class name to the priority
|
||||
// integer value. The value can be any valid integer.
|
||||
type PriorityClassApplyConfiguration struct {
|
||||
// PodGroup represents a runtime instance of pods grouped together.
|
||||
// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from
|
||||
// Workload.podGroupTemplates.
|
||||
// PodGroup API enablement is toggled by the GenericWorkload feature gate.
|
||||
type PodGroupApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
Value *int32 `json:"value,omitempty"`
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
// the default priority for pods that do not have any priority class.
|
||||
// Only one PriorityClass can be marked as `globalDefault`. However, if more than
|
||||
// one PriorityClasses exists with their `globalDefault` field set to true,
|
||||
// the smallest value of such global default PriorityClasses will be used as the default priority.
|
||||
GlobalDefault *bool `json:"globalDefault,omitempty"`
|
||||
// description is an arbitrary string that usually provides guidelines on
|
||||
// when this priority class should be used.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// preemptionPolicy is the Policy for preempting pods with lower priority.
|
||||
// One of Never, PreemptLowerPriority.
|
||||
// Defaults to PreemptLowerPriority if unset.
|
||||
PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"`
|
||||
// Spec defines the desired state of the PodGroup.
|
||||
Spec *PodGroupSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
// Status represents the current observed state of the PodGroup.
|
||||
Status *PodGroupStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// PriorityClass constructs a declarative configuration of the PriorityClass type for use with
|
||||
// PodGroup constructs a declarative configuration of the PodGroup type for use with
|
||||
// apply.
|
||||
func PriorityClass(name string) *PriorityClassApplyConfiguration {
|
||||
b := &PriorityClassApplyConfiguration{}
|
||||
func PodGroup(name, namespace string) *PodGroupApplyConfiguration {
|
||||
b := &PodGroupApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("PriorityClass")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("PodGroup")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractPriorityClassFrom extracts the applied configuration owned by fieldManager from
|
||||
// priorityClass for the specified subresource. Pass an empty string for subresource to extract
|
||||
// ExtractPodGroupFrom extracts the applied configuration owned by fieldManager from
|
||||
// podGroup for the specified subresource. Pass an empty string for subresource to extract
|
||||
// the main resource. Common subresources include "status", "scale", etc.
|
||||
// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPriorityClassFrom provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// podGroup must be a unmodified PodGroup API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPodGroupFrom provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractPriorityClassFrom(priorityClass *schedulingv1alpha1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) {
|
||||
b := &PriorityClassApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1alpha1.PriorityClass"), fieldManager, b, subresource)
|
||||
func ExtractPodGroupFrom(podGroup *schedulingv1alpha2.PodGroup, fieldManager string, subresource string) (*PodGroupApplyConfiguration, error) {
|
||||
b := &PodGroupApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(podGroup, internal.Parser().Type("io.k8s.api.scheduling.v1alpha2.PodGroup"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(priorityClass.Name)
|
||||
b.WithName(podGroup.Name)
|
||||
b.WithNamespace(podGroup.Namespace)
|
||||
|
||||
b.WithKind("PriorityClass")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithKind("PodGroup")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractPriorityClass extracts the applied configuration owned by fieldManager from
|
||||
// priorityClass. If no managedFields are found in priorityClass for fieldManager, a
|
||||
// PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// ExtractPodGroup extracts the applied configuration owned by fieldManager from
|
||||
// podGroup. If no managedFields are found in podGroup for fieldManager, a
|
||||
// PodGroupApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// podGroup must be a unmodified PodGroup API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPodGroup provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractPriorityClass(priorityClass *schedulingv1alpha1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) {
|
||||
return ExtractPriorityClassFrom(priorityClass, fieldManager, "")
|
||||
func ExtractPodGroup(podGroup *schedulingv1alpha2.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) {
|
||||
return ExtractPodGroupFrom(podGroup, fieldManager, "")
|
||||
}
|
||||
|
||||
func (b PriorityClassApplyConfiguration) IsApplyConfiguration() {}
|
||||
// ExtractPodGroupStatus extracts the applied configuration owned by fieldManager from
|
||||
// podGroup for the status subresource.
|
||||
func ExtractPodGroupStatus(podGroup *schedulingv1alpha2.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) {
|
||||
return ExtractPodGroupFrom(podGroup, fieldManager, "status")
|
||||
}
|
||||
|
||||
func (b PodGroupApplyConfiguration) IsApplyConfiguration() {}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithKind(value string) *PodGroupApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.Kind = &value
|
||||
return b
|
||||
}
|
||||
@@ -114,7 +110,7 @@ func (b *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassA
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithAPIVersion(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithAPIVersion(value string) *PodGroupApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
@@ -122,7 +118,7 @@ func (b *PriorityClassApplyConfiguration) WithAPIVersion(value string) *Priority
|
||||
// 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 *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithName(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Name = &value
|
||||
return b
|
||||
@@ -131,7 +127,7 @@ func (b *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassA
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithGenerateName(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithGenerateName(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.GenerateName = &value
|
||||
return b
|
||||
@@ -140,7 +136,7 @@ func (b *PriorityClassApplyConfiguration) WithGenerateName(value string) *Priori
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithNamespace(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Namespace = &value
|
||||
return b
|
||||
@@ -149,7 +145,7 @@ func (b *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityC
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithUID(value types.UID) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.UID = &value
|
||||
return b
|
||||
@@ -158,7 +154,7 @@ func (b *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClas
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithResourceVersion(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithResourceVersion(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
|
||||
return b
|
||||
@@ -167,7 +163,7 @@ func (b *PriorityClassApplyConfiguration) WithResourceVersion(value string) *Pri
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithGeneration(value int64) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Generation = &value
|
||||
return b
|
||||
@@ -176,7 +172,7 @@ func (b *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityC
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
|
||||
return b
|
||||
@@ -185,7 +181,7 @@ func (b *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Tim
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
|
||||
return b
|
||||
@@ -194,7 +190,7 @@ func (b *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Tim
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
@@ -204,7 +200,7 @@ func (b *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value i
|
||||
// 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 Labels field,
|
||||
// overwriting an existing map entries in Labels field with the same key.
|
||||
func (b *PriorityClassApplyConfiguration) WithLabels(entries map[string]string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithLabels(entries map[string]string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
|
||||
@@ -219,7 +215,7 @@ func (b *PriorityClassApplyConfiguration) WithLabels(entries map[string]string)
|
||||
// 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 Annotations field,
|
||||
// overwriting an existing map entries in Annotations field with the same key.
|
||||
func (b *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithAnnotations(entries map[string]string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
|
||||
@@ -233,7 +229,7 @@ func (b *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]str
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
@@ -247,7 +243,7 @@ func (b *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.Owne
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithFinalizers(values ...string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
@@ -255,62 +251,46 @@ func (b *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *Prio
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *PriorityClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
func (b *PodGroupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithValue sets the Value field in the declarative configuration to the given value
|
||||
// WithSpec sets the Spec 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 *PriorityClassApplyConfiguration) WithValue(value int32) *PriorityClassApplyConfiguration {
|
||||
b.Value = &value
|
||||
// If called multiple times, the Spec field is set to the value of the last call.
|
||||
func (b *PodGroupApplyConfiguration) WithSpec(value *PodGroupSpecApplyConfiguration) *PodGroupApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGlobalDefault sets the GlobalDefault field in the declarative configuration to the given value
|
||||
// WithStatus sets the Status 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 GlobalDefault field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithGlobalDefault(value bool) *PriorityClassApplyConfiguration {
|
||||
b.GlobalDefault = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDescription sets the Description 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 Description field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithDescription(value string) *PriorityClassApplyConfiguration {
|
||||
b.Description = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPreemptionPolicy sets the PreemptionPolicy 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 PreemptionPolicy field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PriorityClassApplyConfiguration {
|
||||
b.PreemptionPolicy = &value
|
||||
// If called multiple times, the Status field is set to the value of the last call.
|
||||
func (b *PodGroupApplyConfiguration) WithStatus(value *PodGroupStatusApplyConfiguration) *PodGroupApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetKind retrieves the value of the Kind field in the declarative configuration.
|
||||
func (b *PriorityClassApplyConfiguration) GetKind() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *PriorityClassApplyConfiguration) GetAPIVersion() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *PriorityClassApplyConfiguration) GetName() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
|
||||
func (b *PriorityClassApplyConfiguration) GetNamespace() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// PodGroupResourceClaimApplyConfiguration represents a declarative configuration of the PodGroupResourceClaim type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupResourceClaim references exactly one ResourceClaim, either directly
|
||||
// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim
|
||||
// for the PodGroup.
|
||||
//
|
||||
// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup.
|
||||
// Pods that need access to the ResourceClaim define a matching reference in its
|
||||
// own Spec.ResourceClaims. The Pod's claim must match all fields of the
|
||||
// PodGroup's claim exactly.
|
||||
type PodGroupResourceClaimApplyConfiguration struct {
|
||||
// Name uniquely identifies this resource claim inside the PodGroup.
|
||||
// This must be a DNS_LABEL.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ResourceClaimName is the name of a ResourceClaim object in the same
|
||||
// namespace as this PodGroup. The ResourceClaim will be reserved for the
|
||||
// PodGroup instead of its individual pods.
|
||||
//
|
||||
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
|
||||
// be set.
|
||||
ResourceClaimName *string `json:"resourceClaimName,omitempty"`
|
||||
// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
|
||||
// object in the same namespace as this PodGroup.
|
||||
//
|
||||
// The template will be used to create a new ResourceClaim, which will
|
||||
// be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim
|
||||
// will also be deleted. The PodGroup name and resource name, along with a
|
||||
// generated component, will be used to form a unique name for the
|
||||
// ResourceClaim, which will be recorded in podgroup.status.resourceClaimStatuses.
|
||||
//
|
||||
// This field is immutable and no changes will be made to the
|
||||
// corresponding ResourceClaim by the control plane after creating the
|
||||
// ResourceClaim.
|
||||
//
|
||||
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
|
||||
// be set.
|
||||
ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupResourceClaimApplyConfiguration constructs a declarative configuration of the PodGroupResourceClaim type for use with
|
||||
// apply.
|
||||
func PodGroupResourceClaim() *PodGroupResourceClaimApplyConfiguration {
|
||||
return &PodGroupResourceClaimApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *PodGroupResourceClaimApplyConfiguration) WithName(value string) *PodGroupResourceClaimApplyConfiguration {
|
||||
b.Name = &value
|
||||
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 *PodGroupResourceClaimApplyConfiguration) WithResourceClaimName(value string) *PodGroupResourceClaimApplyConfiguration {
|
||||
b.ResourceClaimName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceClaimTemplateName sets the ResourceClaimTemplateName 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 ResourceClaimTemplateName field is set to the value of the last call.
|
||||
func (b *PodGroupResourceClaimApplyConfiguration) WithResourceClaimTemplateName(value string) *PodGroupResourceClaimApplyConfiguration {
|
||||
b.ResourceClaimTemplateName = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// PodGroupResourceClaimStatusApplyConfiguration represents a declarative configuration of the PodGroupResourceClaimStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each
|
||||
// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the
|
||||
// generated name for the corresponding ResourceClaim.
|
||||
type PodGroupResourceClaimStatusApplyConfiguration struct {
|
||||
// Name uniquely identifies this resource claim inside the PodGroup. This
|
||||
// must match the name of an entry in podgroup.spec.resourceClaims, which
|
||||
// implies that the string must be a DNS_LABEL.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ResourceClaimName is the name of the ResourceClaim that was generated for
|
||||
// the PodGroup in the namespace of the PodGroup. If this is unset, then
|
||||
// generating a ResourceClaim was not necessary. The
|
||||
// podgroup.spec.resourceClaims entry can be ignored in this case.
|
||||
ResourceClaimName *string `json:"resourceClaimName,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupResourceClaimStatusApplyConfiguration constructs a declarative configuration of the PodGroupResourceClaimStatus type for use with
|
||||
// apply.
|
||||
func PodGroupResourceClaimStatus() *PodGroupResourceClaimStatusApplyConfiguration {
|
||||
return &PodGroupResourceClaimStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *PodGroupResourceClaimStatusApplyConfiguration) WithName(value string) *PodGroupResourceClaimStatusApplyConfiguration {
|
||||
b.Name = &value
|
||||
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 *PodGroupResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *PodGroupResourceClaimStatusApplyConfiguration {
|
||||
b.ResourceClaimName = &value
|
||||
return b
|
||||
}
|
||||
@@ -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
|
||||
|
||||
// PodGroupSchedulingConstraintsApplyConfiguration represents a declarative configuration of the PodGroupSchedulingConstraints type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.
|
||||
type PodGroupSchedulingConstraintsApplyConfiguration struct {
|
||||
// Topology defines the topology constraints for the pod group.
|
||||
// Currently only a single topology constraint can be specified. This may change in the future.
|
||||
Topology []TopologyConstraintApplyConfiguration `json:"topology,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupSchedulingConstraintsApplyConfiguration constructs a declarative configuration of the PodGroupSchedulingConstraints type for use with
|
||||
// apply.
|
||||
func PodGroupSchedulingConstraints() *PodGroupSchedulingConstraintsApplyConfiguration {
|
||||
return &PodGroupSchedulingConstraintsApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithTopology adds the given value to the Topology 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 Topology field.
|
||||
func (b *PodGroupSchedulingConstraintsApplyConfiguration) WithTopology(values ...*TopologyConstraintApplyConfiguration) *PodGroupSchedulingConstraintsApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithTopology")
|
||||
}
|
||||
b.Topology = append(b.Topology, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -16,35 +16,36 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
)
|
||||
|
||||
// PodGroupPolicyApplyConfiguration represents a declarative configuration of the PodGroupPolicy type for use
|
||||
// PodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the PodGroupSchedulingPolicy type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupPolicy defines the scheduling configuration for a PodGroup.
|
||||
type PodGroupPolicyApplyConfiguration struct {
|
||||
// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup.
|
||||
// Exactly one policy must be set.
|
||||
type PodGroupSchedulingPolicyApplyConfiguration struct {
|
||||
// Basic specifies that the pods in this group should be scheduled using
|
||||
// standard Kubernetes scheduling behavior.
|
||||
Basic *schedulingv1alpha1.BasicSchedulingPolicy `json:"basic,omitempty"`
|
||||
Basic *schedulingv1alpha2.BasicSchedulingPolicy `json:"basic,omitempty"`
|
||||
// Gang specifies that the pods in this group should be scheduled using
|
||||
// all-or-nothing semantics.
|
||||
Gang *GangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupPolicyApplyConfiguration constructs a declarative configuration of the PodGroupPolicy type for use with
|
||||
// PodGroupSchedulingPolicyApplyConfiguration constructs a declarative configuration of the PodGroupSchedulingPolicy type for use with
|
||||
// apply.
|
||||
func PodGroupPolicy() *PodGroupPolicyApplyConfiguration {
|
||||
return &PodGroupPolicyApplyConfiguration{}
|
||||
func PodGroupSchedulingPolicy() *PodGroupSchedulingPolicyApplyConfiguration {
|
||||
return &PodGroupSchedulingPolicyApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithBasic sets the Basic 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 Basic field is set to the value of the last call.
|
||||
func (b *PodGroupPolicyApplyConfiguration) WithBasic(value schedulingv1alpha1.BasicSchedulingPolicy) *PodGroupPolicyApplyConfiguration {
|
||||
func (b *PodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha2.BasicSchedulingPolicy) *PodGroupSchedulingPolicyApplyConfiguration {
|
||||
b.Basic = &value
|
||||
return b
|
||||
}
|
||||
@@ -52,7 +53,7 @@ func (b *PodGroupPolicyApplyConfiguration) WithBasic(value schedulingv1alpha1.Ba
|
||||
// WithGang sets the Gang 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 Gang field is set to the value of the last call.
|
||||
func (b *PodGroupPolicyApplyConfiguration) WithGang(value *GangSchedulingPolicyApplyConfiguration) *PodGroupPolicyApplyConfiguration {
|
||||
func (b *PodGroupSchedulingPolicyApplyConfiguration) WithGang(value *GangSchedulingPolicyApplyConfiguration) *PodGroupSchedulingPolicyApplyConfiguration {
|
||||
b.Gang = value
|
||||
return b
|
||||
}
|
||||
145
applyconfigurations/scheduling/v1alpha2/podgroupspec.go
Normal file
145
applyconfigurations/scheduling/v1alpha2/podgroupspec.go
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
)
|
||||
|
||||
// PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupSpec defines the desired state of a PodGroup.
|
||||
type PodGroupSpecApplyConfiguration struct {
|
||||
// PodGroupTemplateRef references an optional PodGroup template within other object
|
||||
// (e.g. Workload) that was used to create the PodGroup. This field is immutable.
|
||||
PodGroupTemplateRef *PodGroupTemplateReferenceApplyConfiguration `json:"podGroupTemplateRef,omitempty"`
|
||||
// SchedulingPolicy defines the scheduling policy for this instance of the PodGroup.
|
||||
// Controllers are expected to fill this field by copying it from a PodGroupTemplate.
|
||||
// This field is immutable.
|
||||
SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"`
|
||||
// SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup.
|
||||
// Controllers are expected to fill this field by copying it from a PodGroupTemplate.
|
||||
// This field is immutable.
|
||||
// This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.
|
||||
SchedulingConstraints *PodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"`
|
||||
// ResourceClaims defines which ResourceClaims may be shared among Pods in
|
||||
// the group. Pods consume the devices allocated to a PodGroup's claim by
|
||||
// defining a claim in its own Spec.ResourceClaims that matches the
|
||||
// PodGroup's claim exactly. The claim must have the same name and refer to
|
||||
// the same ResourceClaim or ResourceClaimTemplate.
|
||||
//
|
||||
// This is an alpha-level field and requires that the
|
||||
// DRAWorkloadResourceClaims feature gate is enabled.
|
||||
//
|
||||
// This field is immutable.
|
||||
ResourceClaims []PodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"`
|
||||
// DisruptionMode defines the mode in which a given PodGroup can be disrupted.
|
||||
// Controllers are expected to fill this field by copying it from a PodGroupTemplate.
|
||||
// One of Pod, PodGroup. Defaults to Pod if unset.
|
||||
// This field is immutable.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
DisruptionMode *schedulingv1alpha2.DisruptionMode `json:"disruptionMode,omitempty"`
|
||||
// PriorityClassName defines the priority that should be considered when scheduling this pod group.
|
||||
// Controllers are expected to fill this field by copying it from a PodGroupTemplate.
|
||||
// Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate
|
||||
// (i.e. if no priority class is specified, admission control can set this to the global default
|
||||
// priority class if it exists. Otherwise, the pod group's priority will be zero).
|
||||
// This field is immutable.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
PriorityClassName *string `json:"priorityClassName,omitempty"`
|
||||
// Priority is the value of priority of this pod group. Various system components
|
||||
// use this field to find the priority of the pod group. When Priority Admission
|
||||
// Controller is enabled, it prevents users from setting this field. The admission
|
||||
// controller populates this field from PriorityClassName.
|
||||
// The higher the value, the higher the priority.
|
||||
// This field is immutable.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
Priority *int32 `json:"priority,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with
|
||||
// apply.
|
||||
func PodGroupSpec() *PodGroupSpecApplyConfiguration {
|
||||
return &PodGroupSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPodGroupTemplateRef sets the PodGroupTemplateRef 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 PodGroupTemplateRef field is set to the value of the last call.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithPodGroupTemplateRef(value *PodGroupTemplateReferenceApplyConfiguration) *PodGroupSpecApplyConfiguration {
|
||||
b.PodGroupTemplateRef = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSchedulingPolicy sets the SchedulingPolicy 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 SchedulingPolicy field is set to the value of the last call.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithSchedulingPolicy(value *PodGroupSchedulingPolicyApplyConfiguration) *PodGroupSpecApplyConfiguration {
|
||||
b.SchedulingPolicy = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSchedulingConstraints sets the SchedulingConstraints 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 SchedulingConstraints field is set to the value of the last call.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithSchedulingConstraints(value *PodGroupSchedulingConstraintsApplyConfiguration) *PodGroupSpecApplyConfiguration {
|
||||
b.SchedulingConstraints = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceClaims adds the given value to the ResourceClaims 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 ResourceClaims field.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithResourceClaims(values ...*PodGroupResourceClaimApplyConfiguration) *PodGroupSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResourceClaims")
|
||||
}
|
||||
b.ResourceClaims = append(b.ResourceClaims, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDisruptionMode sets the DisruptionMode 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 DisruptionMode field is set to the value of the last call.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithDisruptionMode(value schedulingv1alpha2.DisruptionMode) *PodGroupSpecApplyConfiguration {
|
||||
b.DisruptionMode = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPriorityClassName sets the PriorityClassName 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 PriorityClassName field is set to the value of the last call.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithPriorityClassName(value string) *PodGroupSpecApplyConfiguration {
|
||||
b.PriorityClassName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPriority sets the Priority 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 Priority field is set to the value of the last call.
|
||||
func (b *PodGroupSpecApplyConfiguration) WithPriority(value int32) *PodGroupSpecApplyConfiguration {
|
||||
b.Priority = &value
|
||||
return b
|
||||
}
|
||||
81
applyconfigurations/scheduling/v1alpha2/podgroupstatus.go
Normal file
81
applyconfigurations/scheduling/v1alpha2/podgroupstatus.go
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// PodGroupStatusApplyConfiguration represents a declarative configuration of the PodGroupStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupStatus represents information about the status of a pod group.
|
||||
type PodGroupStatusApplyConfiguration struct {
|
||||
// Conditions represent the latest observations of the PodGroup's state.
|
||||
//
|
||||
// Known condition types:
|
||||
// - "PodGroupScheduled": Indicates whether the scheduling requirement has been satisfied.
|
||||
// - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated
|
||||
// due to disruption such as preemption.
|
||||
//
|
||||
// Known reasons for the PodGroupScheduled condition:
|
||||
// - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints,
|
||||
// affinity/anti-affinity rules, or insufficient capacity for the gang.
|
||||
// - "SchedulerError": The PodGroup cannot be scheduled due to some internal error
|
||||
// that happened during scheduling, for example due to nodeAffinity parsing errors.
|
||||
//
|
||||
// Known reasons for the DisruptionTarget condition:
|
||||
// - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for
|
||||
// higher-priority PodGroups or Pods.
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
// Status of resource claims.
|
||||
ResourceClaimStatuses []PodGroupResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupStatusApplyConfiguration constructs a declarative configuration of the PodGroupStatus type for use with
|
||||
// apply.
|
||||
func PodGroupStatus() *PodGroupStatusApplyConfiguration {
|
||||
return &PodGroupStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *PodGroupStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *PodGroupStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceClaimStatuses adds the given value to the ResourceClaimStatuses 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 ResourceClaimStatuses field.
|
||||
func (b *PodGroupStatusApplyConfiguration) WithResourceClaimStatuses(values ...*PodGroupResourceClaimStatusApplyConfiguration) *PodGroupStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResourceClaimStatuses")
|
||||
}
|
||||
b.ResourceClaimStatuses = append(b.ResourceClaimStatuses, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
136
applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go
Normal file
136
applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
)
|
||||
|
||||
// PodGroupTemplateApplyConfiguration represents a declarative configuration of the PodGroupTemplate type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupTemplate represents a template for a set of pods with a scheduling policy.
|
||||
type PodGroupTemplateApplyConfiguration struct {
|
||||
// Name is a unique identifier for the PodGroupTemplate within the Workload.
|
||||
// It must be a DNS label. This field is immutable.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// SchedulingPolicy defines the scheduling policy for this PodGroupTemplate.
|
||||
SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"`
|
||||
// SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate.
|
||||
// This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.
|
||||
SchedulingConstraints *PodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"`
|
||||
// ResourceClaims defines which ResourceClaims may be shared among Pods in
|
||||
// the group. Pods consume the devices allocated to a PodGroup's claim by
|
||||
// defining a claim in its own Spec.ResourceClaims that matches the
|
||||
// PodGroup's claim exactly. The claim must have the same name and refer to
|
||||
// the same ResourceClaim or ResourceClaimTemplate.
|
||||
//
|
||||
// This is an alpha-level field and requires that the
|
||||
// DRAWorkloadResourceClaims feature gate is enabled.
|
||||
//
|
||||
// This field is immutable.
|
||||
ResourceClaims []PodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"`
|
||||
// DisruptionMode defines the mode in which a given PodGroup can be disrupted.
|
||||
// One of Pod, PodGroup.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
DisruptionMode *schedulingv1alpha2.DisruptionMode `json:"disruptionMode,omitempty"`
|
||||
// PriorityClassName indicates the priority that should be considered when scheduling
|
||||
// a pod group created from this template. If no priority class is specified, admission
|
||||
// control can set this to the global default priority class if it exists. Otherwise,
|
||||
// pod groups created from this template will have the priority set to zero.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
PriorityClassName *string `json:"priorityClassName,omitempty"`
|
||||
// Priority is the value of priority of pod groups created from this template. Various
|
||||
// system components use this field to find the priority of the pod group. When
|
||||
// Priority Admission Controller is enabled, it prevents users from setting this field.
|
||||
// The admission controller populates this field from PriorityClassName.
|
||||
// The higher the value, the higher the priority.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
Priority *int32 `json:"priority,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupTemplateApplyConfiguration constructs a declarative configuration of the PodGroupTemplate type for use with
|
||||
// apply.
|
||||
func PodGroupTemplate() *PodGroupTemplateApplyConfiguration {
|
||||
return &PodGroupTemplateApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *PodGroupTemplateApplyConfiguration) WithName(value string) *PodGroupTemplateApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSchedulingPolicy sets the SchedulingPolicy 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 SchedulingPolicy field is set to the value of the last call.
|
||||
func (b *PodGroupTemplateApplyConfiguration) WithSchedulingPolicy(value *PodGroupSchedulingPolicyApplyConfiguration) *PodGroupTemplateApplyConfiguration {
|
||||
b.SchedulingPolicy = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSchedulingConstraints sets the SchedulingConstraints 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 SchedulingConstraints field is set to the value of the last call.
|
||||
func (b *PodGroupTemplateApplyConfiguration) WithSchedulingConstraints(value *PodGroupSchedulingConstraintsApplyConfiguration) *PodGroupTemplateApplyConfiguration {
|
||||
b.SchedulingConstraints = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceClaims adds the given value to the ResourceClaims 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 ResourceClaims field.
|
||||
func (b *PodGroupTemplateApplyConfiguration) WithResourceClaims(values ...*PodGroupResourceClaimApplyConfiguration) *PodGroupTemplateApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResourceClaims")
|
||||
}
|
||||
b.ResourceClaims = append(b.ResourceClaims, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDisruptionMode sets the DisruptionMode 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 DisruptionMode field is set to the value of the last call.
|
||||
func (b *PodGroupTemplateApplyConfiguration) WithDisruptionMode(value schedulingv1alpha2.DisruptionMode) *PodGroupTemplateApplyConfiguration {
|
||||
b.DisruptionMode = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPriorityClassName sets the PriorityClassName 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 PriorityClassName field is set to the value of the last call.
|
||||
func (b *PodGroupTemplateApplyConfiguration) WithPriorityClassName(value string) *PodGroupTemplateApplyConfiguration {
|
||||
b.PriorityClassName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPriority sets the Priority 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 Priority field is set to the value of the last call.
|
||||
func (b *PodGroupTemplateApplyConfiguration) WithPriority(value int32) *PodGroupTemplateApplyConfiguration {
|
||||
b.Priority = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// PodGroupTemplateReferenceApplyConfiguration represents a declarative configuration of the PodGroupTemplateReference type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload).
|
||||
// Exactly one reference must be set.
|
||||
type PodGroupTemplateReferenceApplyConfiguration struct {
|
||||
// Workload references the PodGroupTemplate within the Workload object that was used to create
|
||||
// the PodGroup.
|
||||
Workload *WorkloadPodGroupTemplateReferenceApplyConfiguration `json:"workload,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupTemplateReferenceApplyConfiguration constructs a declarative configuration of the PodGroupTemplateReference type for use with
|
||||
// apply.
|
||||
func PodGroupTemplateReference() *PodGroupTemplateReferenceApplyConfiguration {
|
||||
return &PodGroupTemplateReferenceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithWorkload sets the Workload 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 Workload field is set to the value of the last call.
|
||||
func (b *PodGroupTemplateReferenceApplyConfiguration) WithWorkload(value *WorkloadPodGroupTemplateReferenceApplyConfiguration) *PodGroupTemplateReferenceApplyConfiguration {
|
||||
b.Workload = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// TopologyConstraintApplyConfiguration represents a declarative configuration of the TopologyConstraint type for use
|
||||
// with apply.
|
||||
//
|
||||
// TopologyConstraint defines a topology constraint for a PodGroup.
|
||||
type TopologyConstraintApplyConfiguration struct {
|
||||
// Key specifies the key of the node label representing the topology domain.
|
||||
// All pods within the PodGroup must be colocated within the same domain instance.
|
||||
// Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate.
|
||||
// Examples: "topology.kubernetes.io/rack"
|
||||
Key *string `json:"key,omitempty"`
|
||||
}
|
||||
|
||||
// TopologyConstraintApplyConfiguration constructs a declarative configuration of the TopologyConstraint type for use with
|
||||
// apply.
|
||||
func TopologyConstraint() *TopologyConstraintApplyConfiguration {
|
||||
return &TopologyConstraintApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithKey sets the Key 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 Key field is set to the value of the last call.
|
||||
func (b *TopologyConstraintApplyConfiguration) WithKey(value string) *TopologyConstraintApplyConfiguration {
|
||||
b.Key = &value
|
||||
return b
|
||||
}
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
// TypedLocalObjectReferenceApplyConfiguration represents a declarative configuration of the TypedLocalObjectReference type for use
|
||||
// with apply.
|
||||
@@ -16,10 +16,10 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
@@ -31,12 +31,13 @@ import (
|
||||
// with apply.
|
||||
//
|
||||
// Workload allows for expressing scheduling constraints that should be used
|
||||
// when managing lifecycle of workloads from scheduling perspective,
|
||||
// when managing the lifecycle of workloads from the scheduling perspective,
|
||||
// including scheduling, preemption, eviction and other phases.
|
||||
// Workload API enablement is toggled by the GenericWorkload feature gate.
|
||||
type WorkloadApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// Standard object's metadata.
|
||||
// Name must be a DNS subdomain.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
// Spec defines the desired behavior of a Workload.
|
||||
Spec *WorkloadSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
@@ -49,7 +50,7 @@ func Workload(name, namespace string) *WorkloadApplyConfiguration {
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("Workload")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -60,9 +61,9 @@ func Workload(name, namespace string) *WorkloadApplyConfiguration {
|
||||
// ExtractWorkloadFrom provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractWorkloadFrom(workload *schedulingv1alpha1.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) {
|
||||
func ExtractWorkloadFrom(workload *schedulingv1alpha2.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) {
|
||||
b := &WorkloadApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1alpha1.Workload"), fieldManager, b, subresource)
|
||||
err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1alpha2.Workload"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -70,7 +71,7 @@ func ExtractWorkloadFrom(workload *schedulingv1alpha1.Workload, fieldManager str
|
||||
b.WithNamespace(workload.Namespace)
|
||||
|
||||
b.WithKind("Workload")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
@@ -84,7 +85,7 @@ func ExtractWorkloadFrom(workload *schedulingv1alpha1.Workload, fieldManager str
|
||||
// ExtractWorkload provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
func ExtractWorkload(workload *schedulingv1alpha1.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) {
|
||||
func ExtractWorkload(workload *schedulingv1alpha2.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) {
|
||||
return ExtractWorkloadFrom(workload, fieldManager, "")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// WorkloadPodGroupTemplateReferenceApplyConfiguration represents a declarative configuration of the WorkloadPodGroupTemplateReference type for use
|
||||
// with apply.
|
||||
//
|
||||
// WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.
|
||||
type WorkloadPodGroupTemplateReferenceApplyConfiguration struct {
|
||||
// WorkloadName defines the name of the Workload object.
|
||||
WorkloadName *string `json:"workloadName,omitempty"`
|
||||
// PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.
|
||||
PodGroupTemplateName *string `json:"podGroupTemplateName,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadPodGroupTemplateReferenceApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupTemplateReference type for use with
|
||||
// apply.
|
||||
func WorkloadPodGroupTemplateReference() *WorkloadPodGroupTemplateReferenceApplyConfiguration {
|
||||
return &WorkloadPodGroupTemplateReferenceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithWorkloadName sets the WorkloadName 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 WorkloadName field is set to the value of the last call.
|
||||
func (b *WorkloadPodGroupTemplateReferenceApplyConfiguration) WithWorkloadName(value string) *WorkloadPodGroupTemplateReferenceApplyConfiguration {
|
||||
b.WorkloadName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroupTemplateName sets the PodGroupTemplateName 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 PodGroupTemplateName field is set to the value of the last call.
|
||||
func (b *WorkloadPodGroupTemplateReferenceApplyConfiguration) WithPodGroupTemplateName(value string) *WorkloadPodGroupTemplateReferenceApplyConfiguration {
|
||||
b.PodGroupTemplateName = &value
|
||||
return b
|
||||
}
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
// WorkloadSpecApplyConfiguration represents a declarative configuration of the WorkloadSpec type for use
|
||||
// with apply.
|
||||
@@ -26,11 +26,11 @@ type WorkloadSpecApplyConfiguration struct {
|
||||
// ControllerRef is an optional reference to the controlling object, such as a
|
||||
// Deployment or Job. This field is intended for use by tools like CLIs
|
||||
// to provide a link back to the original workload definition.
|
||||
// When set, it cannot be changed.
|
||||
// This field is immutable.
|
||||
ControllerRef *TypedLocalObjectReferenceApplyConfiguration `json:"controllerRef,omitempty"`
|
||||
// PodGroups is the list of pod groups that make up the Workload.
|
||||
// The maximum number of pod groups is 8. This field is immutable.
|
||||
PodGroups []PodGroupApplyConfiguration `json:"podGroups,omitempty"`
|
||||
// PodGroupTemplates is the list of templates that make up the Workload.
|
||||
// The maximum number of templates is 8. This field is immutable.
|
||||
PodGroupTemplates []PodGroupTemplateApplyConfiguration `json:"podGroupTemplates,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadSpecApplyConfiguration constructs a declarative configuration of the WorkloadSpec type for use with
|
||||
@@ -47,15 +47,15 @@ func (b *WorkloadSpecApplyConfiguration) WithControllerRef(value *TypedLocalObje
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroups adds the given value to the PodGroups field in the declarative configuration
|
||||
// WithPodGroupTemplates adds the given value to the PodGroupTemplates 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 PodGroups field.
|
||||
func (b *WorkloadSpecApplyConfiguration) WithPodGroups(values ...*PodGroupApplyConfiguration) *WorkloadSpecApplyConfiguration {
|
||||
// If called multiple times, values provided by each call will be appended to the PodGroupTemplates field.
|
||||
func (b *WorkloadSpecApplyConfiguration) WithPodGroupTemplates(values ...*PodGroupTemplateApplyConfiguration) *WorkloadSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithPodGroups")
|
||||
panic("nil value passed to WithPodGroupTemplates")
|
||||
}
|
||||
b.PodGroups = append(b.PodGroups, *values[i])
|
||||
b.PodGroupTemplates = append(b.PodGroupTemplates, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -154,7 +154,7 @@ type CSIDriverSpecApplyConfiguration struct {
|
||||
// occur (neither periodic nor upon detecting capacity-related failures), and the
|
||||
// allocatable.count remains static. The minimum allowed value for this field is 10 seconds.
|
||||
//
|
||||
// This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled.
|
||||
// This feature requires the MutableCSINodeAllocatableCount feature gate to be enabled.
|
||||
//
|
||||
// This field is mutable.
|
||||
NodeAllocatableUpdatePeriodSeconds *int64 `json:"nodeAllocatableUpdatePeriodSeconds,omitempty"`
|
||||
@@ -178,6 +178,24 @@ type CSIDriverSpecApplyConfiguration struct {
|
||||
//
|
||||
// Default behavior if unset is to pass tokens in the VolumeContext field.
|
||||
ServiceAccountTokenInSecrets *bool `json:"serviceAccountTokenInSecrets,omitempty"`
|
||||
// PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod
|
||||
// scheduling if the CSI driver on the node is missing.
|
||||
//
|
||||
// Enabling this option will prevent the scheduler (or any other
|
||||
// component which embeds default scheduler such as cluster-autoscaler) from
|
||||
// scheduling pods to nodes where CSI driver is not installed.
|
||||
//
|
||||
// For components(such as cluster-autoscaler) that embed the scheduler and run
|
||||
// pod placement simulations using scheduler plugins, they MUST be aware of
|
||||
// CSI driver registration information via CSINode object. They must create simulated
|
||||
// CSINode objects in addition to Node objects during scheduling simulation, otherwise
|
||||
// if PreventPodSchedulingIfMissing is enabled globally for CSIDriver object, any
|
||||
// newly created node may be rejected by the scheduler because of missing CSI driver
|
||||
// information from the node.
|
||||
//
|
||||
// This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled.
|
||||
// Default is "false".
|
||||
PreventPodSchedulingIfMissing *bool `json:"preventPodSchedulingIfMissing,omitempty"`
|
||||
}
|
||||
|
||||
// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with
|
||||
@@ -272,3 +290,11 @@ func (b *CSIDriverSpecApplyConfiguration) WithServiceAccountTokenInSecrets(value
|
||||
b.ServiceAccountTokenInSecrets = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPreventPodSchedulingIfMissing sets the PreventPodSchedulingIfMissing 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 PreventPodSchedulingIfMissing field is set to the value of the last call.
|
||||
func (b *CSIDriverSpecApplyConfiguration) WithPreventPodSchedulingIfMissing(value bool) *CSIDriverSpecApplyConfiguration {
|
||||
b.PreventPodSchedulingIfMissing = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ type VolumeErrorApplyConfiguration struct {
|
||||
Message *string `json:"message,omitempty"`
|
||||
// errorCode is a numeric gRPC code representing the error encountered during Attach or Detach operations.
|
||||
//
|
||||
// This is an optional, beta field that requires the MutableCSINodeAllocatableCount feature gate being enabled to be set.
|
||||
// This field requires the MutableCSINodeAllocatableCount feature gate being enabled to be set.
|
||||
ErrorCode *int32 `json:"errorCode,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,24 @@ type CSIDriverSpecApplyConfiguration struct {
|
||||
//
|
||||
// Default behavior if unset is to pass tokens in the VolumeContext field.
|
||||
ServiceAccountTokenInSecrets *bool `json:"serviceAccountTokenInSecrets,omitempty"`
|
||||
// PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod
|
||||
// scheduling if the CSI driver on the node is missing.
|
||||
//
|
||||
// Enabling this option will prevent the scheduler (or any other
|
||||
// component which embeds default scheduler such as cluster-autoscaler) from
|
||||
// scheduling pods to nodes where CSI driver is not installed.
|
||||
//
|
||||
// For components(such as cluster-autoscaler) that embed the scheduler and run
|
||||
// pod placement simulations using scheduler plugins, they MUST be aware of
|
||||
// CSI driver registration information via CSINode object. They must create simulated
|
||||
// CSINode objects in addition to Node objects during scheduling simulation, otherwise
|
||||
// if PreventPodSchedulingIfMissing is enabled globally for CSIDriver object, any
|
||||
// newly created node may be rejected by the scheduler because of missing CSI driver
|
||||
// information from the node.
|
||||
//
|
||||
// This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled.
|
||||
// Default is "false".
|
||||
PreventPodSchedulingIfMissing *bool `json:"preventPodSchedulingIfMissing,omitempty"`
|
||||
}
|
||||
|
||||
// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with
|
||||
@@ -272,3 +290,11 @@ func (b *CSIDriverSpecApplyConfiguration) WithServiceAccountTokenInSecrets(value
|
||||
b.ServiceAccountTokenInSecrets = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPreventPodSchedulingIfMissing sets the PreventPodSchedulingIfMissing 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 PreventPodSchedulingIfMissing field is set to the value of the last call.
|
||||
func (b *CSIDriverSpecApplyConfiguration) WithPreventPodSchedulingIfMissing(value bool) *CSIDriverSpecApplyConfiguration {
|
||||
b.PreventPodSchedulingIfMissing = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
@@ -117,7 +117,7 @@ import (
|
||||
applyconfigurationsresourcev1beta1 "k8s.io/client-go/applyconfigurations/resource/v1beta1"
|
||||
applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2"
|
||||
applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1"
|
||||
applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1"
|
||||
applyconfigurationsschedulingv1alpha2 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha2"
|
||||
applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1"
|
||||
applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1"
|
||||
applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1"
|
||||
@@ -790,6 +790,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.NodeAddressApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeAffinity"):
|
||||
return &applyconfigurationscorev1.NodeAffinityApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeAllocatableResourceClaimStatus"):
|
||||
return &applyconfigurationscorev1.NodeAllocatableResourceClaimStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeCondition"):
|
||||
return &applyconfigurationscorev1.NodeConditionApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeConfigSource"):
|
||||
@@ -874,6 +876,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.PodResourceClaimStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSchedulingGate"):
|
||||
return &applyconfigurationscorev1.PodSchedulingGateApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSchedulingGroup"):
|
||||
return &applyconfigurationscorev1.PodSchedulingGroupApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSecurityContext"):
|
||||
return &applyconfigurationscorev1.PodSecurityContextApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSpec"):
|
||||
@@ -1014,8 +1018,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.WeightedPodAffinityTermApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("WindowsSecurityContextOptions"):
|
||||
return &applyconfigurationscorev1.WindowsSecurityContextOptionsApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("WorkloadReference"):
|
||||
return &applyconfigurationscorev1.WorkloadReferenceApplyConfiguration{}
|
||||
|
||||
// Group=discovery.k8s.io, Version=v1
|
||||
case discoveryv1.SchemeGroupVersion.WithKind("Endpoint"):
|
||||
@@ -1620,6 +1622,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsresourcev1.ExactDeviceRequestApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &applyconfigurationsresourcev1.NetworkDeviceDataApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"):
|
||||
return &applyconfigurationsresourcev1.NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1652,6 +1656,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &resourcev1alpha3.DeviceTaintRuleStatusApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintSelector"):
|
||||
return &resourcev1alpha3.DeviceTaintSelectorApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("PoolStatus"):
|
||||
return &resourcev1alpha3.PoolStatusApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequest"):
|
||||
return &resourcev1alpha3.ResourcePoolStatusRequestApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequestSpec"):
|
||||
return &resourcev1alpha3.ResourcePoolStatusRequestSpecApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequestStatus"):
|
||||
return &resourcev1alpha3.ResourcePoolStatusRequestStatusApplyConfiguration{}
|
||||
|
||||
// Group=resource.k8s.io, Version=v1beta1
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("AllocatedDeviceStatus"):
|
||||
@@ -1712,6 +1724,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsresourcev1beta1.DeviceTolerationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &applyconfigurationsresourcev1beta1.NetworkDeviceDataApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"):
|
||||
return &applyconfigurationsresourcev1beta1.NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1786,12 +1800,22 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsresourcev1beta2.DeviceSubRequestApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaint"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintRule"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintRuleApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintRuleSpec"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintRuleSpecApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintRuleStatus"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintRuleStatusApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintSelector"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintSelectorApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceToleration"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTolerationApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("ExactDeviceRequest"):
|
||||
return &applyconfigurationsresourcev1beta2.ExactDeviceRequestApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &applyconfigurationsresourcev1beta2.NetworkDeviceDataApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"):
|
||||
return &applyconfigurationsresourcev1beta2.NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta2.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1817,21 +1841,37 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{}
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1alpha1
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("GangSchedulingPolicy"):
|
||||
return &applyconfigurationsschedulingv1alpha1.GangSchedulingPolicyApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("PodGroup"):
|
||||
return &applyconfigurationsschedulingv1alpha1.PodGroupApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("PodGroupPolicy"):
|
||||
return &applyconfigurationsschedulingv1alpha1.PodGroupPolicyApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
return &applyconfigurationsschedulingv1alpha1.PriorityClassApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("TypedLocalObjectReference"):
|
||||
return &applyconfigurationsschedulingv1alpha1.TypedLocalObjectReferenceApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("Workload"):
|
||||
return &applyconfigurationsschedulingv1alpha1.WorkloadApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("WorkloadSpec"):
|
||||
return &applyconfigurationsschedulingv1alpha1.WorkloadSpecApplyConfiguration{}
|
||||
// Group=scheduling.k8s.io, Version=v1alpha2
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("GangSchedulingPolicy"):
|
||||
return &applyconfigurationsschedulingv1alpha2.GangSchedulingPolicyApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroup"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupResourceClaim"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupResourceClaimApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupResourceClaimStatus"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupResourceClaimStatusApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupSchedulingConstraints"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupSchedulingConstraintsApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupSchedulingPolicy"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupSchedulingPolicyApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupSpec"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupSpecApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupStatus"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupStatusApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupTemplate"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupTemplateApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupTemplateReference"):
|
||||
return &applyconfigurationsschedulingv1alpha2.PodGroupTemplateReferenceApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("TopologyConstraint"):
|
||||
return &applyconfigurationsschedulingv1alpha2.TopologyConstraintApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("TypedLocalObjectReference"):
|
||||
return &applyconfigurationsschedulingv1alpha2.TypedLocalObjectReferenceApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("Workload"):
|
||||
return &applyconfigurationsschedulingv1alpha2.WorkloadApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("WorkloadPodGroupTemplateReference"):
|
||||
return &applyconfigurationsschedulingv1alpha2.WorkloadPodGroupTemplateReferenceApplyConfiguration{}
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithKind("WorkloadSpec"):
|
||||
return &applyconfigurationsschedulingv1alpha2.WorkloadSpecApplyConfiguration{}
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1beta1
|
||||
case schedulingv1beta1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
|
||||
@@ -38,6 +38,13 @@ const (
|
||||
// events for items popped off the FIFO.
|
||||
AtomicFIFO Feature = "AtomicFIFO"
|
||||
|
||||
// owner: @yt2985
|
||||
// beta: 1.36
|
||||
//
|
||||
// If enabled, allows clients to gracefully handle Certificate Authority (CA)
|
||||
// rotations without dropping connections or requiring a restart.
|
||||
ClientsAllowCARotation Feature = "ClientsAllowCARotation"
|
||||
|
||||
// owner: @benluddy
|
||||
// kep: https://kep.k8s.io/4222
|
||||
// alpha: 1.32
|
||||
@@ -48,6 +55,13 @@ const (
|
||||
// "application/json" or "application/apply-patch+yaml", respectively.
|
||||
ClientsAllowCBOR Feature = "ClientsAllowCBOR"
|
||||
|
||||
// owner: @enj
|
||||
// beta: v1.36
|
||||
//
|
||||
// If enabled, the client-go TLS transport cache uses weak pointers to allow
|
||||
// garbage collection of unused transports, preventing unbounded cache growth.
|
||||
ClientsAllowTLSCacheGC Feature = "ClientsAllowTLSCacheGC"
|
||||
|
||||
// owner: @benluddy
|
||||
// kep: https://kep.k8s.io/4222
|
||||
// alpha: 1.32
|
||||
@@ -98,9 +112,15 @@ var defaultVersionedKubernetesFeatureGates = map[Feature]VersionedSpecs{
|
||||
AtomicFIFO: {
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: Beta},
|
||||
},
|
||||
ClientsAllowCARotation: {
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: Beta},
|
||||
},
|
||||
ClientsAllowCBOR: {
|
||||
{Version: version.MustParse("1.32"), Default: false, PreRelease: Alpha},
|
||||
},
|
||||
ClientsAllowTLSCacheGC: {
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: Beta},
|
||||
},
|
||||
ClientsPreferCBOR: {
|
||||
{Version: version.MustParse("1.32"), Default: false, PreRelease: Alpha},
|
||||
},
|
||||
|
||||
20
go.mod
20
go.mod
@@ -2,9 +2,9 @@
|
||||
|
||||
module k8s.io/client-go
|
||||
|
||||
go 1.25.0
|
||||
go 1.26.0
|
||||
|
||||
godebug default=go1.25
|
||||
godebug default=go1.26
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.3
|
||||
@@ -21,12 +21,13 @@ require (
|
||||
golang.org/x/oauth2 v0.34.0
|
||||
golang.org/x/term v0.39.0
|
||||
golang.org/x/time v0.14.0
|
||||
google.golang.org/protobuf v1.36.11
|
||||
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
|
||||
gopkg.in/evanphx/json-patch.v4 v4.13.0
|
||||
k8s.io/api v0.0.0-20260225113016-5bcacdeb1fa7
|
||||
k8s.io/apimachinery v0.0.0-20260224233333-db8f40c74cff
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4
|
||||
k8s.io/api v0.36.2
|
||||
k8s.io/apimachinery v0.36.2
|
||||
k8s.io/klog/v2 v2.140.0
|
||||
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a
|
||||
k8s.io/streaming v0.36.2
|
||||
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730
|
||||
sigs.k8s.io/randfill v1.0.0
|
||||
@@ -35,7 +36,6 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.4.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||
@@ -43,14 +43,12 @@ require (
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/moby/spdystream v0.5.0 // indirect
|
||||
github.com/moby/spdystream v0.5.1 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
|
||||
44
go.sum
44
go.sum
@@ -1,5 +1,3 @@
|
||||
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
|
||||
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
@@ -21,8 +19,6 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
|
||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
|
||||
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
||||
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
|
||||
@@ -30,8 +26,6 @@ github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7O
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
|
||||
@@ -49,8 +43,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
|
||||
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
|
||||
github.com/moby/spdystream v0.5.1 h1:9sNYeYZUcci9R6/w7KDaFWEWeV4LStVG78Mpyq/Zm/Y=
|
||||
github.com/moby/spdystream v0.5.1/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
@@ -59,12 +53,6 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/onsi/ginkgo/v2 v2.27.4 h1:fcEcQW/A++6aZAZQNUmNjvA9PSOzefMJBerHJ4t8v8Y=
|
||||
github.com/onsi/ginkgo/v2 v2.27.4/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
|
||||
github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q=
|
||||
github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
@@ -93,14 +81,10 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
|
||||
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
|
||||
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
|
||||
@@ -109,10 +93,8 @@ golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
|
||||
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI=
|
||||
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
@@ -123,14 +105,16 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.0.0-20260225113016-5bcacdeb1fa7 h1:sLZeXdnm4IBamL+Q0YIi3aLjOZeU6XSPAyq+llItk7U=
|
||||
k8s.io/api v0.0.0-20260225113016-5bcacdeb1fa7/go.mod h1:sJfdY4gzHfS5ewdEw0CVoyPe9x4YLhHe2eZHXiaegXo=
|
||||
k8s.io/apimachinery v0.0.0-20260224233333-db8f40c74cff h1:yJisc9AAvRi0Y6BdNqnjR/KlY298LeFUFI+YOmqpbUw=
|
||||
k8s.io/apimachinery v0.0.0-20260224233333-db8f40c74cff/go.mod h1:7mgr/dli8ofwAbcIQXetFVX1fbOYsOYojq3AUbybVmQ=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 h1:HhDfevmPS+OalTjQRKbTHppRIz01AWi8s45TMXStgYY=
|
||||
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
|
||||
k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY=
|
||||
k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg=
|
||||
k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ=
|
||||
k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4=
|
||||
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
|
||||
k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
|
||||
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a h1:xCeOEAOoGYl2jnJoHkC3hkbPJgdATINPMAxaynU2Ovg=
|
||||
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0=
|
||||
k8s.io/streaming v0.36.2 h1:NSKthPPg9UFSKsRauVJUVGH2Dvn8fhKmY4qrMkw/p98=
|
||||
k8s.io/streaming v0.36.2/go.mod h1:z6fV3D+NVkoeqRMtWwlUZK6U17SY/LqNzOxWL6GyR/s=
|
||||
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU=
|
||||
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
|
||||
|
||||
@@ -256,7 +256,9 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
|
||||
}
|
||||
|
||||
informer = newFunc(f.client, resyncPeriod)
|
||||
informer.SetTransform(f.transform)
|
||||
if f.transform != nil {
|
||||
informer.SetTransform(f.transform)
|
||||
}
|
||||
f.informers[informerType] = informer
|
||||
|
||||
return informer
|
||||
|
||||
@@ -63,7 +63,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
@@ -392,6 +392,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=resource.k8s.io, Version=v1alpha3
|
||||
case v1alpha3.SchemeGroupVersion.WithResource("devicetaintrules"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceTaintRules().Informer()}, nil
|
||||
case v1alpha3.SchemeGroupVersion.WithResource("resourcepoolstatusrequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourcePoolStatusRequests().Informer()}, nil
|
||||
|
||||
// Group=resource.k8s.io, Version=v1beta1
|
||||
case resourcev1beta1.SchemeGroupVersion.WithResource("deviceclasses"):
|
||||
@@ -406,6 +408,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=resource.k8s.io, Version=v1beta2
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("deviceclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().DeviceClasses().Informer()}, nil
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("devicetaintrules"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().DeviceTaintRules().Informer()}, nil
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("resourceclaims"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().ResourceClaims().Informer()}, nil
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("resourceclaimtemplates"):
|
||||
@@ -417,11 +421,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1().PriorityClasses().Informer()}, nil
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1alpha1
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().PriorityClasses().Informer()}, nil
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithResource("workloads"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().Workloads().Informer()}, nil
|
||||
// Group=scheduling.k8s.io, Version=v1alpha2
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithResource("podgroups"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha2().PodGroups().Informer()}, nil
|
||||
case schedulingv1alpha2.SchemeGroupVersion.WithResource("workloads"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha2().Workloads().Informer()}, nil
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1beta1
|
||||
case schedulingv1beta1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
|
||||
@@ -26,6 +26,8 @@ import (
|
||||
type Interface interface {
|
||||
// DeviceTaintRules returns a DeviceTaintRuleInformer.
|
||||
DeviceTaintRules() DeviceTaintRuleInformer
|
||||
// ResourcePoolStatusRequests returns a ResourcePoolStatusRequestInformer.
|
||||
ResourcePoolStatusRequests() ResourcePoolStatusRequestInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
@@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
func (v *version) DeviceTaintRules() DeviceTaintRuleInformer {
|
||||
return &deviceTaintRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequests returns a ResourcePoolStatusRequestInformer.
|
||||
func (v *version) ResourcePoolStatusRequests() ResourcePoolStatusRequestInformer {
|
||||
return &resourcePoolStatusRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
115
informers/resource/v1alpha3/resourcepoolstatusrequest.go
Normal file
115
informers/resource/v1alpha3/resourcepoolstatusrequest.go
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apiresourcev1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
resourcev1alpha3 "k8s.io/client-go/listers/resource/v1alpha3"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResourcePoolStatusRequestInformer provides access to a shared informer and lister for
|
||||
// ResourcePoolStatusRequests.
|
||||
type ResourcePoolStatusRequestInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() resourcev1alpha3.ResourcePoolStatusRequestLister
|
||||
}
|
||||
|
||||
type resourcePoolStatusRequestInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewResourcePoolStatusRequestInformer constructs a new informer for ResourcePoolStatusRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewResourcePoolStatusRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers})
|
||||
}
|
||||
|
||||
// NewFilteredResourcePoolStatusRequestInformer constructs a new informer for ResourcePoolStatusRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredResourcePoolStatusRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return NewResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions})
|
||||
}
|
||||
|
||||
// NewResourcePoolStatusRequestInformerWithOptions constructs a new informer for ResourcePoolStatusRequest type with additional options.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewResourcePoolStatusRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1alpha3", Resource: "resourcepoolstatusrequests"}
|
||||
identifier := options.InformerName.WithResource(gvr)
|
||||
tweakListOptions := options.TweakListOptions
|
||||
return cache.NewSharedIndexInformerWithOptions(
|
||||
cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{
|
||||
ListFunc: func(opts v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1alpha3().ResourcePoolStatusRequests().List(context.Background(), opts)
|
||||
},
|
||||
WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1alpha3().ResourcePoolStatusRequests().Watch(context.Background(), opts)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1alpha3().ResourcePoolStatusRequests().List(ctx, opts)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1alpha3().ResourcePoolStatusRequests().Watch(ctx, opts)
|
||||
},
|
||||
}, client),
|
||||
&apiresourcev1alpha3.ResourcePoolStatusRequest{},
|
||||
cache.SharedIndexInformerOptions{
|
||||
ResyncPeriod: options.ResyncPeriod,
|
||||
Indexers: options.Indexers,
|
||||
Identifier: identifier,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resourcePoolStatusRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions})
|
||||
}
|
||||
|
||||
func (f *resourcePoolStatusRequestInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiresourcev1alpha3.ResourcePoolStatusRequest{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resourcePoolStatusRequestInformer) Lister() resourcev1alpha3.ResourcePoolStatusRequestLister {
|
||||
return resourcev1alpha3.NewResourcePoolStatusRequestLister(f.Informer().GetIndexer())
|
||||
}
|
||||
115
informers/resource/v1beta2/devicetaintrule.go
Normal file
115
informers/resource/v1beta2/devicetaintrule.go
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apiresourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
resourcev1beta2 "k8s.io/client-go/listers/resource/v1beta2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// DeviceTaintRuleInformer provides access to a shared informer and lister for
|
||||
// DeviceTaintRules.
|
||||
type DeviceTaintRuleInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() resourcev1beta2.DeviceTaintRuleLister
|
||||
}
|
||||
|
||||
type deviceTaintRuleInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers})
|
||||
}
|
||||
|
||||
// NewFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions})
|
||||
}
|
||||
|
||||
// NewDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta2", Resource: "devicetaintrules"}
|
||||
identifier := options.InformerName.WithResource(gvr)
|
||||
tweakListOptions := options.TweakListOptions
|
||||
return cache.NewSharedIndexInformerWithOptions(
|
||||
cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{
|
||||
ListFunc: func(opts v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1beta2().DeviceTaintRules().List(context.Background(), opts)
|
||||
},
|
||||
WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1beta2().DeviceTaintRules().Watch(context.Background(), opts)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1beta2().DeviceTaintRules().List(ctx, opts)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.ResourceV1beta2().DeviceTaintRules().Watch(ctx, opts)
|
||||
},
|
||||
}, client),
|
||||
&apiresourcev1beta2.DeviceTaintRule{},
|
||||
cache.SharedIndexInformerOptions{
|
||||
ResyncPeriod: options.ResyncPeriod,
|
||||
Indexers: options.Indexers,
|
||||
Identifier: identifier,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func (f *deviceTaintRuleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions})
|
||||
}
|
||||
|
||||
func (f *deviceTaintRuleInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiresourcev1beta2.DeviceTaintRule{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *deviceTaintRuleInformer) Lister() resourcev1beta2.DeviceTaintRuleLister {
|
||||
return resourcev1beta2.NewDeviceTaintRuleLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -26,6 +26,8 @@ import (
|
||||
type Interface interface {
|
||||
// DeviceClasses returns a DeviceClassInformer.
|
||||
DeviceClasses() DeviceClassInformer
|
||||
// DeviceTaintRules returns a DeviceTaintRuleInformer.
|
||||
DeviceTaintRules() DeviceTaintRuleInformer
|
||||
// ResourceClaims returns a ResourceClaimInformer.
|
||||
ResourceClaims() ResourceClaimInformer
|
||||
// ResourceClaimTemplates returns a ResourceClaimTemplateInformer.
|
||||
@@ -50,6 +52,11 @@ func (v *version) DeviceClasses() DeviceClassInformer {
|
||||
return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// DeviceTaintRules returns a DeviceTaintRuleInformer.
|
||||
func (v *version) DeviceTaintRules() DeviceTaintRuleInformer {
|
||||
return &deviceTaintRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceClaims returns a ResourceClaimInformer.
|
||||
func (v *version) ResourceClaims() ResourceClaimInformer {
|
||||
return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
|
||||
@@ -21,7 +21,7 @@ package scheduling
|
||||
import (
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
v1 "k8s.io/client-go/informers/scheduling/v1"
|
||||
v1alpha1 "k8s.io/client-go/informers/scheduling/v1alpha1"
|
||||
v1alpha2 "k8s.io/client-go/informers/scheduling/v1alpha2"
|
||||
v1beta1 "k8s.io/client-go/informers/scheduling/v1beta1"
|
||||
)
|
||||
|
||||
@@ -29,8 +29,8 @@ import (
|
||||
type Interface interface {
|
||||
// V1 provides access to shared informers for resources in V1.
|
||||
V1() v1.Interface
|
||||
// V1alpha1 provides access to shared informers for resources in V1alpha1.
|
||||
V1alpha1() v1alpha1.Interface
|
||||
// V1alpha2 provides access to shared informers for resources in V1alpha2.
|
||||
V1alpha2() v1alpha2.Interface
|
||||
// V1beta1 provides access to shared informers for resources in V1beta1.
|
||||
V1beta1() v1beta1.Interface
|
||||
}
|
||||
@@ -51,9 +51,9 @@ func (g *group) V1() v1.Interface {
|
||||
return v1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1alpha1 returns a new v1alpha1.Interface.
|
||||
func (g *group) V1alpha1() v1alpha1.Interface {
|
||||
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
// V1alpha2 returns a new v1alpha2.Interface.
|
||||
func (g *group) V1alpha2() v1alpha2.Interface {
|
||||
return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1beta1 returns a new v1beta1.Interface.
|
||||
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
@@ -24,8 +24,8 @@ import (
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// PriorityClasses returns a PriorityClassInformer.
|
||||
PriorityClasses() PriorityClassInformer
|
||||
// PodGroups returns a PodGroupInformer.
|
||||
PodGroups() PodGroupInformer
|
||||
// Workloads returns a WorkloadInformer.
|
||||
Workloads() WorkloadInformer
|
||||
}
|
||||
@@ -41,9 +41,9 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// PriorityClasses returns a PriorityClassInformer.
|
||||
func (v *version) PriorityClasses() PriorityClassInformer {
|
||||
return &priorityClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
// PodGroups returns a PodGroupInformer.
|
||||
func (v *version) PodGroups() PodGroupInformer {
|
||||
return &podGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// Workloads returns a WorkloadInformer.
|
||||
@@ -16,54 +16,55 @@ limitations under the License.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apischedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
apischedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
schedulingv1alpha1 "k8s.io/client-go/listers/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/client-go/listers/scheduling/v1alpha2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PriorityClassInformer provides access to a shared informer and lister for
|
||||
// PriorityClasses.
|
||||
type PriorityClassInformer interface {
|
||||
// PodGroupInformer provides access to a shared informer and lister for
|
||||
// PodGroups.
|
||||
type PodGroupInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() schedulingv1alpha1.PriorityClassLister
|
||||
Lister() schedulingv1alpha2.PodGroupLister
|
||||
}
|
||||
|
||||
type priorityClassInformer struct {
|
||||
type podGroupInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewPriorityClassInformer constructs a new informer for PriorityClass type.
|
||||
// NewPodGroupInformer constructs a new informer for PodGroup type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers})
|
||||
func NewPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers})
|
||||
}
|
||||
|
||||
// NewFilteredPriorityClassInformer constructs a new informer for PriorityClass type.
|
||||
// NewFilteredPodGroupInformer constructs a new informer for PodGroup type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions})
|
||||
func NewFilteredPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return NewPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions})
|
||||
}
|
||||
|
||||
// NewPriorityClassInformerWithOptions constructs a new informer for PriorityClass type with additional options.
|
||||
// NewPodGroupInformerWithOptions constructs a new informer for PodGroup type with additional options.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha1", Resource: "priorityclasss"}
|
||||
func NewPodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha2", Resource: "podgroups"}
|
||||
identifier := options.InformerName.WithResource(gvr)
|
||||
tweakListOptions := options.TweakListOptions
|
||||
return cache.NewSharedIndexInformerWithOptions(
|
||||
@@ -72,28 +73,28 @@ func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options in
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().PriorityClasses().List(context.Background(), opts)
|
||||
return client.SchedulingV1alpha2().PodGroups(namespace).List(context.Background(), opts)
|
||||
},
|
||||
WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().PriorityClasses().Watch(context.Background(), opts)
|
||||
return client.SchedulingV1alpha2().PodGroups(namespace).Watch(context.Background(), opts)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().PriorityClasses().List(ctx, opts)
|
||||
return client.SchedulingV1alpha2().PodGroups(namespace).List(ctx, opts)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().PriorityClasses().Watch(ctx, opts)
|
||||
return client.SchedulingV1alpha2().PodGroups(namespace).Watch(ctx, opts)
|
||||
},
|
||||
}, client),
|
||||
&apischedulingv1alpha1.PriorityClass{},
|
||||
&apischedulingv1alpha2.PodGroup{},
|
||||
cache.SharedIndexInformerOptions{
|
||||
ResyncPeriod: options.ResyncPeriod,
|
||||
Indexers: options.Indexers,
|
||||
@@ -102,14 +103,14 @@ func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options in
|
||||
)
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions})
|
||||
func (f *podGroupInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPodGroupInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions})
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apischedulingv1alpha1.PriorityClass{}, f.defaultInformer)
|
||||
func (f *podGroupInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apischedulingv1alpha2.PodGroup{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Lister() schedulingv1alpha1.PriorityClassLister {
|
||||
return schedulingv1alpha1.NewPriorityClassLister(f.Informer().GetIndexer())
|
||||
func (f *podGroupInformer) Lister() schedulingv1alpha2.PodGroupLister {
|
||||
return schedulingv1alpha2.NewPodGroupLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -16,20 +16,20 @@ limitations under the License.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apischedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
apischedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
schedulingv1alpha1 "k8s.io/client-go/listers/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/client-go/listers/scheduling/v1alpha2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@ import (
|
||||
// Workloads.
|
||||
type WorkloadInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() schedulingv1alpha1.WorkloadLister
|
||||
Lister() schedulingv1alpha2.WorkloadLister
|
||||
}
|
||||
|
||||
type workloadInformer struct {
|
||||
@@ -64,7 +64,7 @@ func NewFilteredWorkloadInformer(client kubernetes.Interface, namespace string,
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewWorkloadInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha1", Resource: "workloads"}
|
||||
gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha2", Resource: "workloads"}
|
||||
identifier := options.InformerName.WithResource(gvr)
|
||||
tweakListOptions := options.TweakListOptions
|
||||
return cache.NewSharedIndexInformerWithOptions(
|
||||
@@ -73,28 +73,28 @@ func NewWorkloadInformerWithOptions(client kubernetes.Interface, namespace strin
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().Workloads(namespace).List(context.Background(), opts)
|
||||
return client.SchedulingV1alpha2().Workloads(namespace).List(context.Background(), opts)
|
||||
},
|
||||
WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().Workloads(namespace).Watch(context.Background(), opts)
|
||||
return client.SchedulingV1alpha2().Workloads(namespace).Watch(context.Background(), opts)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().Workloads(namespace).List(ctx, opts)
|
||||
return client.SchedulingV1alpha2().Workloads(namespace).List(ctx, opts)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.SchedulingV1alpha1().Workloads(namespace).Watch(ctx, opts)
|
||||
return client.SchedulingV1alpha2().Workloads(namespace).Watch(ctx, opts)
|
||||
},
|
||||
}, client),
|
||||
&apischedulingv1alpha1.Workload{},
|
||||
&apischedulingv1alpha2.Workload{},
|
||||
cache.SharedIndexInformerOptions{
|
||||
ResyncPeriod: options.ResyncPeriod,
|
||||
Indexers: options.Indexers,
|
||||
@@ -108,9 +108,9 @@ func (f *workloadInformer) defaultInformer(client kubernetes.Interface, resyncPe
|
||||
}
|
||||
|
||||
func (f *workloadInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apischedulingv1alpha1.Workload{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apischedulingv1alpha2.Workload{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *workloadInformer) Lister() schedulingv1alpha1.WorkloadLister {
|
||||
return schedulingv1alpha1.NewWorkloadLister(f.Informer().GetIndexer())
|
||||
func (f *workloadInformer) Lister() schedulingv1alpha2.WorkloadLister {
|
||||
return schedulingv1alpha2.NewWorkloadLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -70,7 +70,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1"
|
||||
storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1"
|
||||
@@ -128,7 +128,7 @@ type Interface interface {
|
||||
ResourceV1beta2() resourcev1beta2.ResourceV1beta2Interface
|
||||
ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface
|
||||
ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface
|
||||
SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface
|
||||
SchedulingV1alpha2() schedulingv1alpha2.SchedulingV1alpha2Interface
|
||||
SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface
|
||||
SchedulingV1() schedulingv1.SchedulingV1Interface
|
||||
StorageV1beta1() storagev1beta1.StorageV1beta1Interface
|
||||
@@ -186,7 +186,7 @@ type Clientset struct {
|
||||
resourceV1beta2 *resourcev1beta2.ResourceV1beta2Client
|
||||
resourceV1beta1 *resourcev1beta1.ResourceV1beta1Client
|
||||
resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client
|
||||
schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client
|
||||
schedulingV1alpha2 *schedulingv1alpha2.SchedulingV1alpha2Client
|
||||
schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client
|
||||
schedulingV1 *schedulingv1.SchedulingV1Client
|
||||
storageV1beta1 *storagev1beta1.StorageV1beta1Client
|
||||
@@ -425,9 +425,9 @@ func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interfac
|
||||
return c.resourceV1alpha3
|
||||
}
|
||||
|
||||
// SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client
|
||||
func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface {
|
||||
return c.schedulingV1alpha1
|
||||
// SchedulingV1alpha2 retrieves the SchedulingV1alpha2Client
|
||||
func (c *Clientset) SchedulingV1alpha2() schedulingv1alpha2.SchedulingV1alpha2Interface {
|
||||
return c.schedulingV1alpha2
|
||||
}
|
||||
|
||||
// SchedulingV1beta1 retrieves the SchedulingV1beta1Client
|
||||
@@ -688,7 +688,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.schedulingV1alpha1, err = schedulingv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
cs.schedulingV1alpha2, err = schedulingv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -783,7 +783,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.resourceV1beta2 = resourcev1beta2.New(c)
|
||||
cs.resourceV1beta1 = resourcev1beta1.New(c)
|
||||
cs.resourceV1alpha3 = resourcev1alpha3.New(c)
|
||||
cs.schedulingV1alpha1 = schedulingv1alpha1.New(c)
|
||||
cs.schedulingV1alpha2 = schedulingv1alpha2.New(c)
|
||||
cs.schedulingV1beta1 = schedulingv1beta1.New(c)
|
||||
cs.schedulingV1 = schedulingv1.New(c)
|
||||
cs.storageV1beta1 = storagev1beta1.New(c)
|
||||
|
||||
@@ -120,8 +120,8 @@ import (
|
||||
fakeresourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake"
|
||||
schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1"
|
||||
fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake"
|
||||
schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1"
|
||||
fakeschedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake"
|
||||
schedulingv1alpha2 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2"
|
||||
fakeschedulingv1alpha2 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/fake"
|
||||
schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1"
|
||||
fakeschedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake"
|
||||
storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1"
|
||||
@@ -470,9 +470,9 @@ func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interfac
|
||||
return &fakeresourcev1alpha3.FakeResourceV1alpha3{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client
|
||||
func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface {
|
||||
return &fakeschedulingv1alpha1.FakeSchedulingV1alpha1{Fake: &c.Fake}
|
||||
// SchedulingV1alpha2 retrieves the SchedulingV1alpha2Client
|
||||
func (c *Clientset) SchedulingV1alpha2() schedulingv1alpha2.SchedulingV1alpha2Interface {
|
||||
return &fakeschedulingv1alpha2.FakeSchedulingV1alpha2{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// SchedulingV1beta1 retrieves the SchedulingV1beta1Client
|
||||
|
||||
@@ -66,7 +66,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
@@ -129,7 +129,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
resourcev1beta2.AddToScheme,
|
||||
resourcev1beta1.AddToScheme,
|
||||
resourcev1alpha3.AddToScheme,
|
||||
schedulingv1alpha1.AddToScheme,
|
||||
schedulingv1alpha2.AddToScheme,
|
||||
schedulingv1beta1.AddToScheme,
|
||||
schedulingv1.AddToScheme,
|
||||
storagev1beta1.AddToScheme,
|
||||
|
||||
@@ -66,7 +66,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
@@ -129,7 +129,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
resourcev1beta2.AddToScheme,
|
||||
resourcev1beta1.AddToScheme,
|
||||
resourcev1alpha3.AddToScheme,
|
||||
schedulingv1alpha1.AddToScheme,
|
||||
schedulingv1alpha2.AddToScheme,
|
||||
schedulingv1beta1.AddToScheme,
|
||||
schedulingv1.AddToScheme,
|
||||
storagev1beta1.AddToScheme,
|
||||
|
||||
@@ -17,16 +17,17 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
policyv1 "k8s.io/api/policy/v1"
|
||||
policyv1beta1 "k8s.io/api/policy/v1beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
fakerest "k8s.io/client-go/rest/fake"
|
||||
@@ -63,12 +64,26 @@ func (c *fakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Requ
|
||||
action.Subresource = "log"
|
||||
action.Value = opts
|
||||
|
||||
_, _ = c.Fake.Invokes(action, &v1.Pod{})
|
||||
defaultLogResponse := &runtime.Unknown{Raw: []byte("fake logs")}
|
||||
obj, err := c.Fake.Invokes(action, defaultLogResponse)
|
||||
logs := defaultLogResponse.Raw
|
||||
if err == nil {
|
||||
unknown, ok := obj.(*runtime.Unknown)
|
||||
if !ok || unknown == nil {
|
||||
err = fmt.Errorf("fake Pods.GetLogs expected reactor to return *runtime.Unknown, got %T", obj)
|
||||
} else {
|
||||
logs = unknown.Raw
|
||||
}
|
||||
}
|
||||
|
||||
fakeClient := &fakerest.RESTClient{
|
||||
Client: fakerest.CreateHTTPClient(func(request *http.Request) (*http.Response, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp := &http.Response{
|
||||
StatusCode: http.StatusOK,
|
||||
Body: io.NopCloser(strings.NewReader("fake logs")),
|
||||
Body: io.NopCloser(bytes.NewReader(logs)),
|
||||
}
|
||||
return resp, nil
|
||||
}),
|
||||
|
||||
@@ -19,10 +19,13 @@ package fake
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
cgtesting "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
@@ -46,3 +49,74 @@ func TestFakePodsGetLogs(t *testing.T) {
|
||||
t.Fatal("Close response body:", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFakePodsGetLogsReactorError(t *testing.T) {
|
||||
fake := &cgtesting.Fake{}
|
||||
fp := newFakePods(&FakeCoreV1{Fake: fake}, "default")
|
||||
expectedErr := errors.New("reactor get logs failure")
|
||||
fake.PrependReactor("get", "pods/log", func(action cgtesting.Action) (bool, runtime.Object, error) {
|
||||
genericAction, ok := action.(cgtesting.GenericAction)
|
||||
if !ok {
|
||||
t.Fatalf("expected GenericAction, got %T", action)
|
||||
}
|
||||
opts, ok := genericAction.GetValue().(*corev1.PodLogOptions)
|
||||
if !ok {
|
||||
t.Fatalf("expected *corev1.PodLogOptions, got %T", genericAction.GetValue())
|
||||
}
|
||||
if opts.Container != "ctr" {
|
||||
t.Fatalf("expected container ctr, got %q", opts.Container)
|
||||
}
|
||||
return true, nil, expectedErr
|
||||
})
|
||||
|
||||
req := fp.GetLogs("foo", &corev1.PodLogOptions{Container: "ctr"})
|
||||
_, err := req.Stream(context.Background())
|
||||
if !errors.Is(err, expectedErr) {
|
||||
t.Fatalf("expected stream error %v, got %v", expectedErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFakePodsGetLogsReactorResponse(t *testing.T) {
|
||||
fake := &cgtesting.Fake{}
|
||||
fp := newFakePods(&FakeCoreV1{Fake: fake}, "default")
|
||||
expectedLogs := "reactor logs"
|
||||
fake.PrependReactor("get", "pods/log", func(action cgtesting.Action) (bool, runtime.Object, error) {
|
||||
return true, &runtime.Unknown{Raw: []byte(expectedLogs)}, nil
|
||||
})
|
||||
|
||||
req := fp.GetLogs("foo", &corev1.PodLogOptions{})
|
||||
body, err := req.Stream(context.Background())
|
||||
if err != nil {
|
||||
t.Fatalf("Stream pod logs: %v", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := body.Close(); err != nil {
|
||||
t.Fatalf("Close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
logs, err := io.ReadAll(body)
|
||||
if err != nil {
|
||||
t.Fatalf("Read pod logs: %v", err)
|
||||
}
|
||||
if string(logs) != expectedLogs {
|
||||
t.Fatalf("expected logs %q, got %q", expectedLogs, string(logs))
|
||||
}
|
||||
}
|
||||
|
||||
func TestFakePodsGetLogsReactorInvalidObject(t *testing.T) {
|
||||
fake := &cgtesting.Fake{}
|
||||
fp := newFakePods(&FakeCoreV1{Fake: fake}, "default")
|
||||
fake.PrependReactor("get", "pods/log", func(action cgtesting.Action) (bool, runtime.Object, error) {
|
||||
return true, &corev1.Pod{}, nil
|
||||
})
|
||||
|
||||
req := fp.GetLogs("foo", &corev1.PodLogOptions{})
|
||||
_, err := req.Stream(context.Background())
|
||||
if err == nil {
|
||||
t.Fatal("expected stream error")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "expected reactor to return *runtime.Unknown") {
|
||||
t.Fatalf("expected helpful reactor object type error, got: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,10 @@ func (c *FakeResourceV1alpha3) DeviceTaintRules() v1alpha3.DeviceTaintRuleInterf
|
||||
return newFakeDeviceTaintRules(c)
|
||||
}
|
||||
|
||||
func (c *FakeResourceV1alpha3) ResourcePoolStatusRequests() v1alpha3.ResourcePoolStatusRequestInterface {
|
||||
return newFakeResourcePoolStatusRequests(c)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeResourceV1alpha3) RESTClient() rest.Interface {
|
||||
|
||||
@@ -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 client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3"
|
||||
)
|
||||
|
||||
// fakeResourcePoolStatusRequests implements ResourcePoolStatusRequestInterface
|
||||
type fakeResourcePoolStatusRequests struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1alpha3.ResourcePoolStatusRequest, *v1alpha3.ResourcePoolStatusRequestList, *resourcev1alpha3.ResourcePoolStatusRequestApplyConfiguration]
|
||||
Fake *FakeResourceV1alpha3
|
||||
}
|
||||
|
||||
func newFakeResourcePoolStatusRequests(fake *FakeResourceV1alpha3) typedresourcev1alpha3.ResourcePoolStatusRequestInterface {
|
||||
return &fakeResourcePoolStatusRequests{
|
||||
gentype.NewFakeClientWithListAndApply[*v1alpha3.ResourcePoolStatusRequest, *v1alpha3.ResourcePoolStatusRequestList, *resourcev1alpha3.ResourcePoolStatusRequestApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha3.SchemeGroupVersion.WithResource("resourcepoolstatusrequests"),
|
||||
v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequest"),
|
||||
func() *v1alpha3.ResourcePoolStatusRequest { return &v1alpha3.ResourcePoolStatusRequest{} },
|
||||
func() *v1alpha3.ResourcePoolStatusRequestList { return &v1alpha3.ResourcePoolStatusRequestList{} },
|
||||
func(dst, src *v1alpha3.ResourcePoolStatusRequestList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha3.ResourcePoolStatusRequestList) []*v1alpha3.ResourcePoolStatusRequest {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha3.ResourcePoolStatusRequestList, items []*v1alpha3.ResourcePoolStatusRequest) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
}
|
||||
@@ -19,3 +19,5 @@ limitations under the License.
|
||||
package v1alpha3
|
||||
|
||||
type DeviceTaintRuleExpansion interface{}
|
||||
|
||||
type ResourcePoolStatusRequestExpansion interface{}
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
type ResourceV1alpha3Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
DeviceTaintRulesGetter
|
||||
ResourcePoolStatusRequestsGetter
|
||||
}
|
||||
|
||||
// ResourceV1alpha3Client is used to interact with features provided by the resource.k8s.io group.
|
||||
@@ -40,6 +41,10 @@ func (c *ResourceV1alpha3Client) DeviceTaintRules() DeviceTaintRuleInterface {
|
||||
return newDeviceTaintRules(c)
|
||||
}
|
||||
|
||||
func (c *ResourceV1alpha3Client) ResourcePoolStatusRequests() ResourcePoolStatusRequestInterface {
|
||||
return newResourcePoolStatusRequests(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new ResourceV1alpha3Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user