updated vendor
This commit is contained in:
+641
@@ -25,6 +25,7 @@ import (
|
||||
io "io"
|
||||
"sort"
|
||||
|
||||
k8s_io_api_core_v1 "k8s.io/api/core/v1"
|
||||
v11 "k8s.io/api/core/v1"
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -97,6 +98,8 @@ func (m *ExactDeviceRequest) Reset() { *m = ExactDeviceRequest{} }
|
||||
|
||||
func (m *NetworkDeviceData) Reset() { *m = NetworkDeviceData{} }
|
||||
|
||||
func (m *NodeAllocatableResourceMapping) Reset() { *m = NodeAllocatableResourceMapping{} }
|
||||
|
||||
func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} }
|
||||
|
||||
func (m *ResourceClaim) Reset() { *m = ResourceClaim{} }
|
||||
@@ -573,6 +576,35 @@ func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.NodeAllocatableResourceMappings) > 0 {
|
||||
keysForNodeAllocatableResourceMappings := make([]string, 0, len(m.NodeAllocatableResourceMappings))
|
||||
for k := range m.NodeAllocatableResourceMappings {
|
||||
keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k))
|
||||
}
|
||||
sort.Strings(keysForNodeAllocatableResourceMappings)
|
||||
for iNdEx := len(keysForNodeAllocatableResourceMappings) - 1; iNdEx >= 0; iNdEx-- {
|
||||
v := m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResourceMappings[iNdEx])]
|
||||
baseI := i
|
||||
{
|
||||
size, err := (&v).MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
i -= len(keysForNodeAllocatableResourceMappings[iNdEx])
|
||||
copy(dAtA[i:], keysForNodeAllocatableResourceMappings[iNdEx])
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResourceMappings[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
|
||||
i--
|
||||
dAtA[i] = 0x6a
|
||||
}
|
||||
}
|
||||
if m.AllowMultipleAllocations != nil {
|
||||
i--
|
||||
if *m.AllowMultipleAllocations {
|
||||
@@ -852,6 +884,43 @@ func (m *DeviceAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.VersionValues) > 0 {
|
||||
for iNdEx := len(m.VersionValues) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.VersionValues[iNdEx])
|
||||
copy(dAtA[i:], m.VersionValues[iNdEx])
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(len(m.VersionValues[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x4a
|
||||
}
|
||||
}
|
||||
if len(m.StringValues) > 0 {
|
||||
for iNdEx := len(m.StringValues) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.StringValues[iNdEx])
|
||||
copy(dAtA[i:], m.StringValues[iNdEx])
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(len(m.StringValues[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x42
|
||||
}
|
||||
}
|
||||
if len(m.BoolValues) > 0 {
|
||||
for iNdEx := len(m.BoolValues) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i--
|
||||
if m.BoolValues[iNdEx] {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x38
|
||||
}
|
||||
}
|
||||
if len(m.IntValues) > 0 {
|
||||
for iNdEx := len(m.IntValues) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(m.IntValues[iNdEx]))
|
||||
i--
|
||||
dAtA[i] = 0x30
|
||||
}
|
||||
}
|
||||
if m.VersionValue != nil {
|
||||
i -= len(*m.VersionValue)
|
||||
copy(dAtA[i:], *m.VersionValue)
|
||||
@@ -1872,6 +1941,48 @@ func (m *NetworkDeviceData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *NodeAllocatableResourceMapping) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *NodeAllocatableResourceMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.AllocationMultiplier != nil {
|
||||
{
|
||||
size, err := m.AllocationMultiplier.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.CapacityKey != nil {
|
||||
i -= len(*m.CapacityKey)
|
||||
copy(dAtA[i:], *m.CapacityKey)
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(len(*m.CapacityKey)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
@@ -2745,6 +2856,15 @@ func (m *Device) Size() (n int) {
|
||||
if m.AllowMultipleAllocations != nil {
|
||||
n += 2
|
||||
}
|
||||
if len(m.NodeAllocatableResourceMappings) > 0 {
|
||||
for k, v := range m.NodeAllocatableResourceMappings {
|
||||
_ = k
|
||||
_ = v
|
||||
l = v.Size()
|
||||
mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l))
|
||||
n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -2808,6 +2928,26 @@ func (m *DeviceAttribute) Size() (n int) {
|
||||
l = len(*m.VersionValue)
|
||||
n += 1 + l + sovGenerated(uint64(l))
|
||||
}
|
||||
if len(m.IntValues) > 0 {
|
||||
for _, e := range m.IntValues {
|
||||
n += 1 + sovGenerated(uint64(e))
|
||||
}
|
||||
}
|
||||
if len(m.BoolValues) > 0 {
|
||||
n += 2 * len(m.BoolValues)
|
||||
}
|
||||
if len(m.StringValues) > 0 {
|
||||
for _, s := range m.StringValues {
|
||||
l = len(s)
|
||||
n += 1 + l + sovGenerated(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(m.VersionValues) > 0 {
|
||||
for _, s := range m.VersionValues {
|
||||
l = len(s)
|
||||
n += 1 + l + sovGenerated(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -3200,6 +3340,23 @@ func (m *NetworkDeviceData) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *NodeAllocatableResourceMapping) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.CapacityKey != nil {
|
||||
l = len(*m.CapacityKey)
|
||||
n += 1 + l + sovGenerated(uint64(l))
|
||||
}
|
||||
if m.AllocationMultiplier != nil {
|
||||
l = m.AllocationMultiplier.Size()
|
||||
n += 1 + l + sovGenerated(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *OpaqueDeviceConfiguration) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@@ -3586,6 +3743,16 @@ func (this *Device) String() string {
|
||||
mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[QualifiedName(k)])
|
||||
}
|
||||
mapStringForCapacity += "}"
|
||||
keysForNodeAllocatableResourceMappings := make([]string, 0, len(this.NodeAllocatableResourceMappings))
|
||||
for k := range this.NodeAllocatableResourceMappings {
|
||||
keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k))
|
||||
}
|
||||
sort.Strings(keysForNodeAllocatableResourceMappings)
|
||||
mapStringForNodeAllocatableResourceMappings := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping{"
|
||||
for _, k := range keysForNodeAllocatableResourceMappings {
|
||||
mapStringForNodeAllocatableResourceMappings += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(k)])
|
||||
}
|
||||
mapStringForNodeAllocatableResourceMappings += "}"
|
||||
s := strings.Join([]string{`&Device{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Attributes:` + mapStringForAttributes + `,`,
|
||||
@@ -3599,6 +3766,7 @@ func (this *Device) String() string {
|
||||
`BindingConditions:` + fmt.Sprintf("%v", this.BindingConditions) + `,`,
|
||||
`BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`,
|
||||
`AllowMultipleAllocations:` + valueToStringGenerated(this.AllowMultipleAllocations) + `,`,
|
||||
`NodeAllocatableResourceMappings:` + mapStringForNodeAllocatableResourceMappings + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
@@ -3645,6 +3813,10 @@ func (this *DeviceAttribute) String() string {
|
||||
`BoolValue:` + valueToStringGenerated(this.BoolValue) + `,`,
|
||||
`StringValue:` + valueToStringGenerated(this.StringValue) + `,`,
|
||||
`VersionValue:` + valueToStringGenerated(this.VersionValue) + `,`,
|
||||
`IntValues:` + fmt.Sprintf("%v", this.IntValues) + `,`,
|
||||
`BoolValues:` + fmt.Sprintf("%v", this.BoolValues) + `,`,
|
||||
`StringValues:` + fmt.Sprintf("%v", this.StringValues) + `,`,
|
||||
`VersionValues:` + fmt.Sprintf("%v", this.VersionValues) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
@@ -3939,6 +4111,17 @@ func (this *NetworkDeviceData) String() string {
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *NodeAllocatableResourceMapping) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
s := strings.Join([]string{`&NodeAllocatableResourceMapping{`,
|
||||
`CapacityKey:` + valueToStringGenerated(this.CapacityKey) + `,`,
|
||||
`AllocationMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.AllocationMultiplier), "Quantity", "resource.Quantity", 1) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
}
|
||||
func (this *OpaqueDeviceConfiguration) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
@@ -6027,6 +6210,135 @@ func (m *Device) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := bool(v != 0)
|
||||
m.AllowMultipleAllocations = &b
|
||||
case 13:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResourceMappings", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.NodeAllocatableResourceMappings == nil {
|
||||
m.NodeAllocatableResourceMappings = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping)
|
||||
}
|
||||
var mapkey k8s_io_api_core_v1.ResourceName
|
||||
mapvalue := &NodeAllocatableResourceMapping{}
|
||||
for iNdEx < postIndex {
|
||||
entryPreIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
if fieldNum == 1 {
|
||||
var stringLenmapkey uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLenmapkey |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapkey := int(stringLenmapkey)
|
||||
if intStringLenmapkey < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||||
if postStringIndexmapkey < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postStringIndexmapkey > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapkey = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postStringIndexmapkey])
|
||||
iNdEx = postStringIndexmapkey
|
||||
} else if fieldNum == 2 {
|
||||
var mapmsglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
mapmsglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if mapmsglen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postmsgIndex := iNdEx + mapmsglen
|
||||
if postmsgIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postmsgIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapvalue = &NodeAllocatableResourceMapping{}
|
||||
if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postmsgIndex
|
||||
} else {
|
||||
iNdEx = entryPreIndex
|
||||
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if (iNdEx + skippy) > postIndex {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||
@@ -6449,6 +6761,216 @@ func (m *DeviceAttribute) Unmarshal(dAtA []byte) error {
|
||||
s := string(dAtA[iNdEx:postIndex])
|
||||
m.VersionValue = &s
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType == 0 {
|
||||
var v int64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.IntValues = append(m.IntValues, v)
|
||||
} else if wireType == 2 {
|
||||
var packedLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
packedLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if packedLen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + packedLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
var elementCount int
|
||||
var count int
|
||||
for _, integer := range dAtA[iNdEx:postIndex] {
|
||||
if integer < 128 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
elementCount = count
|
||||
if elementCount != 0 && len(m.IntValues) == 0 {
|
||||
m.IntValues = make([]int64, 0, elementCount)
|
||||
}
|
||||
for iNdEx < postIndex {
|
||||
var v int64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.IntValues = append(m.IntValues, v)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field IntValues", wireType)
|
||||
}
|
||||
case 7:
|
||||
if wireType == 0 {
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.BoolValues = append(m.BoolValues, bool(v != 0))
|
||||
} else if wireType == 2 {
|
||||
var packedLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
packedLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if packedLen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + packedLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
var elementCount int
|
||||
elementCount = packedLen
|
||||
if elementCount != 0 && len(m.BoolValues) == 0 {
|
||||
m.BoolValues = make([]bool, 0, elementCount)
|
||||
}
|
||||
for iNdEx < postIndex {
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.BoolValues = append(m.BoolValues, bool(v != 0))
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field BoolValues", wireType)
|
||||
}
|
||||
case 8:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field StringValues", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.StringValues = append(m.StringValues, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 9:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field VersionValues", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.VersionValues = append(m.VersionValues, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||
@@ -9518,6 +10040,125 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: NodeAllocatableResourceMapping: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: NodeAllocatableResourceMapping: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field CapacityKey", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
s := QualifiedName(dAtA[iNdEx:postIndex])
|
||||
m.CapacityKey = &s
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AllocationMultiplier", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.AllocationMultiplier == nil {
|
||||
m.AllocationMultiplier = &resource.Quantity{}
|
||||
}
|
||||
if err := m.AllocationMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthGenerated
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *OpaqueDeviceConfiguration) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
+267
-138
@@ -65,8 +65,8 @@ message AllocatedDeviceStatus {
|
||||
//
|
||||
// +optional
|
||||
// +featureGate=DRAConsumableCapacity
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-uuid
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
|
||||
optional string shareID = 7;
|
||||
|
||||
// Conditions contains the latest observation of the device's state.
|
||||
@@ -90,7 +90,7 @@ message AllocatedDeviceStatus {
|
||||
// NetworkData contains network-related information specific to the device.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional NetworkDeviceData networkData = 6;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ message AllocationResult {
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -169,6 +169,14 @@ message CELDeviceSelector {
|
||||
//
|
||||
// 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.
|
||||
@@ -307,8 +315,8 @@ message CounterSet {
|
||||
// It must be a DNS label.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-short-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
|
||||
optional string name = 1;
|
||||
|
||||
// Counters defines the set of counters for this CounterSet
|
||||
@@ -317,6 +325,8 @@ message CounterSet {
|
||||
// The maximum number of counters is 32.
|
||||
//
|
||||
// +required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
|
||||
map<string, Counter> counters = 2;
|
||||
}
|
||||
|
||||
@@ -335,6 +345,7 @@ message Device {
|
||||
// The maximum number of attributes and capacities combined is 32.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
map<string, DeviceAttribute> attributes = 2;
|
||||
|
||||
// Capacity defines the set of capacities for this device.
|
||||
@@ -355,13 +366,13 @@ message Device {
|
||||
// device is 2.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=counterSet
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
|
||||
// +featureGate=DRAPartitionableDevices
|
||||
// +k8s:maxItems=2
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
|
||||
repeated DeviceCounterConsumption consumesCounters = 4;
|
||||
|
||||
// NodeName identifies the node where the device is available.
|
||||
@@ -402,12 +413,13 @@ message Device {
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
repeated DeviceTaint taints = 8;
|
||||
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -415,7 +427,7 @@ message Device {
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -431,14 +443,14 @@ message Device {
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
repeated string bindingConditions = 10;
|
||||
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -449,14 +461,14 @@ message Device {
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
repeated string bindingFailureConditions = 11;
|
||||
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -467,6 +479,21 @@ message Device {
|
||||
// +optional
|
||||
// +featureGate=DRAConsumableCapacity
|
||||
optional bool allowMultipleAllocations = 12;
|
||||
|
||||
// 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.
|
||||
// +optional
|
||||
// +featureGate=DRANodeAllocatableResources
|
||||
map<string, NodeAllocatableResourceMapping> nodeAllocatableResourceMappings = 13;
|
||||
}
|
||||
|
||||
// DeviceAllocationConfiguration gets embedded in an AllocationResult.
|
||||
@@ -476,7 +503,7 @@ message DeviceAllocationConfiguration {
|
||||
// or from a claim.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
optional string source = 1;
|
||||
|
||||
// Requests lists the names of requests where the configuration applies.
|
||||
@@ -488,10 +515,10 @@ message DeviceAllocationConfiguration {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated string requests = 2;
|
||||
|
||||
optional DeviceConfiguration deviceConfiguration = 3;
|
||||
@@ -503,8 +530,8 @@ message DeviceAllocationResult {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceRequestAllocationResult results = 1;
|
||||
|
||||
// This field is a combination of all the claim and class configuration parameters.
|
||||
@@ -517,8 +544,8 @@ message DeviceAllocationResult {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=64
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
|
||||
repeated DeviceAllocationConfiguration config = 2;
|
||||
}
|
||||
|
||||
@@ -527,31 +554,79 @@ message DeviceAttribute {
|
||||
// IntValue is a number.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
optional int64 int = 2;
|
||||
|
||||
// BoolValue is a true/false value.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
optional bool bool = 3;
|
||||
|
||||
// StringValue is a string. Must not be longer than 64 characters.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
optional string string = 4;
|
||||
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
optional string version = 5;
|
||||
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
repeated int64 ints = 6;
|
||||
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
repeated bool bools = 7;
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
repeated string strings = 8;
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
repeated string versions = 9;
|
||||
}
|
||||
|
||||
// DeviceCapacity describes a quantity associated with a device.
|
||||
@@ -587,11 +662,11 @@ message DeviceClaim {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=name
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceRequest requests = 1;
|
||||
|
||||
// These constraints must be satisfied by the set of devices that get
|
||||
@@ -599,8 +674,8 @@ message DeviceClaim {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceConstraint constraints = 2;
|
||||
|
||||
// This field holds configuration for multiple potential drivers which
|
||||
@@ -609,8 +684,8 @@ message DeviceClaim {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceClaimConfiguration config = 3;
|
||||
}
|
||||
|
||||
@@ -625,10 +700,10 @@ message DeviceClaimConfiguration {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
optional DeviceConfiguration deviceConfiguration = 2;
|
||||
@@ -638,14 +713,11 @@ message DeviceClaimConfiguration {
|
||||
// device configuration and selectors. It can be referenced in
|
||||
// the device requests of a claim to apply these presets.
|
||||
// Cluster scoped.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
message DeviceClass {
|
||||
// Standard object metadata
|
||||
// +optional
|
||||
// +k8s:subfield(name)=+k8s:optional
|
||||
// +k8s:subfield(name)=+k8s:format=k8s-long-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
|
||||
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
|
||||
|
||||
// Spec defines what can be allocated and how to configure it.
|
||||
@@ -681,8 +753,8 @@ message DeviceClassSpec {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 1;
|
||||
|
||||
// Config defines configuration parameters that apply to each device that is claimed via this class.
|
||||
@@ -693,8 +765,8 @@ message DeviceClassSpec {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceClassConfiguration config = 2;
|
||||
|
||||
// ExtendedResourceName is the extended resource name for the devices of this class.
|
||||
@@ -706,11 +778,11 @@ message DeviceClassSpec {
|
||||
// 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.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-extended-resource-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
|
||||
optional string extendedResourceName = 4;
|
||||
}
|
||||
|
||||
@@ -722,7 +794,7 @@ message DeviceConfiguration {
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=ConfigurationType
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional OpaqueDeviceConfiguration opaque = 1;
|
||||
}
|
||||
|
||||
@@ -740,10 +812,10 @@ message DeviceConstraint {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated string requests = 1;
|
||||
|
||||
// MatchAttribute requires that all devices in question have this
|
||||
@@ -757,17 +829,27 @@ message DeviceConstraint {
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=ConstraintType
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-resource-fully-qualified-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
|
||||
optional string matchAttribute = 2;
|
||||
|
||||
// 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
|
||||
@@ -789,8 +871,8 @@ message DeviceCounterConsumption {
|
||||
// counters defined will be consumed.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-short-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
|
||||
optional string counterSet = 1;
|
||||
|
||||
// Counters defines the counters that will be consumed by the device.
|
||||
@@ -798,6 +880,8 @@ message DeviceCounterConsumption {
|
||||
// The maximum number of counters is 32.
|
||||
//
|
||||
// +required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
|
||||
map<string, Counter> counters = 2;
|
||||
}
|
||||
|
||||
@@ -827,7 +911,7 @@ message DeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=deviceRequestType
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional ExactDeviceRequest exactly = 2;
|
||||
|
||||
// FirstAvailable contains subrequests, of which exactly one will be
|
||||
@@ -848,11 +932,11 @@ message DeviceRequest {
|
||||
// +oneOf=deviceRequestType
|
||||
// +listType=atomic
|
||||
// +featureGate=DRAPrioritizedList
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=name
|
||||
// +k8s:maxItems=8
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
|
||||
repeated DeviceSubRequest firstAvailable = 3;
|
||||
}
|
||||
|
||||
@@ -877,8 +961,9 @@ message DeviceRequestAllocationResult {
|
||||
// vendor of the driver. It should use only lower case characters.
|
||||
//
|
||||
// +required
|
||||
// +k8s:format=k8s-long-name-caseless
|
||||
// +k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
|
||||
optional string driver = 2;
|
||||
|
||||
// This name together with the driver name and the device name field
|
||||
@@ -888,8 +973,8 @@ message DeviceRequestAllocationResult {
|
||||
// DNS sub-domains separated by slashes.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-resource-pool-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
|
||||
optional string pool = 3;
|
||||
|
||||
// Device references one device instance via its name in the driver's
|
||||
@@ -902,8 +987,7 @@ message DeviceRequestAllocationResult {
|
||||
// administrative access. See the corresponding request field
|
||||
// for a definition of mode.
|
||||
//
|
||||
// This is an alpha 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -915,38 +999,39 @@ message DeviceRequestAllocationResult {
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
repeated DeviceToleration tolerations = 6;
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
repeated string bindingConditions = 7;
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
repeated string bindingFailureConditions = 8;
|
||||
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
@@ -956,8 +1041,8 @@ message DeviceRequestAllocationResult {
|
||||
//
|
||||
// +optional
|
||||
// +featureGate=DRAConsumableCapacity
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-uuid
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
|
||||
optional string shareID = 9;
|
||||
|
||||
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
|
||||
@@ -1014,8 +1099,8 @@ message DeviceSubRequest {
|
||||
// to reference.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-long-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
|
||||
optional string deviceClassName = 2;
|
||||
|
||||
// Selectors define criteria which must be satisfied by a specific
|
||||
@@ -1025,8 +1110,8 @@ message DeviceSubRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 3;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -1048,6 +1133,7 @@ message DeviceSubRequest {
|
||||
// requests with unknown modes.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional string allocationMode = 4;
|
||||
|
||||
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
|
||||
@@ -1072,12 +1158,13 @@ message DeviceSubRequest {
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
repeated DeviceToleration tolerations = 6;
|
||||
|
||||
// Capacity define resource requirements against each capacity.
|
||||
@@ -1124,12 +1211,21 @@ message DeviceTaint {
|
||||
// Consumers must treat unknown effects like None.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
optional string effect = 3;
|
||||
|
||||
// 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).
|
||||
//
|
||||
// +optional
|
||||
optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4;
|
||||
}
|
||||
@@ -1142,8 +1238,8 @@ message DeviceToleration {
|
||||
// Must be a label name.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-label-key
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
|
||||
optional string key = 1;
|
||||
|
||||
// Operator represents a key's relationship to the value.
|
||||
@@ -1153,6 +1249,7 @@ message DeviceToleration {
|
||||
//
|
||||
// +optional
|
||||
// +default="Equal"
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional string operator = 2;
|
||||
|
||||
// Value is the taint value the toleration matches to.
|
||||
@@ -1166,6 +1263,7 @@ message DeviceToleration {
|
||||
// When specified, allowed values are NoSchedule and NoExecute.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional string effect = 4;
|
||||
|
||||
// TolerationSeconds represents the period of time the toleration (which must be
|
||||
@@ -1203,8 +1301,8 @@ message ExactDeviceRequest {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
repeated DeviceSelector selectors = 2;
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -1227,7 +1325,7 @@ message ExactDeviceRequest {
|
||||
// requests with unknown modes.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
optional string allocationMode = 3;
|
||||
|
||||
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
|
||||
@@ -1243,8 +1341,7 @@ message ExactDeviceRequest {
|
||||
// all ordinary claims to the device with respect to access modes and
|
||||
// any resource allocations.
|
||||
//
|
||||
// This is an alpha 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -1266,12 +1363,13 @@ message ExactDeviceRequest {
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
repeated DeviceToleration tolerations = 6;
|
||||
|
||||
// Capacity define resource requirements against each capacity.
|
||||
@@ -1300,11 +1398,11 @@ message NetworkDeviceData {
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:maxLength=256
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxBytes=256
|
||||
optional string interfaceName = 1;
|
||||
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
@@ -1315,22 +1413,60 @@ message NetworkDeviceData {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=16
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
|
||||
repeated string ips = 2;
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:maxLength=128
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxBytes=128
|
||||
optional string hardwareAddress = 3;
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity
|
||||
// units requested to the corresponding quantity of the node allocatable resource.
|
||||
message NodeAllocatableResourceMapping {
|
||||
// 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".
|
||||
// +optional
|
||||
optional string capacityKey = 1;
|
||||
|
||||
// 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.
|
||||
// +optional
|
||||
optional .k8s.io.apimachinery.pkg.api.resource.Quantity allocationMultiplier = 2;
|
||||
}
|
||||
|
||||
// OpaqueDeviceConfiguration contains configuration parameters for a driver
|
||||
// in a format defined by the driver vendor.
|
||||
message OpaqueDeviceConfiguration {
|
||||
@@ -1344,8 +1480,9 @@ message OpaqueDeviceConfiguration {
|
||||
// vendor of the driver. It should use only lower case characters.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-long-name-caseless
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
|
||||
optional string driver = 1;
|
||||
|
||||
// Parameters can contain arbitrary data. It is the responsibility of
|
||||
@@ -1364,9 +1501,6 @@ message OpaqueDeviceConfiguration {
|
||||
// with specific properties, this is how that request is expressed. The status
|
||||
// stanza tracks whether this claim has been satisfied and what specific
|
||||
// resources have been allocated.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
message ResourceClaim {
|
||||
// Standard object metadata
|
||||
// +optional
|
||||
@@ -1374,7 +1508,7 @@ message ResourceClaim {
|
||||
|
||||
// Spec describes what is being requested and how to configure it.
|
||||
// The spec is immutable.
|
||||
// +k8s:immutable
|
||||
// +k8s:alpha(since: "1.36")=+k8s:immutable
|
||||
optional ResourceClaimSpec spec = 2;
|
||||
|
||||
// Status describes whether the claim is ready to use and what has been allocated.
|
||||
@@ -1429,8 +1563,8 @@ message ResourceClaimStatus {
|
||||
// Allocation is set once the claim has been allocated successfully.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:update=NoModify
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
|
||||
optional AllocationResult allocation = 1;
|
||||
|
||||
// ReservedFor indicates which entities are currently allowed to use
|
||||
@@ -1458,10 +1592,10 @@ message ResourceClaimStatus {
|
||||
// +listMapKey=uid
|
||||
// +patchStrategy=merge
|
||||
// +patchMergeKey=uid
|
||||
// +k8s:optional
|
||||
// +k8s:listType=map
|
||||
// +k8s:listMapKey=uid
|
||||
// +k8s:maxItems=256
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listType=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
|
||||
repeated ResourceClaimConsumerReference reservedFor = 2;
|
||||
|
||||
// Devices contains the status of each device allocated for this
|
||||
@@ -1469,25 +1603,22 @@ message ResourceClaimStatus {
|
||||
// information. Entries are owned by their respective drivers.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +listType=map
|
||||
// +listMapKey=driver
|
||||
// +listMapKey=device
|
||||
// +listMapKey=pool
|
||||
// +listMapKey=shareID
|
||||
// +featureGate=DRAResourceClaimDeviceStatus
|
||||
// +k8s:listType=map
|
||||
// +k8s:listMapKey=driver
|
||||
// +k8s:listMapKey=device
|
||||
// +k8s:listMapKey=pool
|
||||
// +k8s:listMapKey=shareID
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listType=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
|
||||
repeated AllocatedDeviceStatus devices = 4;
|
||||
}
|
||||
|
||||
// ResourceClaimTemplate is used to produce ResourceClaim objects.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
message ResourceClaimTemplate {
|
||||
// Standard object metadata
|
||||
// +optional
|
||||
@@ -1583,9 +1714,6 @@ message ResourcePool {
|
||||
//
|
||||
// For resources that are not local to a node, the node name is not set. Instead,
|
||||
// the driver may use a node selector to specify where the devices are available.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
message ResourceSlice {
|
||||
// Standard object metadata
|
||||
// +optional
|
||||
@@ -1594,6 +1722,7 @@ message ResourceSlice {
|
||||
// Contains the information published by the driver.
|
||||
//
|
||||
// Changing the spec automatically increments the metadata.generation number.
|
||||
// +required
|
||||
optional ResourceSliceSpec spec = 2;
|
||||
}
|
||||
|
||||
@@ -1668,7 +1797,7 @@ message ResourceSliceSpec {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +zeroOrOneOf=ResourceSliceType
|
||||
repeated Device devices = 6;
|
||||
|
||||
@@ -1694,14 +1823,14 @@ message ResourceSliceSpec {
|
||||
// The maximum number of counter sets is 8.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
|
||||
// +featureGate=DRAPartitionableDevices
|
||||
// +zeroOrOneOf=ResourceSliceType
|
||||
// +k8s:maxItems=8
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
|
||||
repeated CounterSet sharedCounters = 8;
|
||||
}
|
||||
|
||||
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
//go:build kubernetes_protomessage_one_more_release
|
||||
// +build kubernetes_protomessage_one_more_release
|
||||
|
||||
/*
|
||||
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 go-to-protobuf. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
func (*AllocatedDeviceStatus) ProtoMessage() {}
|
||||
|
||||
func (*AllocationResult) ProtoMessage() {}
|
||||
|
||||
func (*CELDeviceSelector) ProtoMessage() {}
|
||||
|
||||
func (*CapacityRequestPolicy) ProtoMessage() {}
|
||||
|
||||
func (*CapacityRequestPolicyRange) ProtoMessage() {}
|
||||
|
||||
func (*CapacityRequirements) ProtoMessage() {}
|
||||
|
||||
func (*Counter) ProtoMessage() {}
|
||||
|
||||
func (*CounterSet) ProtoMessage() {}
|
||||
|
||||
func (*Device) ProtoMessage() {}
|
||||
|
||||
func (*DeviceAllocationConfiguration) ProtoMessage() {}
|
||||
|
||||
func (*DeviceAllocationResult) ProtoMessage() {}
|
||||
|
||||
func (*DeviceAttribute) ProtoMessage() {}
|
||||
|
||||
func (*DeviceCapacity) ProtoMessage() {}
|
||||
|
||||
func (*DeviceClaim) ProtoMessage() {}
|
||||
|
||||
func (*DeviceClaimConfiguration) ProtoMessage() {}
|
||||
|
||||
func (*DeviceClass) ProtoMessage() {}
|
||||
|
||||
func (*DeviceClassConfiguration) ProtoMessage() {}
|
||||
|
||||
func (*DeviceClassList) ProtoMessage() {}
|
||||
|
||||
func (*DeviceClassSpec) ProtoMessage() {}
|
||||
|
||||
func (*DeviceConfiguration) ProtoMessage() {}
|
||||
|
||||
func (*DeviceConstraint) ProtoMessage() {}
|
||||
|
||||
func (*DeviceCounterConsumption) ProtoMessage() {}
|
||||
|
||||
func (*DeviceRequest) ProtoMessage() {}
|
||||
|
||||
func (*DeviceRequestAllocationResult) ProtoMessage() {}
|
||||
|
||||
func (*DeviceSelector) ProtoMessage() {}
|
||||
|
||||
func (*DeviceSubRequest) ProtoMessage() {}
|
||||
|
||||
func (*DeviceTaint) ProtoMessage() {}
|
||||
|
||||
func (*DeviceToleration) ProtoMessage() {}
|
||||
|
||||
func (*ExactDeviceRequest) ProtoMessage() {}
|
||||
|
||||
func (*NetworkDeviceData) ProtoMessage() {}
|
||||
|
||||
func (*OpaqueDeviceConfiguration) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaim) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimConsumerReference) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimList) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimSpec) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimStatus) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimTemplate) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimTemplateList) ProtoMessage() {}
|
||||
|
||||
func (*ResourceClaimTemplateSpec) ProtoMessage() {}
|
||||
|
||||
func (*ResourcePool) ProtoMessage() {}
|
||||
|
||||
func (*ResourceSlice) ProtoMessage() {}
|
||||
|
||||
func (*ResourceSliceList) ProtoMessage() {}
|
||||
|
||||
func (*ResourceSliceSpec) ProtoMessage() {}
|
||||
+306
-144
@@ -35,6 +35,11 @@ const (
|
||||
// special ResourceClaim. Its single valid value is "true".
|
||||
// This is used only inside the scheduler.
|
||||
ExtendedResourceClaimAnnotation = "resource.kubernetes.io/extended-resource-claim"
|
||||
// PodResourceClaimAnnotation is the annotation set on template-generated
|
||||
// ResourceClaims by the ResourceClaim controller. Its value is the
|
||||
// spec.resourceClaims[].name of the Pod or PodGroup for which the claim was
|
||||
// generated. The Pod and its PodGroup are guaranteed to use the same name.
|
||||
PodResourceClaimAnnotation = "resource.kubernetes.io/pod-claim-name"
|
||||
// Resource device class prefix is for generating implicit extended resource
|
||||
// name for a device class when its ExtendedResourceName field is not
|
||||
// specified. The generated name is this prefix + the device class name.
|
||||
@@ -42,6 +47,23 @@ const (
|
||||
// in pod.Spec.Resources.Requests, in that case, a valid name has to be specified
|
||||
// explicitly in device class.
|
||||
ResourceDeviceClassPrefix string = "deviceclass.resource.kubernetes.io/"
|
||||
|
||||
// The constants below are all related to synthetic authorization checks for resourceclaims.status writes.
|
||||
|
||||
// SubresourceBinding is the synthetic subresource used for authorization
|
||||
// of updates to status.allocation and status.reservedFor.
|
||||
SubresourceBinding = "binding"
|
||||
// SubresourceDriver is the synthetic subresource used for per-driver
|
||||
// authorization of updates to status.devices.
|
||||
SubresourceDriver = "driver"
|
||||
// VerbPrefixAssociatedNode is the verb prefix for requests from a service account
|
||||
// on the same node as the claim's allocation. The full verb is
|
||||
// "associated-node:<request-verb>", e.g. "associated-node:update".
|
||||
VerbPrefixAssociatedNode = "associated-node:"
|
||||
// VerbPrefixArbitraryNode is the verb prefix for requests not associated
|
||||
// with a specific node (controllers, etc.). The full verb is
|
||||
// "arbitrary-node:<request-verb>", e.g. "arbitrary-node:update".
|
||||
VerbPrefixArbitraryNode = "arbitrary-node:"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
@@ -70,9 +92,6 @@ const (
|
||||
//
|
||||
// For resources that are not local to a node, the node name is not set. Instead,
|
||||
// the driver may use a node selector to specify where the devices are available.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
type ResourceSlice struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object metadata
|
||||
@@ -82,6 +101,7 @@ type ResourceSlice struct {
|
||||
// Contains the information published by the driver.
|
||||
//
|
||||
// Changing the spec automatically increments the metadata.generation number.
|
||||
// +required
|
||||
Spec ResourceSliceSpec `json:"spec" protobuf:"bytes,2,name=spec"`
|
||||
}
|
||||
|
||||
@@ -155,7 +175,7 @@ type ResourceSliceSpec struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +zeroOrOneOf=ResourceSliceType
|
||||
Devices []Device `json:"devices,omitempty" protobuf:"bytes,6,name=devices"`
|
||||
|
||||
@@ -181,14 +201,14 @@ type ResourceSliceSpec struct {
|
||||
// The maximum number of counter sets is 8.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
|
||||
// +featureGate=DRAPartitionableDevices
|
||||
// +zeroOrOneOf=ResourceSliceType
|
||||
// +k8s:maxItems=8
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
|
||||
SharedCounters []CounterSet `json:"sharedCounters,omitempty" protobuf:"bytes,8,name=sharedCounters"`
|
||||
}
|
||||
|
||||
@@ -205,8 +225,8 @@ type CounterSet struct {
|
||||
// It must be a DNS label.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-short-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
|
||||
Name string `json:"name" protobuf:"bytes,1,name=name"`
|
||||
|
||||
// Counters defines the set of counters for this CounterSet
|
||||
@@ -215,6 +235,8 @@ type CounterSet struct {
|
||||
// The maximum number of counters is 32.
|
||||
//
|
||||
// +required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
|
||||
Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,name=counters"`
|
||||
}
|
||||
|
||||
@@ -261,7 +283,14 @@ type ResourcePool struct {
|
||||
|
||||
const ResourceSliceMaxSharedCapacity = 128
|
||||
const ResourceSliceMaxDevices = 128
|
||||
const ResourceSliceMaxDevicesWithTaintsOrConsumesCounters = 64
|
||||
|
||||
// ResourceSliceMaxDevicesWithAdvancedFeatures defines the maximum number of devices in a ResourceSlice
|
||||
// if any of those devices uses advanced features:
|
||||
// - device taints (DRADeviceTaints feature gate)
|
||||
// - consuming counters (DRAPartitionableDevices feature gate)
|
||||
// - list attributes (DRAListTypeAttributes feature gate)
|
||||
const ResourceSliceMaxDevicesWithAdvancedFeatures = 64
|
||||
|
||||
const PoolNameMaxLength = validation.DNS1123SubdomainMaxLength // Same as for a single node name.
|
||||
const BindingConditionsMaxSize = 4
|
||||
const BindingFailureConditionsMaxSize = 4
|
||||
@@ -298,6 +327,7 @@ type Device struct {
|
||||
// The maximum number of attributes and capacities combined is 32.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,2,rep,name=attributes"`
|
||||
|
||||
// Capacity defines the set of capacities for this device.
|
||||
@@ -318,13 +348,13 @@ type Device struct {
|
||||
// device is 2.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=counterSet
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet
|
||||
// +featureGate=DRAPartitionableDevices
|
||||
// +k8s:maxItems=2
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=2
|
||||
ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters,omitempty" protobuf:"bytes,4,rep,name=consumesCounters"`
|
||||
|
||||
// NodeName identifies the node where the device is available.
|
||||
@@ -365,12 +395,13 @@ type Device 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Taints []DeviceTaint `json:"taints,omitempty" protobuf:"bytes,8,rep,name=taints"`
|
||||
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -378,7 +409,7 @@ type Device 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -394,14 +425,14 @@ type Device 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,10,rep,name=bindingConditions"`
|
||||
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -412,14 +443,14 @@ type Device 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,11,rep,name=bindingFailureConditions"`
|
||||
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -430,6 +461,59 @@ type Device struct {
|
||||
// +optional
|
||||
// +featureGate=DRAConsumableCapacity
|
||||
AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty" protobuf:"bytes,12,opt,name=allowMultipleAllocations"`
|
||||
|
||||
// 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.
|
||||
// +optional
|
||||
// +featureGate=DRANodeAllocatableResources
|
||||
NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,13,opt,name=nodeAllocatableResourceMappings"`
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity
|
||||
// units requested to the corresponding quantity of the node allocatable resource.
|
||||
type NodeAllocatableResourceMapping 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".
|
||||
// +optional
|
||||
CapacityKey *QualifiedName `json:"capacityKey,omitempty" protobuf:"bytes,1,opt,name=capacityKey"`
|
||||
|
||||
// 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.
|
||||
// +optional
|
||||
AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty" protobuf:"bytes,2,opt,name=allocationMultiplier"`
|
||||
}
|
||||
|
||||
// DeviceCounterConsumption defines a set of counters that
|
||||
@@ -439,8 +523,8 @@ type DeviceCounterConsumption struct {
|
||||
// counters defined will be consumed.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-short-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name
|
||||
CounterSet string `json:"counterSet" protobuf:"bytes,1,opt,name=counterSet"`
|
||||
|
||||
// Counters defines the counters that will be consumed by the device.
|
||||
@@ -448,6 +532,8 @@ type DeviceCounterConsumption struct {
|
||||
// The maximum number of counters is 32.
|
||||
//
|
||||
// +required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name
|
||||
Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"`
|
||||
}
|
||||
|
||||
@@ -568,6 +654,10 @@ type CapacityRequestPolicyRange struct {
|
||||
// Limit for the sum of the number of entries in both attributes and capacity.
|
||||
const ResourceSliceMaxAttributesAndCapacitiesPerDevice = 32
|
||||
|
||||
// Limit per device for the total number of string, version, bool or int values
|
||||
// in list and non-list attributes.
|
||||
const ResourceSliceMaxAttributeValuesPerDevice = 48
|
||||
|
||||
// QualifiedName is the name of a device attribute or capacity.
|
||||
//
|
||||
// Attributes and capacities are defined either by the owner of the specific
|
||||
@@ -607,31 +697,79 @@ type DeviceAttribute struct {
|
||||
// IntValue is a number.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"`
|
||||
|
||||
// BoolValue is a true/false value.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"`
|
||||
|
||||
// StringValue is a string. Must not be longer than 64 characters.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"`
|
||||
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:unionMember
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"`
|
||||
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
IntValues []int64 `json:"ints,omitempty" protobuf:"varint,6,opt,name=ints"`
|
||||
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
BoolValues []bool `json:"bools,omitempty" protobuf:"varint,7,opt,name=bools"`
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
StringValues []string `json:"strings,omitempty" protobuf:"bytes,8,opt,name=strings"`
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unionMember
|
||||
// +featureGate=DRAListTypeAttributes
|
||||
VersionValues []string `json:"versions,omitempty" protobuf:"bytes,9,opt,name=versions"`
|
||||
}
|
||||
|
||||
// DeviceAttributeMaxValueLength is the maximum length of a string or version attribute value.
|
||||
@@ -666,7 +804,7 @@ type DeviceTaint struct {
|
||||
// Consumers must treat unknown effects like None.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"`
|
||||
|
||||
// ^^^^
|
||||
@@ -682,9 +820,18 @@ type DeviceTaint struct {
|
||||
// which will enable adding new enums within a single release without
|
||||
// ratcheting.
|
||||
|
||||
// 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).
|
||||
//
|
||||
// +optional
|
||||
TimeAdded *metav1.Time `json:"timeAdded,omitempty" protobuf:"bytes,4,opt,name=timeAdded"`
|
||||
|
||||
@@ -696,7 +843,7 @@ type DeviceTaint struct {
|
||||
}
|
||||
|
||||
// +enum
|
||||
// +k8s:enum
|
||||
// +k8s:alpha(since: "1.36")=+k8s:enum
|
||||
type DeviceTaintEffect string
|
||||
|
||||
const (
|
||||
@@ -729,16 +876,13 @@ type ResourceSliceList struct {
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.34
|
||||
// +k8s:supportsSubresource=/status
|
||||
// +k8s:supportsSubresource="/status"
|
||||
|
||||
// ResourceClaim describes a request for access to resources in the cluster,
|
||||
// for use by workloads. For example, if a workload needs an accelerator device
|
||||
// with specific properties, this is how that request is expressed. The status
|
||||
// stanza tracks whether this claim has been satisfied and what specific
|
||||
// resources have been allocated.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
type ResourceClaim struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object metadata
|
||||
@@ -747,7 +891,7 @@ type ResourceClaim struct {
|
||||
|
||||
// Spec describes what is being requested and how to configure it.
|
||||
// The spec is immutable.
|
||||
// +k8s:immutable
|
||||
// +k8s:alpha(since: "1.36")=+k8s:immutable
|
||||
Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
|
||||
|
||||
// Status describes whether the claim is ready to use and what has been allocated.
|
||||
@@ -775,11 +919,11 @@ type DeviceClaim struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=name
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"`
|
||||
|
||||
// These constraints must be satisfied by the set of devices that get
|
||||
@@ -787,8 +931,8 @@ type DeviceClaim struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"`
|
||||
|
||||
// This field holds configuration for multiple potential drivers which
|
||||
@@ -797,8 +941,8 @@ type DeviceClaim struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"`
|
||||
|
||||
// Potential future extension, ignored by older schedulers. This is
|
||||
@@ -849,7 +993,7 @@ type DeviceRequest struct {
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=deviceRequestType
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Exactly *ExactDeviceRequest `json:"exactly,omitempty" protobuf:"bytes,2,name=exactly"`
|
||||
|
||||
// FirstAvailable contains subrequests, of which exactly one will be
|
||||
@@ -870,11 +1014,11 @@ type DeviceRequest struct {
|
||||
// +oneOf=deviceRequestType
|
||||
// +listType=atomic
|
||||
// +featureGate=DRAPrioritizedList
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=map
|
||||
// +k8s:listMapKey=name
|
||||
// +k8s:maxItems=8
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=8
|
||||
FirstAvailable []DeviceSubRequest `json:"firstAvailable,omitempty" protobuf:"bytes,3,name=firstAvailable"`
|
||||
}
|
||||
|
||||
@@ -902,8 +1046,8 @@ type ExactDeviceRequest struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,2,name=selectors"`
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -926,7 +1070,7 @@ type ExactDeviceRequest struct {
|
||||
// requests with unknown modes.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"`
|
||||
|
||||
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
|
||||
@@ -942,8 +1086,7 @@ type ExactDeviceRequest struct {
|
||||
// all ordinary claims to the device with respect to access modes and
|
||||
// any resource allocations.
|
||||
//
|
||||
// This is an alpha 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -965,12 +1108,13 @@ type ExactDeviceRequest 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
|
||||
|
||||
// Capacity define resource requirements against each capacity.
|
||||
@@ -1022,8 +1166,8 @@ type DeviceSubRequest struct {
|
||||
// to reference.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-long-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name
|
||||
DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"`
|
||||
|
||||
// Selectors define criteria which must be satisfied by a specific
|
||||
@@ -1033,8 +1177,8 @@ type DeviceSubRequest struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"`
|
||||
|
||||
// AllocationMode and its related fields define how devices are allocated
|
||||
@@ -1056,6 +1200,7 @@ type DeviceSubRequest struct {
|
||||
// requests with unknown modes.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"`
|
||||
|
||||
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
|
||||
@@ -1080,12 +1225,13 @@ type DeviceSubRequest 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
|
||||
|
||||
// Capacity define resource requirements against each capacity.
|
||||
@@ -1142,7 +1288,7 @@ const (
|
||||
)
|
||||
|
||||
// +enum
|
||||
// +k8s:enum
|
||||
// +k8s:alpha(since: "1.36")=+k8s:enum
|
||||
type DeviceAllocationMode string
|
||||
|
||||
// Valid [DeviceRequest.CountMode] values.
|
||||
@@ -1211,6 +1357,14 @@ type CELDeviceSelector 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.
|
||||
@@ -1261,10 +1415,10 @@ type DeviceConstraint struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
|
||||
|
||||
// MatchAttribute requires that all devices in question have this
|
||||
@@ -1278,12 +1432,17 @@ type DeviceConstraint 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.
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=ConstraintType
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-resource-fully-qualified-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name
|
||||
MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"`
|
||||
|
||||
// Potential future extension, not part of the current design:
|
||||
@@ -1299,6 +1458,11 @@ type DeviceConstraint struct {
|
||||
// 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
|
||||
@@ -1324,10 +1488,10 @@ type DeviceClaimConfiguration struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"`
|
||||
|
||||
DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"`
|
||||
@@ -1341,7 +1505,7 @@ type DeviceConfiguration struct {
|
||||
//
|
||||
// +optional
|
||||
// +oneOf=ConfigurationType
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"`
|
||||
}
|
||||
|
||||
@@ -1358,8 +1522,9 @@ type OpaqueDeviceConfiguration struct {
|
||||
// vendor of the driver. It should use only lower case characters.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-long-name-caseless
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
|
||||
Driver string `json:"driver" protobuf:"bytes,1,name=driver"`
|
||||
|
||||
// Parameters can contain arbitrary data. It is the responsibility of
|
||||
@@ -1385,8 +1550,8 @@ type DeviceToleration struct {
|
||||
// Must be a label name.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-label-key
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key
|
||||
Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"`
|
||||
|
||||
// Operator represents a key's relationship to the value.
|
||||
@@ -1396,6 +1561,7 @@ type DeviceToleration struct {
|
||||
//
|
||||
// +optional
|
||||
// +default="Equal"
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Operator DeviceTolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=DeviceTolerationOperator"`
|
||||
|
||||
// Value is the taint value the toleration matches to.
|
||||
@@ -1409,6 +1575,7 @@ type DeviceToleration struct {
|
||||
// When specified, allowed values are NoSchedule and NoExecute.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Effect DeviceTaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=DeviceTaintEffect"`
|
||||
|
||||
// TolerationSeconds represents the period of time the toleration (which must be
|
||||
@@ -1425,7 +1592,7 @@ type DeviceToleration struct {
|
||||
// A toleration operator is the set of operators that can be used in a toleration.
|
||||
//
|
||||
// +enum
|
||||
// +k8s:enum
|
||||
// +k8s:alpha(since: "1.36")=+k8s:enum
|
||||
type DeviceTolerationOperator string
|
||||
|
||||
const (
|
||||
@@ -1439,8 +1606,8 @@ type ResourceClaimStatus struct {
|
||||
// Allocation is set once the claim has been allocated successfully.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:update=NoModify
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:update=NoModify
|
||||
Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"`
|
||||
|
||||
// ReservedFor indicates which entities are currently allowed to use
|
||||
@@ -1468,10 +1635,10 @@ type ResourceClaimStatus struct {
|
||||
// +listMapKey=uid
|
||||
// +patchStrategy=merge
|
||||
// +patchMergeKey=uid
|
||||
// +k8s:optional
|
||||
// +k8s:listType=map
|
||||
// +k8s:listMapKey=uid
|
||||
// +k8s:maxItems=256
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listType=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=256
|
||||
ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
|
||||
|
||||
// DeallocationRequested is tombstoned since Kubernetes 1.32 where
|
||||
@@ -1484,18 +1651,18 @@ type ResourceClaimStatus struct {
|
||||
// information. Entries are owned by their respective drivers.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +listType=map
|
||||
// +listMapKey=driver
|
||||
// +listMapKey=device
|
||||
// +listMapKey=pool
|
||||
// +listMapKey=shareID
|
||||
// +featureGate=DRAResourceClaimDeviceStatus
|
||||
// +k8s:listType=map
|
||||
// +k8s:listMapKey=driver
|
||||
// +k8s:listMapKey=device
|
||||
// +k8s:listMapKey=pool
|
||||
// +k8s:listMapKey=shareID
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listType=map
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=device
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool
|
||||
// +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID
|
||||
Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"`
|
||||
}
|
||||
|
||||
@@ -1544,7 +1711,7 @@ type AllocationResult 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -1558,8 +1725,8 @@ type DeviceAllocationResult struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"`
|
||||
|
||||
// This field is a combination of all the claim and class configuration parameters.
|
||||
@@ -1572,8 +1739,8 @@ type DeviceAllocationResult struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=64
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=64
|
||||
Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
|
||||
}
|
||||
|
||||
@@ -1602,8 +1769,9 @@ type DeviceRequestAllocationResult struct {
|
||||
// vendor of the driver. It should use only lower case characters.
|
||||
//
|
||||
// +required
|
||||
// +k8s:format=k8s-long-name-caseless
|
||||
// +k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxLength=63
|
||||
Driver string `json:"driver" protobuf:"bytes,2,name=driver"`
|
||||
|
||||
// This name together with the driver name and the device name field
|
||||
@@ -1613,8 +1781,8 @@ type DeviceRequestAllocationResult struct {
|
||||
// DNS sub-domains separated by slashes.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:format=k8s-resource-pool-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name
|
||||
Pool string `json:"pool" protobuf:"bytes,3,name=pool"`
|
||||
|
||||
// Device references one device instance via its name in the driver's
|
||||
@@ -1627,8 +1795,7 @@ type DeviceRequestAllocationResult struct {
|
||||
// administrative access. See the corresponding request field
|
||||
// for a definition of mode.
|
||||
//
|
||||
// This is an alpha 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.
|
||||
//
|
||||
// +optional
|
||||
@@ -1640,38 +1807,39 @@ type DeviceRequestAllocationResult 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceTaints
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"`
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,7,rep,name=bindingConditions"`
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=4
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=4
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,8,rep,name=bindingFailureConditions"`
|
||||
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
@@ -1681,8 +1849,8 @@ type DeviceRequestAllocationResult struct {
|
||||
//
|
||||
// +optional
|
||||
// +featureGate=DRAConsumableCapacity
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-uuid
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
|
||||
ShareID *types.UID `json:"shareID,omitempty" protobuf:"bytes,9,opt,name=shareID"`
|
||||
|
||||
// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
|
||||
@@ -1706,7 +1874,7 @@ type DeviceAllocationConfiguration struct {
|
||||
// or from a claim.
|
||||
//
|
||||
// +required
|
||||
// +k8s:required
|
||||
// +k8s:alpha(since: "1.36")=+k8s:required
|
||||
Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"`
|
||||
|
||||
// Requests lists the names of requests where the configuration applies.
|
||||
@@ -1718,17 +1886,17 @@ type DeviceAllocationConfiguration struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"`
|
||||
|
||||
DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"`
|
||||
}
|
||||
|
||||
// +enum
|
||||
// +k8s:enum
|
||||
// +k8s:alpha(since: "1.36")=+k8s:enum
|
||||
type AllocationConfigSource string
|
||||
|
||||
// Valid [DeviceAllocationConfiguration.Source] values.
|
||||
@@ -1760,15 +1928,12 @@ type ResourceClaimList struct {
|
||||
// device configuration and selectors. It can be referenced in
|
||||
// the device requests of a claim to apply these presets.
|
||||
// Cluster scoped.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
type DeviceClass struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object metadata
|
||||
// +optional
|
||||
// +k8s:subfield(name)=+k8s:optional
|
||||
// +k8s:subfield(name)=+k8s:format=k8s-long-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name
|
||||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// Spec defines what can be allocated and how to configure it.
|
||||
@@ -1789,8 +1954,8 @@ type DeviceClassSpec struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"`
|
||||
|
||||
// Config defines configuration parameters that apply to each device that is claimed via this class.
|
||||
@@ -1801,8 +1966,8 @@ type DeviceClassSpec struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:maxItems=32
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=32
|
||||
Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"`
|
||||
|
||||
// SuitableNodes is tombstoned since Kubernetes 1.32 where
|
||||
@@ -1819,11 +1984,11 @@ type DeviceClassSpec 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.
|
||||
// +optional
|
||||
// +featureGate=DRAExtendedResource
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-extended-resource-name
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty" protobuf:"bytes,4,opt,name=extendedResourceName"`
|
||||
}
|
||||
|
||||
@@ -1851,9 +2016,6 @@ type DeviceClassList struct {
|
||||
// +k8s:prerelease-lifecycle-gen:introduced=1.34
|
||||
|
||||
// ResourceClaimTemplate is used to produce ResourceClaim objects.
|
||||
//
|
||||
// This is an alpha type and requires enabling the DynamicResourceAllocation
|
||||
// feature gate.
|
||||
type ResourceClaimTemplate struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object metadata
|
||||
@@ -1949,8 +2111,8 @@ type AllocatedDeviceStatus struct {
|
||||
//
|
||||
// +optional
|
||||
// +featureGate=DRAConsumableCapacity
|
||||
// +k8s:optional
|
||||
// +k8s:format=k8s-uuid
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid
|
||||
ShareID *string `json:"shareID,omitempty" protobuf:"bytes,7,opt,name=shareID"`
|
||||
|
||||
// Conditions contains the latest observation of the device's state.
|
||||
@@ -1974,7 +2136,7 @@ type AllocatedDeviceStatus struct {
|
||||
// NetworkData contains network-related information specific to the device.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
NetworkData *NetworkDeviceData `json:"networkData,omitempty" protobuf:"bytes,6,opt,name=networkData"`
|
||||
}
|
||||
|
||||
@@ -1986,11 +2148,11 @@ type NetworkDeviceData 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.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:maxLength=256
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxBytes=256
|
||||
InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName"`
|
||||
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
@@ -2001,18 +2163,18 @@ type NetworkDeviceData struct {
|
||||
//
|
||||
// +optional
|
||||
// +listType=atomic
|
||||
// +k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:listType=atomic
|
||||
// +k8s:unique=set
|
||||
// +k8s:maxItems=16
|
||||
// +k8s:alpha(since: "1.36")=+k8s:unique=set
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxItems=16
|
||||
IPs []string `json:"ips,omitempty" protobuf:"bytes,2,opt,name=ips"`
|
||||
|
||||
// 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.
|
||||
//
|
||||
// +optional
|
||||
// +k8s:optional
|
||||
// +k8s:maxLength=128
|
||||
// +k8s:alpha(since: "1.36")=+k8s:optional
|
||||
// +k8s:alpha(since: "1.36")=+k8s:maxBytes=128
|
||||
HardwareAddress string `json:"hardwareAddress,omitempty" protobuf:"bytes,3,opt,name=hardwareAddress"`
|
||||
}
|
||||
|
||||
+52
-37
@@ -46,7 +46,7 @@ var map_AllocationResult = map[string]string{
|
||||
"": "AllocationResult contains attributes of an allocated resource.",
|
||||
"devices": "Devices is the result of allocating devices.",
|
||||
"nodeSelector": "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere.",
|
||||
"allocationTimestamp": "AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate.",
|
||||
"allocationTimestamp": "AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate.",
|
||||
}
|
||||
|
||||
func (AllocationResult) SwaggerDoc() map[string]string {
|
||||
@@ -55,7 +55,7 @@ func (AllocationResult) SwaggerDoc() map[string]string {
|
||||
|
||||
var map_CELDeviceSelector = map[string]string{
|
||||
"": "CELDeviceSelector contains a CEL expression for selecting a device.",
|
||||
"expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nThe 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.",
|
||||
"expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen 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:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe 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.",
|
||||
}
|
||||
|
||||
func (CELDeviceSelector) SwaggerDoc() map[string]string {
|
||||
@@ -113,19 +113,20 @@ func (CounterSet) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_Device = map[string]string{
|
||||
"": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
|
||||
"name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.",
|
||||
"attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
|
||||
"capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
|
||||
"consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.",
|
||||
"nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
|
||||
"nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
|
||||
"allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
|
||||
"taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf 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.",
|
||||
"": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
|
||||
"name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.",
|
||||
"attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
|
||||
"capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
|
||||
"consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.",
|
||||
"nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
|
||||
"nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
|
||||
"allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.",
|
||||
"taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf 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.",
|
||||
"nodeAllocatableResourceMappings": "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.",
|
||||
}
|
||||
|
||||
func (Device) SwaggerDoc() map[string]string {
|
||||
@@ -153,11 +154,15 @@ func (DeviceAllocationResult) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_DeviceAttribute = map[string]string{
|
||||
"": "DeviceAttribute must have exactly one field set.",
|
||||
"int": "IntValue is a number.",
|
||||
"bool": "BoolValue is a true/false value.",
|
||||
"string": "StringValue is a string. Must not be longer than 64 characters.",
|
||||
"version": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.",
|
||||
"": "DeviceAttribute must have exactly one field set.",
|
||||
"int": "IntValue is a number.",
|
||||
"bool": "BoolValue is a true/false value.",
|
||||
"string": "StringValue is a string. Must not be longer than 64 characters.",
|
||||
"version": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.",
|
||||
"ints": "IntValues is a non-empty list of numbers.\n\nThis is an alpha field and requires enabling the DRAListTypeAttributes feature gate.",
|
||||
"bools": "BoolValues is a non-empty list of true/false values.",
|
||||
"strings": "StringValues is a non-empty list of strings. Each string must not be longer than 64 characters.\n\nThis is an alpha field and requires enabling the DRAListTypeAttributes feature gate.",
|
||||
"versions": "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.\n\nThis is an alpha field and requires enabling the DRAListTypeAttributes feature gate.",
|
||||
}
|
||||
|
||||
func (DeviceAttribute) SwaggerDoc() map[string]string {
|
||||
@@ -195,7 +200,7 @@ func (DeviceClaimConfiguration) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_DeviceClass = map[string]string{
|
||||
"": "DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
|
||||
"": "DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.",
|
||||
"metadata": "Standard object metadata",
|
||||
"spec": "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number.",
|
||||
}
|
||||
@@ -226,7 +231,7 @@ var map_DeviceClassSpec = map[string]string{
|
||||
"": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.",
|
||||
"selectors": "Each selector must be satisfied by a device which is claimed via this class.",
|
||||
"config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is an alpha field.",
|
||||
"extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.",
|
||||
}
|
||||
|
||||
func (DeviceClassSpec) SwaggerDoc() map[string]string {
|
||||
@@ -245,8 +250,8 @@ func (DeviceConfiguration) SwaggerDoc() map[string]string {
|
||||
var map_DeviceConstraint = map[string]string{
|
||||
"": "DeviceConstraint must have exactly one field set besides Requests.",
|
||||
"requests": "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.\n\nReferences to subrequests must include the name of the main request and may include the subrequest using the format <main request>[/<subrequest>]. If just the main request is given, the constraint applies to all subrequests.",
|
||||
"matchAttribute": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.",
|
||||
"distinctAttribute": "DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices.\n\nThis acts as the inverse of MatchAttribute.\n\nThis constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation.\n\nThis is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs.",
|
||||
"matchAttribute": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nWhen 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.\n\nMust include the domain qualifier.",
|
||||
"distinctAttribute": "DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices.\n\nWhen 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.\n\nThis acts as the inverse of MatchAttribute.\n\nThis constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation.\n\nThis is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs.",
|
||||
}
|
||||
|
||||
func (DeviceConstraint) SwaggerDoc() map[string]string {
|
||||
@@ -280,10 +285,10 @@ var map_DeviceRequestAllocationResult = map[string]string{
|
||||
"driver": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters.",
|
||||
"pool": "This name together with the driver name and the device name field identify which device was allocated (`<driver name>/<pool name>/<device name>`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.",
|
||||
"device": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.",
|
||||
"adminAccess": "AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.",
|
||||
"tolerations": "A copy of all tolerations specified in the request at the time when the device got allocated.\n\nThe maximum number of tolerations is 16.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"bindingConditions": "BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"bindingFailureConditions": "BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"adminAccess": "AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode.\n\nAdmin access is disabled if this field is unset or set to false, otherwise it is enabled.",
|
||||
"tolerations": "A copy of all tolerations specified in the request at the time when the device got allocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"bindingConditions": "BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"bindingFailureConditions": "BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.",
|
||||
"shareID": "ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device.",
|
||||
"consumedCapacity": "ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount).\n\nThe total consumed capacity for each device must not exceed the DeviceCapacity's Value.\n\nThis field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero.",
|
||||
}
|
||||
@@ -308,7 +313,7 @@ var map_DeviceSubRequest = map[string]string{
|
||||
"selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.",
|
||||
"allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.",
|
||||
"count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.",
|
||||
"tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.",
|
||||
}
|
||||
|
||||
@@ -321,7 +326,7 @@ var map_DeviceTaint = map[string]string{
|
||||
"key": "The taint key to be applied to a device. Must be a label name.",
|
||||
"value": "The taint value corresponding to the taint key. Must be a label value.",
|
||||
"effect": "The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them.\n\nValid effects are None, NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. More effects may get added in the future. Consumers must treat unknown effects like None.",
|
||||
"timeAdded": "TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set.",
|
||||
"timeAdded": "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.\n\nIn 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).",
|
||||
}
|
||||
|
||||
func (DeviceTaint) SwaggerDoc() map[string]string {
|
||||
@@ -347,8 +352,8 @@ var map_ExactDeviceRequest = map[string]string{
|
||||
"selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.",
|
||||
"allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.",
|
||||
"count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.",
|
||||
"adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.",
|
||||
"tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nAdmin access is disabled if this field is unset or set to false, otherwise it is enabled.",
|
||||
"tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.",
|
||||
"capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.",
|
||||
}
|
||||
|
||||
@@ -358,15 +363,25 @@ func (ExactDeviceRequest) SwaggerDoc() map[string]string {
|
||||
|
||||
var map_NetworkDeviceData = map[string]string{
|
||||
"": "NetworkDeviceData provides network-related details for the allocated device. This information may be filled by drivers or other components to configure or identify the device within a network context.",
|
||||
"interfaceName": "InterfaceName specifies the name of the network interface associated with the allocated device. This might be the name of a physical or virtual network interface being configured in the pod.\n\nMust not be longer than 256 characters.",
|
||||
"interfaceName": "InterfaceName specifies the name of the network interface associated with the allocated device. This might be the name of a physical or virtual network interface being configured in the pod.\n\nMust not be longer than 256 bytes.",
|
||||
"ips": "IPs lists the network addresses assigned to the device's network interface. This can include both IPv4 and IPv6 addresses. The IPs are in the CIDR notation, which includes both the address and the associated subnet mask. e.g.: \"192.0.2.5/24\" for IPv4 and \"2001:db8::5/64\" for IPv6.",
|
||||
"hardwareAddress": "HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.\n\nMust not be longer than 128 characters.",
|
||||
"hardwareAddress": "HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.\n\nMust not be longer than 128 bytes.",
|
||||
}
|
||||
|
||||
func (NetworkDeviceData) SwaggerDoc() map[string]string {
|
||||
return map_NetworkDeviceData
|
||||
}
|
||||
|
||||
var map_NodeAllocatableResourceMapping = map[string]string{
|
||||
"": "NodeAllocatableResourceMapping defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource.",
|
||||
"capacityKey": "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\".",
|
||||
"allocationMultiplier": "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.\n\t a. A DRA driver representing each CPU core as a device would have\n {ResourceName: \"cpu\", allocationMultiplier: \"2\"} in its\n `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,\n\t\t 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.\n b. A GPU device that needs additional node memory per GPU allocation would\n have {ResourceName: \"memory\", allocationMultiplier: \"2Gi\"}. Each allocated\n\t\t GPU device instance of this type will account for 2Gi of memory.\n\n2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.\n\t The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.\n For example, if a Device's capacity \"dra.example.com/cores\" is consumed,\n and each \"core\" provides 2 \"cpu\"s, the mapping would be:\n {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", allocationMultiplier: \"2\"}.\n If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.",
|
||||
}
|
||||
|
||||
func (NodeAllocatableResourceMapping) SwaggerDoc() map[string]string {
|
||||
return map_NodeAllocatableResourceMapping
|
||||
}
|
||||
|
||||
var map_OpaqueDeviceConfiguration = map[string]string{
|
||||
"": "OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor.",
|
||||
"driver": "Driver is used to determine which kubelet plugin needs to be passed these configuration parameters.\n\nAn admission policy provided by the driver developer could use this to decide whether it needs to validate them.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters.",
|
||||
@@ -378,7 +393,7 @@ func (OpaqueDeviceConfiguration) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_ResourceClaim = map[string]string{
|
||||
"": "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
|
||||
"": "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.",
|
||||
"metadata": "Standard object metadata",
|
||||
"spec": "Spec describes what is being requested and how to configure it. The spec is immutable.",
|
||||
"status": "Status describes whether the claim is ready to use and what has been allocated.",
|
||||
@@ -431,7 +446,7 @@ func (ResourceClaimStatus) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_ResourceClaimTemplate = map[string]string{
|
||||
"": "ResourceClaimTemplate is used to produce ResourceClaim objects.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
|
||||
"": "ResourceClaimTemplate is used to produce ResourceClaim objects.",
|
||||
"metadata": "Standard object metadata",
|
||||
"spec": "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.",
|
||||
}
|
||||
@@ -472,7 +487,7 @@ func (ResourcePool) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_ResourceSlice = map[string]string{
|
||||
"": "ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple <driver name>, <pool name>, <device name>.\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
|
||||
"": "ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple <driver name>, <pool name>, <device name>.\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.",
|
||||
"metadata": "Standard object metadata",
|
||||
"spec": "Contains the information published by the driver.\n\nChanging the spec automatically increments the metadata.generation number.",
|
||||
}
|
||||
|
||||
+53
@@ -302,6 +302,13 @@ func (in *Device) DeepCopyInto(out *Device) {
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.NodeAllocatableResourceMappings != nil {
|
||||
in, out := &in.NodeAllocatableResourceMappings, &out.NodeAllocatableResourceMappings
|
||||
*out = make(map[corev1.ResourceName]NodeAllocatableResourceMapping, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -390,6 +397,26 @@ func (in *DeviceAttribute) DeepCopyInto(out *DeviceAttribute) {
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.IntValues != nil {
|
||||
in, out := &in.IntValues, &out.IntValues
|
||||
*out = make([]int64, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.BoolValues != nil {
|
||||
in, out := &in.BoolValues, &out.BoolValues
|
||||
*out = make([]bool, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.StringValues != nil {
|
||||
in, out := &in.StringValues, &out.StringValues
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.VersionValues != nil {
|
||||
in, out := &in.VersionValues, &out.VersionValues
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -907,6 +934,32 @@ func (in *NetworkDeviceData) DeepCopy() *NetworkDeviceData {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NodeAllocatableResourceMapping) DeepCopyInto(out *NodeAllocatableResourceMapping) {
|
||||
*out = *in
|
||||
if in.CapacityKey != nil {
|
||||
in, out := &in.CapacityKey, &out.CapacityKey
|
||||
*out = new(QualifiedName)
|
||||
**out = **in
|
||||
}
|
||||
if in.AllocationMultiplier != nil {
|
||||
in, out := &in.AllocationMultiplier, &out.AllocationMultiplier
|
||||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResourceMapping.
|
||||
func (in *NodeAllocatableResourceMapping) DeepCopy() *NodeAllocatableResourceMapping {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NodeAllocatableResourceMapping)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *OpaqueDeviceConfiguration) DeepCopyInto(out *OpaqueDeviceConfiguration) {
|
||||
*out = *in
|
||||
|
||||
+5
@@ -171,6 +171,11 @@ func (in NetworkDeviceData) OpenAPIModelName() string {
|
||||
return "io.k8s.api.resource.v1.NetworkDeviceData"
|
||||
}
|
||||
|
||||
// OpenAPIModelName returns the OpenAPI model name for this type.
|
||||
func (in NodeAllocatableResourceMapping) OpenAPIModelName() string {
|
||||
return "io.k8s.api.resource.v1.NodeAllocatableResourceMapping"
|
||||
}
|
||||
|
||||
// OpenAPIModelName returns the OpenAPI model name for this type.
|
||||
func (in OpaqueDeviceConfiguration) OpenAPIModelName() string {
|
||||
return "io.k8s.api.resource.v1.OpaqueDeviceConfiguration"
|
||||
|
||||
Reference in New Issue
Block a user