Files
cozystack/api/gpu/v1alpha1/zz_generated.deepcopy.go
Aleksei Sviridkin 18a3ce5a24 feat(api): add gpu.cozystack.io GPUClass, GPUDevice and GPUNode
GPUs become a catalog of hoster offers, tenant reservations against
them and a per-node inventory, so a tenant can hold a GPU while its VM
is off and an order that does not fit is refused at create time.

The CRDs enforce what the apiserver alone can: a class name is a DNS
label other than total because it becomes part of a quota key, the
source is a union with dra reserved for a later member, a device's
spec is immutable and orders at least one GPU, and bound devices are
listable per node through a field selector on status.nodeName. A
class resource name must be a valid extended resource outside
gpu.cozystack.io, where it would read as a GPU budget key. The CRDs
are kept on chart uninstall, since they ship as plain templates and
deleting GPUDevice would drop every hold and usage record.

maxCount carries no schema default: it defaults to 1 for vgpu classes
and to no limit for passthrough, which a structural default cannot
express, so readers resolve it through the shared model.

A GPUNode device reports how many device-plugin devices kubelet
counts as allocatable for it, because an mdev parent serves several
from one PCI function and one healthy entry per function would
undercount the node.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-10-21 03:04:35 +03:00

469 lines
13 KiB
Go
Generated

//go:build !ignore_autogenerated
/*
Copyright 2025 The Cozystack 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 controller-gen. DO NOT EDIT.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BindRequest) DeepCopyInto(out *BindRequest) {
*out = *in
if in.Devices != nil {
in, out := &in.Devices, &out.Devices
*out = make([]string, len(*in))
copy(*out, *in)
}
in.RequestedAt.DeepCopyInto(&out.RequestedAt)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindRequest.
func (in *BindRequest) DeepCopy() *BindRequest {
if in == nil {
return nil
}
out := new(BindRequest)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DevicePluginSource) DeepCopyInto(out *DevicePluginSource) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicePluginSource.
func (in *DevicePluginSource) DeepCopy() *DevicePluginSource {
if in == nil {
return nil
}
out := new(DevicePluginSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUClass) DeepCopyInto(out *GPUClass) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUClass.
func (in *GPUClass) DeepCopy() *GPUClass {
if in == nil {
return nil
}
out := new(GPUClass)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GPUClass) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUClassList) DeepCopyInto(out *GPUClassList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]GPUClass, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUClassList.
func (in *GPUClassList) DeepCopy() *GPUClassList {
if in == nil {
return nil
}
out := new(GPUClassList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GPUClassList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUClassSource) DeepCopyInto(out *GPUClassSource) {
*out = *in
if in.DevicePlugin != nil {
in, out := &in.DevicePlugin, &out.DevicePlugin
*out = new(DevicePluginSource)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUClassSource.
func (in *GPUClassSource) DeepCopy() *GPUClassSource {
if in == nil {
return nil
}
out := new(GPUClassSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUClassSpec) DeepCopyInto(out *GPUClassSpec) {
*out = *in
if in.Memory != nil {
in, out := &in.Memory, &out.Memory
x := (*in).DeepCopy()
*out = &x
}
if in.MaxCount != nil {
in, out := &in.MaxCount, &out.MaxCount
*out = new(int32)
**out = **in
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
in.Source.DeepCopyInto(&out.Source)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUClassSpec.
func (in *GPUClassSpec) DeepCopy() *GPUClassSpec {
if in == nil {
return nil
}
out := new(GPUClassSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUClassStatus) DeepCopyInto(out *GPUClassStatus) {
*out = *in
if in.Free != nil {
in, out := &in.Free, &out.Free
*out = new(int32)
**out = **in
}
if in.MaxFreePerNode != nil {
in, out := &in.MaxFreePerNode, &out.MaxFreePerNode
*out = new(int32)
**out = **in
}
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUClassStatus.
func (in *GPUClassStatus) DeepCopy() *GPUClassStatus {
if in == nil {
return nil
}
out := new(GPUClassStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUDevice) DeepCopyInto(out *GPUDevice) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUDevice.
func (in *GPUDevice) DeepCopy() *GPUDevice {
if in == nil {
return nil
}
out := new(GPUDevice)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GPUDevice) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUDeviceAttachment) DeepCopyInto(out *GPUDeviceAttachment) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUDeviceAttachment.
func (in *GPUDeviceAttachment) DeepCopy() *GPUDeviceAttachment {
if in == nil {
return nil
}
out := new(GPUDeviceAttachment)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUDeviceList) DeepCopyInto(out *GPUDeviceList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]GPUDevice, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUDeviceList.
func (in *GPUDeviceList) DeepCopy() *GPUDeviceList {
if in == nil {
return nil
}
out := new(GPUDeviceList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GPUDeviceList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUDeviceSpec) DeepCopyInto(out *GPUDeviceSpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUDeviceSpec.
func (in *GPUDeviceSpec) DeepCopy() *GPUDeviceSpec {
if in == nil {
return nil
}
out := new(GPUDeviceSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUDeviceStatus) DeepCopyInto(out *GPUDeviceStatus) {
*out = *in
if in.AttachedTo != nil {
in, out := &in.AttachedTo, &out.AttachedTo
*out = new(GPUDeviceAttachment)
**out = **in
}
if in.BoundAt != nil {
in, out := &in.BoundAt, &out.BoundAt
*out = (*in).DeepCopy()
}
if in.BindRequest != nil {
in, out := &in.BindRequest, &out.BindRequest
*out = new(BindRequest)
(*in).DeepCopyInto(*out)
}
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUDeviceStatus.
func (in *GPUDeviceStatus) DeepCopy() *GPUDeviceStatus {
if in == nil {
return nil
}
out := new(GPUDeviceStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUNode) DeepCopyInto(out *GPUNode) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUNode.
func (in *GPUNode) DeepCopy() *GPUNode {
if in == nil {
return nil
}
out := new(GPUNode)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GPUNode) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUNodeDevice) DeepCopyInto(out *GPUNodeDevice) {
*out = *in
if in.Healthy != nil {
in, out := &in.Healthy, &out.Healthy
*out = new(bool)
**out = **in
}
if in.Allocatable != nil {
in, out := &in.Allocatable, &out.Allocatable
*out = new(int32)
**out = **in
}
if in.UsedBy != nil {
in, out := &in.UsedBy, &out.UsedBy
*out = new(GPUPodReference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUNodeDevice.
func (in *GPUNodeDevice) DeepCopy() *GPUNodeDevice {
if in == nil {
return nil
}
out := new(GPUNodeDevice)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUNodeList) DeepCopyInto(out *GPUNodeList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]GPUNode, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUNodeList.
func (in *GPUNodeList) DeepCopy() *GPUNodeList {
if in == nil {
return nil
}
out := new(GPUNodeList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GPUNodeList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUNodeStatus) DeepCopyInto(out *GPUNodeStatus) {
*out = *in
if in.Devices != nil {
in, out := &in.Devices, &out.Devices
*out = make([]GPUNodeDevice, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.ResourceNames != nil {
in, out := &in.ResourceNames, &out.ResourceNames
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUNodeStatus.
func (in *GPUNodeStatus) DeepCopy() *GPUNodeStatus {
if in == nil {
return nil
}
out := new(GPUNodeStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GPUPodReference) DeepCopyInto(out *GPUPodReference) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPUPodReference.
func (in *GPUPodReference) DeepCopy() *GPUPodReference {
if in == nil {
return nil
}
out := new(GPUPodReference)
in.DeepCopyInto(out)
return out
}