This commit is contained in:
Cici Huang
2025-03-18 07:16:21 +00:00
parent 6d7f11689d
commit ea2f888109
36 changed files with 5172 additions and 449 deletions

View File

@@ -14994,6 +14994,10 @@
"io.k8s.api.resource.v1alpha3.BasicDevice": {
"description": "BasicDevice defines one device instance.",
"properties": {
"allNodes": {
"description": "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.",
"type": "boolean"
},
"attributes": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceAttribute"
@@ -15008,6 +15012,22 @@
"description": "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.",
"type": "object"
},
"consumesCounter": {
"description": "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
"items": {
"$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceCounterConsumption"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"nodeName": {
"description": "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.",
"type": "string"
},
"nodeSelector": {
"$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector",
"description": "NodeSelector defines the nodes 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."
},
"taints": {
"description": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
"items": {
@@ -15032,6 +15052,40 @@
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.Counter": {
"description": "Counter describes a quantity associated with a device.",
"properties": {
"value": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity",
"description": "Value defines how much of a certain device counter is available."
}
},
"required": [
"value"
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.CounterSet": {
"description": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
"properties": {
"counters": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.api.resource.v1alpha3.Counter"
},
"description": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nTo ensure this uniqueness, capacities defined by the vendor must be listed without the driver name as domain prefix in their name. All others must be listed with their domain prefix.\n\nThe maximum number of counters is 32.",
"type": "object"
},
"name": {
"description": "Name defines the name of the counter set. It must be a DNS label.",
"type": "string"
}
},
"required": [
"name",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.Device": {
"description": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
"properties": {
@@ -15284,6 +15338,27 @@
},
"type": "object"
},
"io.k8s.api.resource.v1alpha3.DeviceCounterConsumption": {
"description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
"properties": {
"counters": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.api.resource.v1alpha3.Counter"
},
"description": "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
"type": "object"
},
"sharedCounter": {
"description": "SharedCounter defines the shared counter from which the counters defined will be consumed.",
"type": "string"
}
},
"required": [
"sharedCounter",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.DeviceRequest": {
"description": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.",
"properties": {
@@ -15962,7 +16037,7 @@
"description": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"properties": {
"allNodes": {
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"devices": {
@@ -15978,16 +16053,28 @@
"type": "string"
},
"nodeName": {
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
"type": "string"
},
"nodeSelector": {
"$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector",
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set."
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set."
},
"perDeviceNodeSelection": {
"description": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"pool": {
"$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourcePool",
"description": "Pool describes the pool that this ResourceSlice belongs to."
},
"sharedCounters": {
"description": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
"items": {
"$ref": "#/definitions/io.k8s.api.resource.v1alpha3.CounterSet"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [
@@ -16055,6 +16142,10 @@
"io.k8s.api.resource.v1beta1.BasicDevice": {
"description": "BasicDevice defines one device instance.",
"properties": {
"allNodes": {
"description": "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.",
"type": "boolean"
},
"attributes": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.api.resource.v1beta1.DeviceAttribute"
@@ -16069,6 +16160,22 @@
"description": "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.",
"type": "object"
},
"consumesCounter": {
"description": "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
"items": {
"$ref": "#/definitions/io.k8s.api.resource.v1beta1.DeviceCounterConsumption"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"nodeName": {
"description": "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.",
"type": "string"
},
"nodeSelector": {
"$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector",
"description": "NodeSelector defines the nodes 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."
},
"taints": {
"description": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
"items": {
@@ -16093,6 +16200,40 @@
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.Counter": {
"description": "Counter describes a quantity associated with a device.",
"properties": {
"value": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity",
"description": "Value defines how much of a certain device counter is available."
}
},
"required": [
"value"
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.CounterSet": {
"description": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
"properties": {
"counters": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.api.resource.v1beta1.Counter"
},
"description": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nThe maximum number of counters is 32.",
"type": "object"
},
"name": {
"description": "Name defines the name of the counter set. It must be a DNS label.",
"type": "string"
}
},
"required": [
"name",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.Device": {
"description": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
"properties": {
@@ -16358,6 +16499,27 @@
},
"type": "object"
},
"io.k8s.api.resource.v1beta1.DeviceCounterConsumption": {
"description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
"properties": {
"counters": {
"additionalProperties": {
"$ref": "#/definitions/io.k8s.api.resource.v1beta1.Counter"
},
"description": "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
"type": "object"
},
"sharedCounter": {
"description": "SharedCounter defines the shared counter from which the counters defined will be consumed.",
"type": "string"
}
},
"required": [
"sharedCounter",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.DeviceRequest": {
"description": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.",
"properties": {
@@ -16922,7 +17084,7 @@
"description": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"properties": {
"allNodes": {
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"devices": {
@@ -16938,16 +17100,28 @@
"type": "string"
},
"nodeName": {
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
"type": "string"
},
"nodeSelector": {
"$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector",
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set."
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set."
},
"perDeviceNodeSelection": {
"description": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"pool": {
"$ref": "#/definitions/io.k8s.api.resource.v1beta1.ResourcePool",
"description": "Pool describes the pool that this ResourceSlice belongs to."
},
"sharedCounters": {
"description": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
"items": {
"$ref": "#/definitions/io.k8s.api.resource.v1beta1.CounterSet"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [

View File

@@ -170,6 +170,10 @@
"io.k8s.api.resource.v1alpha3.BasicDevice": {
"description": "BasicDevice defines one device instance.",
"properties": {
"allNodes": {
"description": "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.",
"type": "boolean"
},
"attributes": {
"additionalProperties": {
"allOf": [
@@ -189,6 +193,31 @@
"description": "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.",
"type": "object"
},
"consumesCounter": {
"description": "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceCounterConsumption"
}
],
"default": {}
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"nodeName": {
"description": "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.",
"type": "string"
},
"nodeSelector": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector"
}
],
"description": "NodeSelector defines the nodes 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."
},
"taints": {
"description": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
"items": {
@@ -219,6 +248,50 @@
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.Counter": {
"description": "Counter describes a quantity associated with a device.",
"properties": {
"value": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"
}
],
"description": "Value defines how much of a certain device counter is available."
}
},
"required": [
"value"
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.CounterSet": {
"description": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
"properties": {
"counters": {
"additionalProperties": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.Counter"
}
],
"default": {}
},
"description": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nTo ensure this uniqueness, capacities defined by the vendor must be listed without the driver name as domain prefix in their name. All others must be listed with their domain prefix.\n\nThe maximum number of counters is 32.",
"type": "object"
},
"name": {
"default": "",
"description": "Name defines the name of the counter set. It must be a DNS label.",
"type": "string"
}
},
"required": [
"name",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.Device": {
"description": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
"properties": {
@@ -547,6 +620,33 @@
},
"type": "object"
},
"io.k8s.api.resource.v1alpha3.DeviceCounterConsumption": {
"description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
"properties": {
"counters": {
"additionalProperties": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.Counter"
}
],
"default": {}
},
"description": "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
"type": "object"
},
"sharedCounter": {
"default": "",
"description": "SharedCounter defines the shared counter from which the counters defined will be consumed.",
"type": "string"
}
},
"required": [
"sharedCounter",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1alpha3.DeviceRequest": {
"description": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.",
"properties": {
@@ -1414,7 +1514,7 @@
"description": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"properties": {
"allNodes": {
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"devices": {
@@ -1436,7 +1536,7 @@
"type": "string"
},
"nodeName": {
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
"type": "string"
},
"nodeSelector": {
@@ -1445,7 +1545,11 @@
"$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector"
}
],
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set."
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set."
},
"perDeviceNodeSelection": {
"description": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"pool": {
"allOf": [
@@ -1455,6 +1559,19 @@
],
"default": {},
"description": "Pool describes the pool that this ResourceSlice belongs to."
},
"sharedCounters": {
"description": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.CounterSet"
}
],
"default": {}
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [

View File

@@ -170,6 +170,10 @@
"io.k8s.api.resource.v1beta1.BasicDevice": {
"description": "BasicDevice defines one device instance.",
"properties": {
"allNodes": {
"description": "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.",
"type": "boolean"
},
"attributes": {
"additionalProperties": {
"allOf": [
@@ -194,6 +198,31 @@
"description": "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.",
"type": "object"
},
"consumesCounter": {
"description": "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1beta1.DeviceCounterConsumption"
}
],
"default": {}
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"nodeName": {
"description": "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.",
"type": "string"
},
"nodeSelector": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector"
}
],
"description": "NodeSelector defines the nodes 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."
},
"taints": {
"description": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
"items": {
@@ -224,6 +253,50 @@
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.Counter": {
"description": "Counter describes a quantity associated with a device.",
"properties": {
"value": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"
}
],
"description": "Value defines how much of a certain device counter is available."
}
},
"required": [
"value"
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.CounterSet": {
"description": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
"properties": {
"counters": {
"additionalProperties": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1beta1.Counter"
}
],
"default": {}
},
"description": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nThe maximum number of counters is 32.",
"type": "object"
},
"name": {
"default": "",
"description": "Name defines the name of the counter set. It must be a DNS label.",
"type": "string"
}
},
"required": [
"name",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.Device": {
"description": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.",
"properties": {
@@ -569,6 +642,33 @@
},
"type": "object"
},
"io.k8s.api.resource.v1beta1.DeviceCounterConsumption": {
"description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
"properties": {
"counters": {
"additionalProperties": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1beta1.Counter"
}
],
"default": {}
},
"description": "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
"type": "object"
},
"sharedCounter": {
"default": "",
"description": "SharedCounter defines the shared counter from which the counters defined will be consumed.",
"type": "string"
}
},
"required": [
"sharedCounter",
"counters"
],
"type": "object"
},
"io.k8s.api.resource.v1beta1.DeviceRequest": {
"description": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.",
"properties": {
@@ -1288,7 +1388,7 @@
"description": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"properties": {
"allNodes": {
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"description": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"devices": {
@@ -1310,7 +1410,7 @@
"type": "string"
},
"nodeName": {
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
"description": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
"type": "string"
},
"nodeSelector": {
@@ -1319,7 +1419,11 @@
"$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector"
}
],
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set."
"description": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set."
},
"perDeviceNodeSelection": {
"description": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"type": "boolean"
},
"pool": {
"allOf": [
@@ -1329,6 +1433,19 @@
],
"default": {},
"description": "Pool describes the pool that this ResourceSlice belongs to."
},
"sharedCounters": {
"description": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1beta1.CounterSet"
}
],
"default": {}
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [

View File

@@ -82,6 +82,26 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1alpha3.Counter)(nil), (*resource.Counter)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_Counter_To_resource_Counter(a.(*resourcev1alpha3.Counter), b.(*resource.Counter), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resource.Counter)(nil), (*resourcev1alpha3.Counter)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_Counter_To_v1alpha3_Counter(a.(*resource.Counter), b.(*resourcev1alpha3.Counter), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1alpha3.CounterSet)(nil), (*resource.CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_CounterSet_To_resource_CounterSet(a.(*resourcev1alpha3.CounterSet), b.(*resource.CounterSet), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resource.CounterSet)(nil), (*resourcev1alpha3.CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_CounterSet_To_v1alpha3_CounterSet(a.(*resource.CounterSet), b.(*resourcev1alpha3.CounterSet), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1alpha3.Device)(nil), (*resource.Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_Device_To_resource_Device(a.(*resourcev1alpha3.Device), b.(*resource.Device), scope)
}); err != nil {
@@ -202,6 +222,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1alpha3.DeviceCounterConsumption)(nil), (*resource.DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(a.(*resourcev1alpha3.DeviceCounterConsumption), b.(*resource.DeviceCounterConsumption), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resource.DeviceCounterConsumption)(nil), (*resourcev1alpha3.DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_DeviceCounterConsumption_To_v1alpha3_DeviceCounterConsumption(a.(*resource.DeviceCounterConsumption), b.(*resourcev1alpha3.DeviceCounterConsumption), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1alpha3.DeviceRequest)(nil), (*resource.DeviceRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_DeviceRequest_To_resource_DeviceRequest(a.(*resourcev1alpha3.DeviceRequest), b.(*resource.DeviceRequest), scope)
}); err != nil {
@@ -526,6 +556,10 @@ func autoConvert_v1alpha3_BasicDevice_To_resource_BasicDevice(in *resourcev1alph
} else {
out.Capacity = nil
}
out.ConsumesCounter = *(*[]resource.DeviceCounterConsumption)(unsafe.Pointer(&in.ConsumesCounter))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes))
out.Taints = *(*[]resource.DeviceTaint)(unsafe.Pointer(&in.Taints))
return nil
}
@@ -550,6 +584,10 @@ func autoConvert_resource_BasicDevice_To_v1alpha3_BasicDevice(in *resource.Basic
} else {
out.Capacity = nil
}
out.ConsumesCounter = *(*[]resourcev1alpha3.DeviceCounterConsumption)(unsafe.Pointer(&in.ConsumesCounter))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.NodeSelector = (*corev1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes))
out.Taints = *(*[]resourcev1alpha3.DeviceTaint)(unsafe.Pointer(&in.Taints))
return nil
}
@@ -579,6 +617,48 @@ func Convert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector(in *resour
return autoConvert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector(in, out, s)
}
func autoConvert_v1alpha3_Counter_To_resource_Counter(in *resourcev1alpha3.Counter, out *resource.Counter, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_v1alpha3_Counter_To_resource_Counter is an autogenerated conversion function.
func Convert_v1alpha3_Counter_To_resource_Counter(in *resourcev1alpha3.Counter, out *resource.Counter, s conversion.Scope) error {
return autoConvert_v1alpha3_Counter_To_resource_Counter(in, out, s)
}
func autoConvert_resource_Counter_To_v1alpha3_Counter(in *resource.Counter, out *resourcev1alpha3.Counter, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_resource_Counter_To_v1alpha3_Counter is an autogenerated conversion function.
func Convert_resource_Counter_To_v1alpha3_Counter(in *resource.Counter, out *resourcev1alpha3.Counter, s conversion.Scope) error {
return autoConvert_resource_Counter_To_v1alpha3_Counter(in, out, s)
}
func autoConvert_v1alpha3_CounterSet_To_resource_CounterSet(in *resourcev1alpha3.CounterSet, out *resource.CounterSet, s conversion.Scope) error {
out.Name = in.Name
out.Counters = *(*map[string]resource.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_v1alpha3_CounterSet_To_resource_CounterSet is an autogenerated conversion function.
func Convert_v1alpha3_CounterSet_To_resource_CounterSet(in *resourcev1alpha3.CounterSet, out *resource.CounterSet, s conversion.Scope) error {
return autoConvert_v1alpha3_CounterSet_To_resource_CounterSet(in, out, s)
}
func autoConvert_resource_CounterSet_To_v1alpha3_CounterSet(in *resource.CounterSet, out *resourcev1alpha3.CounterSet, s conversion.Scope) error {
out.Name = in.Name
out.Counters = *(*map[string]resourcev1alpha3.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_resource_CounterSet_To_v1alpha3_CounterSet is an autogenerated conversion function.
func Convert_resource_CounterSet_To_v1alpha3_CounterSet(in *resource.CounterSet, out *resourcev1alpha3.CounterSet, s conversion.Scope) error {
return autoConvert_resource_CounterSet_To_v1alpha3_CounterSet(in, out, s)
}
func autoConvert_v1alpha3_Device_To_resource_Device(in *resourcev1alpha3.Device, out *resource.Device, s conversion.Scope) error {
out.Name = in.Name
if in.Basic != nil {
@@ -879,6 +959,28 @@ func Convert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint(in *resource
return autoConvert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint(in, out, s)
}
func autoConvert_v1alpha3_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(in *resourcev1alpha3.DeviceCounterConsumption, out *resource.DeviceCounterConsumption, s conversion.Scope) error {
out.SharedCounter = in.SharedCounter
out.Counters = *(*map[string]resource.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_v1alpha3_DeviceCounterConsumption_To_resource_DeviceCounterConsumption is an autogenerated conversion function.
func Convert_v1alpha3_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(in *resourcev1alpha3.DeviceCounterConsumption, out *resource.DeviceCounterConsumption, s conversion.Scope) error {
return autoConvert_v1alpha3_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(in, out, s)
}
func autoConvert_resource_DeviceCounterConsumption_To_v1alpha3_DeviceCounterConsumption(in *resource.DeviceCounterConsumption, out *resourcev1alpha3.DeviceCounterConsumption, s conversion.Scope) error {
out.SharedCounter = in.SharedCounter
out.Counters = *(*map[string]resourcev1alpha3.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_resource_DeviceCounterConsumption_To_v1alpha3_DeviceCounterConsumption is an autogenerated conversion function.
func Convert_resource_DeviceCounterConsumption_To_v1alpha3_DeviceCounterConsumption(in *resource.DeviceCounterConsumption, out *resourcev1alpha3.DeviceCounterConsumption, s conversion.Scope) error {
return autoConvert_resource_DeviceCounterConsumption_To_v1alpha3_DeviceCounterConsumption(in, out, s)
}
func autoConvert_v1alpha3_DeviceRequest_To_resource_DeviceRequest(in *resourcev1alpha3.DeviceRequest, out *resource.DeviceRequest, s conversion.Scope) error {
out.Name = in.Name
out.DeviceClassName = in.DeviceClassName
@@ -1508,6 +1610,8 @@ func autoConvert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec(in *re
} else {
out.Devices = nil
}
out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection))
out.SharedCounters = *(*[]resource.CounterSet)(unsafe.Pointer(&in.SharedCounters))
return nil
}
@@ -1535,6 +1639,8 @@ func autoConvert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec(in *re
} else {
out.Devices = nil
}
out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection))
out.SharedCounters = *(*[]resourcev1alpha3.CounterSet)(unsafe.Pointer(&in.SharedCounters))
return nil
}

View File

@@ -81,6 +81,26 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1beta1.Counter)(nil), (*resource.Counter)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_Counter_To_resource_Counter(a.(*resourcev1beta1.Counter), b.(*resource.Counter), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resource.Counter)(nil), (*resourcev1beta1.Counter)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_Counter_To_v1beta1_Counter(a.(*resource.Counter), b.(*resourcev1beta1.Counter), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1beta1.CounterSet)(nil), (*resource.CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_CounterSet_To_resource_CounterSet(a.(*resourcev1beta1.CounterSet), b.(*resource.CounterSet), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resource.CounterSet)(nil), (*resourcev1beta1.CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_CounterSet_To_v1beta1_CounterSet(a.(*resource.CounterSet), b.(*resourcev1beta1.CounterSet), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1beta1.Device)(nil), (*resource.Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_Device_To_resource_Device(a.(*resourcev1beta1.Device), b.(*resource.Device), scope)
}); err != nil {
@@ -211,6 +231,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1beta1.DeviceCounterConsumption)(nil), (*resource.DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(a.(*resourcev1beta1.DeviceCounterConsumption), b.(*resource.DeviceCounterConsumption), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resource.DeviceCounterConsumption)(nil), (*resourcev1beta1.DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(a.(*resource.DeviceCounterConsumption), b.(*resourcev1beta1.DeviceCounterConsumption), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*resourcev1beta1.DeviceRequest)(nil), (*resource.DeviceRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_DeviceRequest_To_resource_DeviceRequest(a.(*resourcev1beta1.DeviceRequest), b.(*resource.DeviceRequest), scope)
}); err != nil {
@@ -473,6 +503,10 @@ func Convert_resource_AllocationResult_To_v1beta1_AllocationResult(in *resource.
func autoConvert_v1beta1_BasicDevice_To_resource_BasicDevice(in *resourcev1beta1.BasicDevice, out *resource.BasicDevice, s conversion.Scope) error {
out.Attributes = *(*map[resource.QualifiedName]resource.DeviceAttribute)(unsafe.Pointer(&in.Attributes))
out.Capacity = *(*map[resource.QualifiedName]resource.DeviceCapacity)(unsafe.Pointer(&in.Capacity))
out.ConsumesCounter = *(*[]resource.DeviceCounterConsumption)(unsafe.Pointer(&in.ConsumesCounter))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes))
out.Taints = *(*[]resource.DeviceTaint)(unsafe.Pointer(&in.Taints))
return nil
}
@@ -485,6 +519,10 @@ func Convert_v1beta1_BasicDevice_To_resource_BasicDevice(in *resourcev1beta1.Bas
func autoConvert_resource_BasicDevice_To_v1beta1_BasicDevice(in *resource.BasicDevice, out *resourcev1beta1.BasicDevice, s conversion.Scope) error {
out.Attributes = *(*map[resourcev1beta1.QualifiedName]resourcev1beta1.DeviceAttribute)(unsafe.Pointer(&in.Attributes))
out.Capacity = *(*map[resourcev1beta1.QualifiedName]resourcev1beta1.DeviceCapacity)(unsafe.Pointer(&in.Capacity))
out.ConsumesCounter = *(*[]resourcev1beta1.DeviceCounterConsumption)(unsafe.Pointer(&in.ConsumesCounter))
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.NodeSelector = (*corev1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes))
out.Taints = *(*[]resourcev1beta1.DeviceTaint)(unsafe.Pointer(&in.Taints))
return nil
}
@@ -514,6 +552,48 @@ func Convert_resource_CELDeviceSelector_To_v1beta1_CELDeviceSelector(in *resourc
return autoConvert_resource_CELDeviceSelector_To_v1beta1_CELDeviceSelector(in, out, s)
}
func autoConvert_v1beta1_Counter_To_resource_Counter(in *resourcev1beta1.Counter, out *resource.Counter, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_v1beta1_Counter_To_resource_Counter is an autogenerated conversion function.
func Convert_v1beta1_Counter_To_resource_Counter(in *resourcev1beta1.Counter, out *resource.Counter, s conversion.Scope) error {
return autoConvert_v1beta1_Counter_To_resource_Counter(in, out, s)
}
func autoConvert_resource_Counter_To_v1beta1_Counter(in *resource.Counter, out *resourcev1beta1.Counter, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_resource_Counter_To_v1beta1_Counter is an autogenerated conversion function.
func Convert_resource_Counter_To_v1beta1_Counter(in *resource.Counter, out *resourcev1beta1.Counter, s conversion.Scope) error {
return autoConvert_resource_Counter_To_v1beta1_Counter(in, out, s)
}
func autoConvert_v1beta1_CounterSet_To_resource_CounterSet(in *resourcev1beta1.CounterSet, out *resource.CounterSet, s conversion.Scope) error {
out.Name = in.Name
out.Counters = *(*map[string]resource.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_v1beta1_CounterSet_To_resource_CounterSet is an autogenerated conversion function.
func Convert_v1beta1_CounterSet_To_resource_CounterSet(in *resourcev1beta1.CounterSet, out *resource.CounterSet, s conversion.Scope) error {
return autoConvert_v1beta1_CounterSet_To_resource_CounterSet(in, out, s)
}
func autoConvert_resource_CounterSet_To_v1beta1_CounterSet(in *resource.CounterSet, out *resourcev1beta1.CounterSet, s conversion.Scope) error {
out.Name = in.Name
out.Counters = *(*map[string]resourcev1beta1.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_resource_CounterSet_To_v1beta1_CounterSet is an autogenerated conversion function.
func Convert_resource_CounterSet_To_v1beta1_CounterSet(in *resource.CounterSet, out *resourcev1beta1.CounterSet, s conversion.Scope) error {
return autoConvert_resource_CounterSet_To_v1beta1_CounterSet(in, out, s)
}
func autoConvert_v1beta1_Device_To_resource_Device(in *resourcev1beta1.Device, out *resource.Device, s conversion.Scope) error {
out.Name = in.Name
out.Basic = (*resource.BasicDevice)(unsafe.Pointer(in.Basic))
@@ -818,6 +898,28 @@ func Convert_resource_DeviceConstraint_To_v1beta1_DeviceConstraint(in *resource.
return autoConvert_resource_DeviceConstraint_To_v1beta1_DeviceConstraint(in, out, s)
}
func autoConvert_v1beta1_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(in *resourcev1beta1.DeviceCounterConsumption, out *resource.DeviceCounterConsumption, s conversion.Scope) error {
out.SharedCounter = in.SharedCounter
out.Counters = *(*map[string]resource.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_v1beta1_DeviceCounterConsumption_To_resource_DeviceCounterConsumption is an autogenerated conversion function.
func Convert_v1beta1_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(in *resourcev1beta1.DeviceCounterConsumption, out *resource.DeviceCounterConsumption, s conversion.Scope) error {
return autoConvert_v1beta1_DeviceCounterConsumption_To_resource_DeviceCounterConsumption(in, out, s)
}
func autoConvert_resource_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in *resource.DeviceCounterConsumption, out *resourcev1beta1.DeviceCounterConsumption, s conversion.Scope) error {
out.SharedCounter = in.SharedCounter
out.Counters = *(*map[string]resourcev1beta1.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_resource_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption is an autogenerated conversion function.
func Convert_resource_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in *resource.DeviceCounterConsumption, out *resourcev1beta1.DeviceCounterConsumption, s conversion.Scope) error {
return autoConvert_resource_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in, out, s)
}
func autoConvert_v1beta1_DeviceRequest_To_resource_DeviceRequest(in *resourcev1beta1.DeviceRequest, out *resource.DeviceRequest, s conversion.Scope) error {
out.Name = in.Name
out.DeviceClassName = in.DeviceClassName
@@ -1315,6 +1417,8 @@ func autoConvert_v1beta1_ResourceSliceSpec_To_resource_ResourceSliceSpec(in *res
out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = in.AllNodes
out.Devices = *(*[]resource.Device)(unsafe.Pointer(&in.Devices))
out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection))
out.SharedCounters = *(*[]resource.CounterSet)(unsafe.Pointer(&in.SharedCounters))
return nil
}
@@ -1332,6 +1436,8 @@ func autoConvert_resource_ResourceSliceSpec_To_v1beta1_ResourceSliceSpec(in *res
out.NodeSelector = (*corev1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = in.AllNodes
out.Devices = *(*[]resourcev1beta1.Device)(unsafe.Pointer(&in.Devices))
out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection))
out.SharedCounters = *(*[]resourcev1beta1.CounterSet)(unsafe.Pointer(&in.SharedCounters))
return nil
}

View File

@@ -99,6 +99,28 @@ func (in *BasicDevice) DeepCopyInto(out *BasicDevice) {
(*out)[key] = *val.DeepCopy()
}
}
if in.ConsumesCounter != nil {
in, out := &in.ConsumesCounter, &out.ConsumesCounter
*out = make([]DeviceCounterConsumption, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.NodeName != nil {
in, out := &in.NodeName, &out.NodeName
*out = new(string)
**out = **in
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = new(core.NodeSelector)
(*in).DeepCopyInto(*out)
}
if in.AllNodes != nil {
in, out := &in.AllNodes, &out.AllNodes
*out = new(bool)
**out = **in
}
if in.Taints != nil {
in, out := &in.Taints, &out.Taints
*out = make([]DeviceTaint, len(*in))
@@ -135,6 +157,46 @@ func (in *CELDeviceSelector) DeepCopy() *CELDeviceSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Counter) DeepCopyInto(out *Counter) {
*out = *in
out.Value = in.Value.DeepCopy()
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Counter.
func (in *Counter) DeepCopy() *Counter {
if in == nil {
return nil
}
out := new(Counter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CounterSet) DeepCopyInto(out *CounterSet) {
*out = *in
if in.Counters != nil {
in, out := &in.Counters, &out.Counters
*out = make(map[string]Counter, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CounterSet.
func (in *CounterSet) DeepCopy() *CounterSet {
if in == nil {
return nil
}
out := new(CounterSet)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Device) DeepCopyInto(out *Device) {
*out = *in
@@ -474,6 +536,29 @@ func (in *DeviceConstraint) DeepCopy() *DeviceConstraint {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeviceCounterConsumption) DeepCopyInto(out *DeviceCounterConsumption) {
*out = *in
if in.Counters != nil {
in, out := &in.Counters, &out.Counters
*out = make(map[string]Counter, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceCounterConsumption.
func (in *DeviceCounterConsumption) DeepCopy() *DeviceCounterConsumption {
if in == nil {
return nil
}
out := new(DeviceCounterConsumption)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) {
*out = *in
@@ -1096,6 +1181,18 @@ func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PerDeviceNodeSelection != nil {
in, out := &in.PerDeviceNodeSelection, &out.PerDeviceNodeSelection
*out = new(bool)
**out = **in
}
if in.SharedCounters != nil {
in, out := &in.SharedCounters, &out.SharedCounters
*out = make([]CounterSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}

View File

@@ -921,6 +921,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"k8s.io/api/resource/v1alpha3.AllocationResult": schema_k8sio_api_resource_v1alpha3_AllocationResult(ref),
"k8s.io/api/resource/v1alpha3.BasicDevice": schema_k8sio_api_resource_v1alpha3_BasicDevice(ref),
"k8s.io/api/resource/v1alpha3.CELDeviceSelector": schema_k8sio_api_resource_v1alpha3_CELDeviceSelector(ref),
"k8s.io/api/resource/v1alpha3.Counter": schema_k8sio_api_resource_v1alpha3_Counter(ref),
"k8s.io/api/resource/v1alpha3.CounterSet": schema_k8sio_api_resource_v1alpha3_CounterSet(ref),
"k8s.io/api/resource/v1alpha3.Device": schema_k8sio_api_resource_v1alpha3_Device(ref),
"k8s.io/api/resource/v1alpha3.DeviceAllocationConfiguration": schema_k8sio_api_resource_v1alpha3_DeviceAllocationConfiguration(ref),
"k8s.io/api/resource/v1alpha3.DeviceAllocationResult": schema_k8sio_api_resource_v1alpha3_DeviceAllocationResult(ref),
@@ -933,6 +935,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"k8s.io/api/resource/v1alpha3.DeviceClassSpec": schema_k8sio_api_resource_v1alpha3_DeviceClassSpec(ref),
"k8s.io/api/resource/v1alpha3.DeviceConfiguration": schema_k8sio_api_resource_v1alpha3_DeviceConfiguration(ref),
"k8s.io/api/resource/v1alpha3.DeviceConstraint": schema_k8sio_api_resource_v1alpha3_DeviceConstraint(ref),
"k8s.io/api/resource/v1alpha3.DeviceCounterConsumption": schema_k8sio_api_resource_v1alpha3_DeviceCounterConsumption(ref),
"k8s.io/api/resource/v1alpha3.DeviceRequest": schema_k8sio_api_resource_v1alpha3_DeviceRequest(ref),
"k8s.io/api/resource/v1alpha3.DeviceRequestAllocationResult": schema_k8sio_api_resource_v1alpha3_DeviceRequestAllocationResult(ref),
"k8s.io/api/resource/v1alpha3.DeviceSelector": schema_k8sio_api_resource_v1alpha3_DeviceSelector(ref),
@@ -961,6 +964,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"k8s.io/api/resource/v1beta1.AllocationResult": schema_k8sio_api_resource_v1beta1_AllocationResult(ref),
"k8s.io/api/resource/v1beta1.BasicDevice": schema_k8sio_api_resource_v1beta1_BasicDevice(ref),
"k8s.io/api/resource/v1beta1.CELDeviceSelector": schema_k8sio_api_resource_v1beta1_CELDeviceSelector(ref),
"k8s.io/api/resource/v1beta1.Counter": schema_k8sio_api_resource_v1beta1_Counter(ref),
"k8s.io/api/resource/v1beta1.CounterSet": schema_k8sio_api_resource_v1beta1_CounterSet(ref),
"k8s.io/api/resource/v1beta1.Device": schema_k8sio_api_resource_v1beta1_Device(ref),
"k8s.io/api/resource/v1beta1.DeviceAllocationConfiguration": schema_k8sio_api_resource_v1beta1_DeviceAllocationConfiguration(ref),
"k8s.io/api/resource/v1beta1.DeviceAllocationResult": schema_k8sio_api_resource_v1beta1_DeviceAllocationResult(ref),
@@ -974,6 +979,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"k8s.io/api/resource/v1beta1.DeviceClassSpec": schema_k8sio_api_resource_v1beta1_DeviceClassSpec(ref),
"k8s.io/api/resource/v1beta1.DeviceConfiguration": schema_k8sio_api_resource_v1beta1_DeviceConfiguration(ref),
"k8s.io/api/resource/v1beta1.DeviceConstraint": schema_k8sio_api_resource_v1beta1_DeviceConstraint(ref),
"k8s.io/api/resource/v1beta1.DeviceCounterConsumption": schema_k8sio_api_resource_v1beta1_DeviceCounterConsumption(ref),
"k8s.io/api/resource/v1beta1.DeviceRequest": schema_k8sio_api_resource_v1beta1_DeviceRequest(ref),
"k8s.io/api/resource/v1beta1.DeviceRequestAllocationResult": schema_k8sio_api_resource_v1beta1_DeviceRequestAllocationResult(ref),
"k8s.io/api/resource/v1beta1.DeviceSelector": schema_k8sio_api_resource_v1beta1_DeviceSelector(ref),
@@ -47260,6 +47266,45 @@ func schema_k8sio_api_resource_v1alpha3_BasicDevice(ref common.ReferenceCallback
},
},
},
"consumesCounter": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-list-type": "atomic",
},
},
SchemaProps: spec.SchemaProps{
Description: "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1alpha3.DeviceCounterConsumption"),
},
},
},
},
},
"nodeName": {
SchemaProps: spec.SchemaProps{
Description: "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.",
Type: []string{"string"},
Format: "",
},
},
"nodeSelector": {
SchemaProps: spec.SchemaProps{
Description: "NodeSelector defines the nodes 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.",
Ref: ref("k8s.io/api/core/v1.NodeSelector"),
},
},
"allNodes": {
SchemaProps: spec.SchemaProps{
Description: "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.",
Type: []string{"boolean"},
Format: "",
},
},
"taints": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
@@ -47283,7 +47328,7 @@ func schema_k8sio_api_resource_v1alpha3_BasicDevice(ref common.ReferenceCallback
},
},
Dependencies: []string{
"k8s.io/api/resource/v1alpha3.DeviceAttribute", "k8s.io/api/resource/v1alpha3.DeviceTaint", "k8s.io/apimachinery/pkg/api/resource.Quantity"},
"k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha3.DeviceAttribute", "k8s.io/api/resource/v1alpha3.DeviceCounterConsumption", "k8s.io/api/resource/v1alpha3.DeviceTaint", "k8s.io/apimachinery/pkg/api/resource.Quantity"},
}
}
@@ -47309,6 +47354,67 @@ func schema_k8sio_api_resource_v1alpha3_CELDeviceSelector(ref common.ReferenceCa
}
}
func schema_k8sio_api_resource_v1alpha3_Counter(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "Counter describes a quantity associated with a device.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"value": {
SchemaProps: spec.SchemaProps{
Description: "Value defines how much of a certain device counter is available.",
Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"),
},
},
},
Required: []string{"value"},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/api/resource.Quantity"},
}
}
func schema_k8sio_api_resource_v1alpha3_CounterSet(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Description: "Name defines the name of the counter set. It must be a DNS label.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"counters": {
SchemaProps: spec.SchemaProps{
Description: "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nTo ensure this uniqueness, capacities defined by the vendor must be listed without the driver name as domain prefix in their name. All others must be listed with their domain prefix.\n\nThe maximum number of counters is 32.",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1alpha3.Counter"),
},
},
},
},
},
},
Required: []string{"name", "counters"},
},
},
Dependencies: []string{
"k8s.io/api/resource/v1alpha3.Counter"},
}
}
func schema_k8sio_api_resource_v1alpha3_Device(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -47826,6 +47932,45 @@ func schema_k8sio_api_resource_v1alpha3_DeviceConstraint(ref common.ReferenceCal
}
}
func schema_k8sio_api_resource_v1alpha3_DeviceCounterConsumption(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"sharedCounter": {
SchemaProps: spec.SchemaProps{
Description: "SharedCounter defines the shared counter from which the counters defined will be consumed.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"counters": {
SchemaProps: spec.SchemaProps{
Description: "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1alpha3.Counter"),
},
},
},
},
},
},
Required: []string{"sharedCounter", "counters"},
},
},
Dependencies: []string{
"k8s.io/api/resource/v1alpha3.Counter"},
}
}
func schema_k8sio_api_resource_v1alpha3_DeviceRequest(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -48995,20 +49140,20 @@ func schema_k8sio_api_resource_v1alpha3_ResourceSliceSpec(ref common.ReferenceCa
},
"nodeName": {
SchemaProps: spec.SchemaProps{
Description: "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
Description: "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
Type: []string{"string"},
Format: "",
},
},
"nodeSelector": {
SchemaProps: spec.SchemaProps{
Description: "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
Description: "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
Ref: ref("k8s.io/api/core/v1.NodeSelector"),
},
},
"allNodes": {
SchemaProps: spec.SchemaProps{
Description: "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
Description: "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
Type: []string{"boolean"},
Format: "",
},
@@ -49032,12 +49177,38 @@ func schema_k8sio_api_resource_v1alpha3_ResourceSliceSpec(ref common.ReferenceCa
},
},
},
"perDeviceNodeSelection": {
SchemaProps: spec.SchemaProps{
Description: "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
Type: []string{"boolean"},
Format: "",
},
},
"sharedCounters": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-list-type": "atomic",
},
},
SchemaProps: spec.SchemaProps{
Description: "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1alpha3.CounterSet"),
},
},
},
},
},
},
Required: []string{"driver", "pool"},
},
},
Dependencies: []string{
"k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha3.Device", "k8s.io/api/resource/v1alpha3.ResourcePool"},
"k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha3.CounterSet", "k8s.io/api/resource/v1alpha3.Device", "k8s.io/api/resource/v1alpha3.ResourcePool"},
}
}
@@ -49180,6 +49351,45 @@ func schema_k8sio_api_resource_v1beta1_BasicDevice(ref common.ReferenceCallback)
},
},
},
"consumesCounter": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-list-type": "atomic",
},
},
SchemaProps: spec.SchemaProps{
Description: "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1beta1.DeviceCounterConsumption"),
},
},
},
},
},
"nodeName": {
SchemaProps: spec.SchemaProps{
Description: "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.",
Type: []string{"string"},
Format: "",
},
},
"nodeSelector": {
SchemaProps: spec.SchemaProps{
Description: "NodeSelector defines the nodes 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.",
Ref: ref("k8s.io/api/core/v1.NodeSelector"),
},
},
"allNodes": {
SchemaProps: spec.SchemaProps{
Description: "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.",
Type: []string{"boolean"},
Format: "",
},
},
"taints": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
@@ -49203,7 +49413,7 @@ func schema_k8sio_api_resource_v1beta1_BasicDevice(ref common.ReferenceCallback)
},
},
Dependencies: []string{
"k8s.io/api/resource/v1beta1.DeviceAttribute", "k8s.io/api/resource/v1beta1.DeviceCapacity", "k8s.io/api/resource/v1beta1.DeviceTaint"},
"k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1beta1.DeviceAttribute", "k8s.io/api/resource/v1beta1.DeviceCapacity", "k8s.io/api/resource/v1beta1.DeviceCounterConsumption", "k8s.io/api/resource/v1beta1.DeviceTaint"},
}
}
@@ -49229,6 +49439,67 @@ func schema_k8sio_api_resource_v1beta1_CELDeviceSelector(ref common.ReferenceCal
}
}
func schema_k8sio_api_resource_v1beta1_Counter(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "Counter describes a quantity associated with a device.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"value": {
SchemaProps: spec.SchemaProps{
Description: "Value defines how much of a certain device counter is available.",
Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"),
},
},
},
Required: []string{"value"},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/api/resource.Quantity"},
}
}
func schema_k8sio_api_resource_v1beta1_CounterSet(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Description: "Name defines the name of the counter set. It must be a DNS label.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"counters": {
SchemaProps: spec.SchemaProps{
Description: "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nThe maximum number of counters is 32.",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1beta1.Counter"),
},
},
},
},
},
},
Required: []string{"name", "counters"},
},
},
Dependencies: []string{
"k8s.io/api/resource/v1beta1.Counter"},
}
}
func schema_k8sio_api_resource_v1beta1_Device(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -49768,6 +50039,45 @@ func schema_k8sio_api_resource_v1beta1_DeviceConstraint(ref common.ReferenceCall
}
}
func schema_k8sio_api_resource_v1beta1_DeviceCounterConsumption(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"sharedCounter": {
SchemaProps: spec.SchemaProps{
Description: "SharedCounter defines the shared counter from which the counters defined will be consumed.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"counters": {
SchemaProps: spec.SchemaProps{
Description: "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1beta1.Counter"),
},
},
},
},
},
},
Required: []string{"sharedCounter", "counters"},
},
},
Dependencies: []string{
"k8s.io/api/resource/v1beta1.Counter"},
}
}
func schema_k8sio_api_resource_v1beta1_DeviceRequest(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -50751,20 +51061,20 @@ func schema_k8sio_api_resource_v1beta1_ResourceSliceSpec(ref common.ReferenceCal
},
"nodeName": {
SchemaProps: spec.SchemaProps{
Description: "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
Description: "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
Type: []string{"string"},
Format: "",
},
},
"nodeSelector": {
SchemaProps: spec.SchemaProps{
Description: "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
Description: "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
Ref: ref("k8s.io/api/core/v1.NodeSelector"),
},
},
"allNodes": {
SchemaProps: spec.SchemaProps{
Description: "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
Description: "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
Type: []string{"boolean"},
Format: "",
},
@@ -50788,12 +51098,38 @@ func schema_k8sio_api_resource_v1beta1_ResourceSliceSpec(ref common.ReferenceCal
},
},
},
"perDeviceNodeSelection": {
SchemaProps: spec.SchemaProps{
Description: "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
Type: []string{"boolean"},
Format: "",
},
},
"sharedCounters": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-list-type": "atomic",
},
},
SchemaProps: spec.SchemaProps{
Description: "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/api/resource/v1beta1.CounterSet"),
},
},
},
},
},
},
Required: []string{"driver", "pool"},
},
},
Dependencies: []string{
"k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1beta1.Device", "k8s.io/api/resource/v1beta1.ResourcePool"},
"k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1beta1.CounterSet", "k8s.io/api/resource/v1beta1.Device", "k8s.io/api/resource/v1beta1.ResourcePool"},
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -114,6 +114,51 @@ message BasicDevice {
// +optional
map<string, .k8s.io.apimachinery.pkg.api.resource.Quantity> capacity = 2;
// ConsumesCounter defines a list of references to sharedCounters
// and the set of counters that the device will
// consume from those counter sets.
//
// There can only be a single entry per counterSet.
//
// The maximum number of device counter consumption entries
// is 32. This is the same as the maximum number of shared counters
// allowed in a ResourceSlice.
//
// +optional
// +listType=atomic
// +featureGate=DRAPartitionableDevices
repeated DeviceCounterConsumption consumesCounter = 3;
// NodeName identifies the node where the device is available.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional string nodeName = 4;
// NodeSelector defines the nodes where the device is available.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 5;
// AllNodes indicates that all nodes have access to the device.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional bool allNodes = 6;
// If specified, these are the driver-defined taints.
//
// The maximum number of taints is 8.
@@ -124,7 +169,7 @@ message BasicDevice {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
repeated DeviceTaint taints = 3;
repeated DeviceTaint taints = 7;
}
// CELDeviceSelector contains a CEL expression for selecting a device.
@@ -184,6 +229,42 @@ message CELDeviceSelector {
optional string expression = 1;
}
// Counter describes a quantity associated with a device.
message Counter {
// Value defines how much of a certain device counter is available.
//
// +required
optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
}
// CounterSet defines a named set of counters
// that are available to be used by devices defined in the
// ResourceSlice.
//
// The counters are not allocatable by themselves, but
// can be referenced by devices. When a device is allocated,
// the portion of counters it uses will no longer be available for use
// by other devices.
message CounterSet {
// Name defines the name of the counter set.
// It must be a DNS label.
//
// +required
optional string name = 1;
// Counters defines the set of counters for this CounterSet
// The name of each counter must be unique in that set and must be a DNS label.
//
// To ensure this uniqueness, capacities defined by the vendor
// must be listed without the driver name as domain prefix in
// their name. All others must be listed with their domain prefix.
//
// The maximum number of counters is 32.
//
// +required
map<string, Counter> counters = 2;
}
// Device represents one individual hardware instance that can be selected based
// on its attributes. Besides the name, exactly one field must be set.
message Device {
@@ -416,6 +497,24 @@ message DeviceConstraint {
optional string matchAttribute = 2;
}
// DeviceCounterConsumption defines a set of counters that
// a device will consume from a CounterSet.
message DeviceCounterConsumption {
// SharedCounter defines the shared counter from which the
// counters defined will be consumed.
//
// +required
optional string sharedCounter = 1;
// Counters defines the Counter that will be consumed by
// the device.
//
// The maximum number of Counters is 32.
//
// +required
map<string, Counter> counters = 2;
}
// DeviceRequest is a request for devices required for a claim.
// This is typically a request for a single resource like a device, but can
// also ask for several identical devices.
@@ -1208,7 +1307,7 @@ message ResourceSliceSpec {
// new nodes of the same type as some old node might also make new
// resources available.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
// This field is immutable.
//
// +optional
@@ -1220,7 +1319,7 @@ message ResourceSliceSpec {
//
// Must use exactly one term.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
@@ -1228,7 +1327,7 @@ message ResourceSliceSpec {
// AllNodes indicates that all nodes have access to the resources in the pool.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
@@ -1241,5 +1340,29 @@ message ResourceSliceSpec {
// +optional
// +listType=atomic
repeated Device devices = 6;
// PerDeviceNodeSelection defines whether the access from nodes to
// resources in the pool is set on the ResourceSlice level or on each
// device. If it is set to true, every device defined the ResourceSlice
// must specify this individually.
//
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
// +featureGate=DRAPartitionableDevices
optional bool perDeviceNodeSelection = 7;
// SharedCounters defines a list of counter sets, each of which
// has a name and a list of counters available.
//
// The names of the SharedCounters must be unique in the ResourceSlice.
//
// The maximum number of SharedCounters is 32.
//
// +optional
// +listType=atomic
// +featureGate=DRAPartitionableDevices
repeated CounterSet sharedCounters = 8;
}

View File

@@ -329,7 +329,6 @@ type BasicDevice struct {
// +featureGate=DRAPartitionableDevices
AllNodes *bool `json:"allNodes,omitempty" protobuf:"bytes,6,opt,name=allNodes"`
// If specified, these are the driver-defined taints.
//
// The maximum number of taints is 8.

View File

@@ -52,10 +52,14 @@ func (AllocationResult) SwaggerDoc() map[string]string {
}
var map_BasicDevice = map[string]string{
"": "BasicDevice defines one device instance.",
"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.",
"taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
"": "BasicDevice defines one device instance.",
"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.",
"consumesCounter": "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
"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 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 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
}
func (BasicDevice) SwaggerDoc() map[string]string {
@@ -71,6 +75,25 @@ func (CELDeviceSelector) SwaggerDoc() map[string]string {
return map_CELDeviceSelector
}
var map_Counter = map[string]string{
"": "Counter describes a quantity associated with a device.",
"value": "Value defines how much of a certain device counter is available.",
}
func (Counter) SwaggerDoc() map[string]string {
return map_Counter
}
var map_CounterSet = map[string]string{
"": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
"name": "Name defines the name of the counter set. It must be a DNS label.",
"counters": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nTo ensure this uniqueness, capacities defined by the vendor must be listed without the driver name as domain prefix in their name. All others must be listed with their domain prefix.\n\nThe maximum number of counters is 32.",
}
func (CounterSet) SwaggerDoc() map[string]string {
return map_CounterSet
}
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.",
@@ -190,6 +213,16 @@ func (DeviceConstraint) SwaggerDoc() map[string]string {
return map_DeviceConstraint
}
var map_DeviceCounterConsumption = map[string]string{
"": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
"sharedCounter": "SharedCounter defines the shared counter from which the counters defined will be consumed.",
"counters": "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
}
func (DeviceCounterConsumption) SwaggerDoc() map[string]string {
return map_DeviceCounterConsumption
}
var map_DeviceRequest = map[string]string{
"": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.",
"name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nMust be a DNS label.",
@@ -447,13 +480,15 @@ func (ResourceSliceList) SwaggerDoc() map[string]string {
}
var map_ResourceSliceSpec = map[string]string{
"": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"driver": "Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable.",
"pool": "Pool describes the pool that this ResourceSlice belongs to.",
"nodeName": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
"nodeSelector": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"allNodes": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.",
"": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"driver": "Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable.",
"pool": "Pool describes the pool that this ResourceSlice belongs to.",
"nodeName": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
"nodeSelector": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"allNodes": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.",
"perDeviceNodeSelection": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"sharedCounters": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
}
func (ResourceSliceSpec) SwaggerDoc() map[string]string {

View File

@@ -100,6 +100,28 @@ func (in *BasicDevice) DeepCopyInto(out *BasicDevice) {
(*out)[key] = val.DeepCopy()
}
}
if in.ConsumesCounter != nil {
in, out := &in.ConsumesCounter, &out.ConsumesCounter
*out = make([]DeviceCounterConsumption, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.NodeName != nil {
in, out := &in.NodeName, &out.NodeName
*out = new(string)
**out = **in
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = new(corev1.NodeSelector)
(*in).DeepCopyInto(*out)
}
if in.AllNodes != nil {
in, out := &in.AllNodes, &out.AllNodes
*out = new(bool)
**out = **in
}
if in.Taints != nil {
in, out := &in.Taints, &out.Taints
*out = make([]DeviceTaint, len(*in))
@@ -136,6 +158,46 @@ func (in *CELDeviceSelector) DeepCopy() *CELDeviceSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Counter) DeepCopyInto(out *Counter) {
*out = *in
out.Value = in.Value.DeepCopy()
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Counter.
func (in *Counter) DeepCopy() *Counter {
if in == nil {
return nil
}
out := new(Counter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CounterSet) DeepCopyInto(out *CounterSet) {
*out = *in
if in.Counters != nil {
in, out := &in.Counters, &out.Counters
*out = make(map[string]Counter, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CounterSet.
func (in *CounterSet) DeepCopy() *CounterSet {
if in == nil {
return nil
}
out := new(CounterSet)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Device) DeepCopyInto(out *Device) {
*out = *in
@@ -458,6 +520,29 @@ func (in *DeviceConstraint) DeepCopy() *DeviceConstraint {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeviceCounterConsumption) DeepCopyInto(out *DeviceCounterConsumption) {
*out = *in
if in.Counters != nil {
in, out := &in.Counters, &out.Counters
*out = make(map[string]Counter, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceCounterConsumption.
func (in *DeviceCounterConsumption) DeepCopy() *DeviceCounterConsumption {
if in == nil {
return nil
}
out := new(DeviceCounterConsumption)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) {
*out = *in
@@ -1080,6 +1165,18 @@ func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PerDeviceNodeSelection != nil {
in, out := &in.PerDeviceNodeSelection, &out.PerDeviceNodeSelection
*out = new(bool)
**out = **in
}
if in.SharedCounters != nil {
in, out := &in.SharedCounters, &out.SharedCounters
*out = make([]CounterSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}

File diff suppressed because it is too large Load Diff

View File

@@ -114,6 +114,50 @@ message BasicDevice {
// +optional
map<string, DeviceCapacity> capacity = 2;
// ConsumesCounter defines a list of references to sharedCounters
// and the set of counters that the device will
// consume from those counter sets.
//
// There can only be a single entry per counterSet.
//
// The maximum number of device counter consumption entries
// is 32. This is the same as the maximum number of shared counters
// allowed in a ResourceSlice.
//
// +optional
// +listType=atomic
// +featureGate=DRAPartitionableDevices
repeated DeviceCounterConsumption consumesCounter = 3;
// NodeName identifies the node where the device is available.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional string nodeName = 4;
// NodeSelector defines the nodes where the device is available.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 5;
// AllNodes indicates that all nodes have access to the device.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional bool allNodes = 6;
// If specified, these are the driver-defined taints.
//
// The maximum number of taints is 8.
@@ -124,7 +168,7 @@ message BasicDevice {
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
repeated DeviceTaint taints = 3;
repeated DeviceTaint taints = 7;
}
// CELDeviceSelector contains a CEL expression for selecting a device.
@@ -184,6 +228,38 @@ message CELDeviceSelector {
optional string expression = 1;
}
// Counter describes a quantity associated with a device.
message Counter {
// Value defines how much of a certain device counter is available.
//
// +required
optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
}
// CounterSet defines a named set of counters
// that are available to be used by devices defined in the
// ResourceSlice.
//
// The counters are not allocatable by themselves, but
// can be referenced by devices. When a device is allocated,
// the portion of counters it uses will no longer be available for use
// by other devices.
message CounterSet {
// Name defines the name of the counter set.
// It must be a DNS label.
//
// +required
optional string name = 1;
// Counters defines the set of counters for this CounterSet
// The name of each counter must be unique in that set and must be a DNS label.
//
// The maximum number of counters is 32.
//
// +required
map<string, Counter> counters = 2;
}
// Device represents one individual hardware instance that can be selected based
// on its attributes. Besides the name, exactly one field must be set.
message Device {
@@ -424,6 +500,24 @@ message DeviceConstraint {
optional string matchAttribute = 2;
}
// DeviceCounterConsumption defines a set of counters that
// a device will consume from a CounterSet.
message DeviceCounterConsumption {
// SharedCounter defines the shared counter from which the
// counters defined will be consumed.
//
// +required
optional string sharedCounter = 1;
// Counters defines the Counter that will be consumed by
// the device.
//
// The maximum number of Counters is 32.
//
// +required
map<string, Counter> counters = 2;
}
// DeviceRequest is a request for devices required for a claim.
// This is typically a request for a single resource like a device, but can
// also ask for several identical devices.
@@ -1132,7 +1226,7 @@ message ResourceSliceSpec {
// new nodes of the same type as some old node might also make new
// resources available.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
// This field is immutable.
//
// +optional
@@ -1144,7 +1238,7 @@ message ResourceSliceSpec {
//
// Must use exactly one term.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
@@ -1152,7 +1246,7 @@ message ResourceSliceSpec {
// AllNodes indicates that all nodes have access to the resources in the pool.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
@@ -1165,5 +1259,29 @@ message ResourceSliceSpec {
// +optional
// +listType=atomic
repeated Device devices = 6;
// PerDeviceNodeSelection defines whether the access from nodes to
// resources in the pool is set on the ResourceSlice level or on each
// device. If it is set to true, every device defined the ResourceSlice
// must specify this individually.
//
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
// +featureGate=DRAPartitionableDevices
optional bool perDeviceNodeSelection = 7;
// SharedCounters defines a list of counter sets, each of which
// has a name and a list of counters available.
//
// The names of the SharedCounters must be unique in the ResourceSlice.
//
// The maximum number of SharedCounters is 32.
//
// +optional
// +listType=atomic
// +featureGate=DRAPartitionableDevices
repeated CounterSet sharedCounters = 8;
}

View File

@@ -52,10 +52,14 @@ func (AllocationResult) SwaggerDoc() map[string]string {
}
var map_BasicDevice = map[string]string{
"": "BasicDevice defines one device instance.",
"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.",
"taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
"": "BasicDevice defines one device instance.",
"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.",
"consumesCounter": "ConsumesCounter 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 consumption entries is 32. This is the same as the maximum number of shared counters allowed in a ResourceSlice.",
"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 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 8.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.",
}
func (BasicDevice) SwaggerDoc() map[string]string {
@@ -71,6 +75,25 @@ func (CELDeviceSelector) SwaggerDoc() map[string]string {
return map_CELDeviceSelector
}
var map_Counter = map[string]string{
"": "Counter describes a quantity associated with a device.",
"value": "Value defines how much of a certain device counter is available.",
}
func (Counter) SwaggerDoc() map[string]string {
return map_Counter
}
var map_CounterSet = map[string]string{
"": "CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice.\n\nThe counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices.",
"name": "Name defines the name of the counter set. It must be a DNS label.",
"counters": "Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label.\n\nThe maximum number of counters is 32.",
}
func (CounterSet) SwaggerDoc() map[string]string {
return map_CounterSet
}
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.",
@@ -199,6 +222,16 @@ func (DeviceConstraint) SwaggerDoc() map[string]string {
return map_DeviceConstraint
}
var map_DeviceCounterConsumption = map[string]string{
"": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.",
"sharedCounter": "SharedCounter defines the shared counter from which the counters defined will be consumed.",
"counters": "Counters defines the Counter that will be consumed by the device.\n\nThe maximum number of Counters is 32.",
}
func (DeviceCounterConsumption) SwaggerDoc() map[string]string {
return map_DeviceCounterConsumption
}
var map_DeviceRequest = map[string]string{
"": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.",
"name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nMust be a DNS label and unique among all DeviceRequests in a ResourceClaim.",
@@ -413,13 +446,15 @@ func (ResourceSliceList) SwaggerDoc() map[string]string {
}
var map_ResourceSliceSpec = map[string]string{
"": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"driver": "Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable.",
"pool": "Pool describes the pool that this ResourceSlice belongs to.",
"nodeName": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.",
"nodeSelector": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"allNodes": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set.",
"devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.",
"": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.",
"driver": "Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable.",
"pool": "Pool describes the pool that this ResourceSlice belongs to.",
"nodeName": "NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.\n\nThis field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set. This field is immutable.",
"nodeSelector": "NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.\n\nMust use exactly one term.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"allNodes": "AllNodes indicates that all nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.",
"perDeviceNodeSelection": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.",
"sharedCounters": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the SharedCounters must be unique in the ResourceSlice.\n\nThe maximum number of SharedCounters is 32.",
}
func (ResourceSliceSpec) SwaggerDoc() map[string]string {

View File

@@ -99,6 +99,28 @@ func (in *BasicDevice) DeepCopyInto(out *BasicDevice) {
(*out)[key] = *val.DeepCopy()
}
}
if in.ConsumesCounter != nil {
in, out := &in.ConsumesCounter, &out.ConsumesCounter
*out = make([]DeviceCounterConsumption, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.NodeName != nil {
in, out := &in.NodeName, &out.NodeName
*out = new(string)
**out = **in
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = new(corev1.NodeSelector)
(*in).DeepCopyInto(*out)
}
if in.AllNodes != nil {
in, out := &in.AllNodes, &out.AllNodes
*out = new(bool)
**out = **in
}
if in.Taints != nil {
in, out := &in.Taints, &out.Taints
*out = make([]DeviceTaint, len(*in))
@@ -135,6 +157,46 @@ func (in *CELDeviceSelector) DeepCopy() *CELDeviceSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Counter) DeepCopyInto(out *Counter) {
*out = *in
out.Value = in.Value.DeepCopy()
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Counter.
func (in *Counter) DeepCopy() *Counter {
if in == nil {
return nil
}
out := new(Counter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CounterSet) DeepCopyInto(out *CounterSet) {
*out = *in
if in.Counters != nil {
in, out := &in.Counters, &out.Counters
*out = make(map[string]Counter, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CounterSet.
func (in *CounterSet) DeepCopy() *CounterSet {
if in == nil {
return nil
}
out := new(CounterSet)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Device) DeepCopyInto(out *Device) {
*out = *in
@@ -474,6 +536,29 @@ func (in *DeviceConstraint) DeepCopy() *DeviceConstraint {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeviceCounterConsumption) DeepCopyInto(out *DeviceCounterConsumption) {
*out = *in
if in.Counters != nil {
in, out := &in.Counters, &out.Counters
*out = make(map[string]Counter, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceCounterConsumption.
func (in *DeviceCounterConsumption) DeepCopy() *DeviceCounterConsumption {
if in == nil {
return nil
}
out := new(DeviceCounterConsumption)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) {
*out = *in
@@ -971,6 +1056,18 @@ func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PerDeviceNodeSelection != nil {
in, out := &in.PerDeviceNodeSelection, &out.PerDeviceNodeSelection
*out = new(bool)
**out = **in
}
if in.SharedCounters != nil {
in, out := &in.SharedCounters, &out.SharedCounters
*out = make([]CounterSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}

View File

@@ -91,6 +91,42 @@
"capacity": {
"capacityKey": "0"
},
"consumesCounter": [
{
"sharedCounter": "sharedCounterValue",
"counters": {
"countersKey": {
"value": "0"
}
}
}
],
"nodeName": "nodeNameValue",
"nodeSelector": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "keyValue",
"operator": "operatorValue",
"values": [
"valuesValue"
]
}
],
"matchFields": [
{
"key": "keyValue",
"operator": "operatorValue",
"values": [
"valuesValue"
]
}
]
}
]
},
"allNodes": true,
"taints": [
{
"key": "keyValue",
@@ -101,6 +137,17 @@
]
}
}
],
"perDeviceNodeSelection": true,
"sharedCounters": [
{
"name": "nameValue",
"counters": {
"countersKey": {
"value": "0"
}
}
}
]
}
}

View File

@@ -36,6 +36,7 @@ spec:
allNodes: true
devices:
- basic:
allNodes: true
attributes:
attributesKey:
bool: true
@@ -44,6 +45,24 @@ spec:
version: versionValue
capacity:
capacityKey: "0"
consumesCounter:
- counters:
countersKey:
value: "0"
sharedCounter: sharedCounterValue
nodeName: nodeNameValue
nodeSelector:
nodeSelectorTerms:
- matchExpressions:
- key: keyValue
operator: operatorValue
values:
- valuesValue
matchFields:
- key: keyValue
operator: operatorValue
values:
- valuesValue
taints:
- effect: effectValue
key: keyValue
@@ -64,7 +83,13 @@ spec:
operator: operatorValue
values:
- valuesValue
perDeviceNodeSelection: true
pool:
generation: 2
name: nameValue
resourceSliceCount: 3
sharedCounters:
- counters:
countersKey:
value: "0"
name: nameValue

View File

@@ -93,6 +93,42 @@
"value": "0"
}
},
"consumesCounter": [
{
"sharedCounter": "sharedCounterValue",
"counters": {
"countersKey": {
"value": "0"
}
}
}
],
"nodeName": "nodeNameValue",
"nodeSelector": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "keyValue",
"operator": "operatorValue",
"values": [
"valuesValue"
]
}
],
"matchFields": [
{
"key": "keyValue",
"operator": "operatorValue",
"values": [
"valuesValue"
]
}
]
}
]
},
"allNodes": true,
"taints": [
{
"key": "keyValue",
@@ -103,6 +139,17 @@
]
}
}
],
"perDeviceNodeSelection": true,
"sharedCounters": [
{
"name": "nameValue",
"counters": {
"countersKey": {
"value": "0"
}
}
}
]
}
}

View File

@@ -36,6 +36,7 @@ spec:
allNodes: true
devices:
- basic:
allNodes: true
attributes:
attributesKey:
bool: true
@@ -45,6 +46,24 @@ spec:
capacity:
capacityKey:
value: "0"
consumesCounter:
- counters:
countersKey:
value: "0"
sharedCounter: sharedCounterValue
nodeName: nodeNameValue
nodeSelector:
nodeSelectorTerms:
- matchExpressions:
- key: keyValue
operator: operatorValue
values:
- valuesValue
matchFields:
- key: keyValue
operator: operatorValue
values:
- valuesValue
taints:
- effect: effectValue
key: keyValue
@@ -65,7 +84,13 @@ spec:
operator: operatorValue
values:
- valuesValue
perDeviceNodeSelection: true
pool:
generation: 2
name: nameValue
resourceSliceCount: 3
sharedCounters:
- counters:
countersKey:
value: "0"
name: nameValue

View File

@@ -12606,6 +12606,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.resource.v1alpha3.BasicDevice
map:
fields:
- name: allNodes
type:
scalar: boolean
- name: attributes
type:
map:
@@ -12616,6 +12619,18 @@ var schemaYAML = typed.YAMLObject(`types:
map:
elementType:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: consumesCounter
type:
list:
elementType:
namedType: io.k8s.api.resource.v1alpha3.DeviceCounterConsumption
elementRelationship: atomic
- name: nodeName
type:
scalar: string
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: taints
type:
list:
@@ -12629,6 +12644,24 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.Counter
map:
fields:
- name: value
type:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: io.k8s.api.resource.v1alpha3.CounterSet
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1alpha3.Counter
- name: name
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.Device
map:
fields:
@@ -12768,6 +12801,18 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: string
elementRelationship: atomic
- name: io.k8s.api.resource.v1alpha3.DeviceCounterConsumption
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1alpha3.Counter
- name: sharedCounter
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.DeviceRequest
map:
fields:
@@ -13130,10 +13175,19 @@ var schemaYAML = typed.YAMLObject(`types:
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: perDeviceNodeSelection
type:
scalar: boolean
- name: pool
type:
namedType: io.k8s.api.resource.v1alpha3.ResourcePool
default: {}
- name: sharedCounters
type:
list:
elementType:
namedType: io.k8s.api.resource.v1alpha3.CounterSet
elementRelationship: atomic
- name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus
map:
fields:
@@ -13176,6 +13230,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.resource.v1beta1.BasicDevice
map:
fields:
- name: allNodes
type:
scalar: boolean
- name: attributes
type:
map:
@@ -13186,6 +13243,18 @@ var schemaYAML = typed.YAMLObject(`types:
map:
elementType:
namedType: io.k8s.api.resource.v1beta1.DeviceCapacity
- name: consumesCounter
type:
list:
elementType:
namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption
elementRelationship: atomic
- name: nodeName
type:
scalar: string
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: taints
type:
list:
@@ -13199,6 +13268,24 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1beta1.Counter
map:
fields:
- name: value
type:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- name: io.k8s.api.resource.v1beta1.CounterSet
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1beta1.Counter
- name: name
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1beta1.Device
map:
fields:
@@ -13344,6 +13431,18 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: string
elementRelationship: atomic
- name: io.k8s.api.resource.v1beta1.DeviceCounterConsumption
map:
fields:
- name: counters
type:
map:
elementType:
namedType: io.k8s.api.resource.v1beta1.Counter
- name: sharedCounter
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1beta1.DeviceRequest
map:
fields:
@@ -13658,10 +13757,19 @@ var schemaYAML = typed.YAMLObject(`types:
- name: nodeSelector
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: perDeviceNodeSelection
type:
scalar: boolean
- name: pool
type:
namedType: io.k8s.api.resource.v1beta1.ResourcePool
default: {}
- name: sharedCounters
type:
list:
elementType:
namedType: io.k8s.api.resource.v1beta1.CounterSet
elementRelationship: atomic
- name: io.k8s.api.scheduling.v1.PriorityClass
map:
fields:

View File

@@ -21,14 +21,19 @@ package v1alpha3
import (
resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
resource "k8s.io/apimachinery/pkg/api/resource"
v1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use
// with apply.
type BasicDeviceApplyConfiguration struct {
Attributes map[resourcev1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
Attributes map[resourcev1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"`
ConsumesCounter []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounter,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
}
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
@@ -65,6 +70,43 @@ func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1alpha
return b
}
// WithConsumesCounter adds the given value to the ConsumesCounter field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ConsumesCounter field.
func (b *BasicDeviceApplyConfiguration) WithConsumesCounter(values ...*DeviceCounterConsumptionApplyConfiguration) *BasicDeviceApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConsumesCounter")
}
b.ConsumesCounter = append(b.ConsumesCounter, *values[i])
}
return b
}
// WithNodeName sets the NodeName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeName field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeName(value string) *BasicDeviceApplyConfiguration {
b.NodeName = &value
return b
}
// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeSelector field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *BasicDeviceApplyConfiguration {
b.NodeSelector = value
return b
}
// WithAllNodes sets the AllNodes field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the AllNodes field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithAllNodes(value bool) *BasicDeviceApplyConfiguration {
b.AllNodes = &value
return b
}
// WithTaints adds the given value to the Taints field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Taints field.

View File

@@ -0,0 +1,43 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
// CounterApplyConfiguration represents a declarative configuration of the Counter type for use
// with apply.
type CounterApplyConfiguration struct {
Value *resource.Quantity `json:"value,omitempty"`
}
// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with
// apply.
func Counter() *CounterApplyConfiguration {
return &CounterApplyConfiguration{}
}
// WithValue sets the Value field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Value field is set to the value of the last call.
func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration {
b.Value = &value
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use
// with apply.
type CounterSetApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with
// apply.
func CounterSet() *CounterSetApplyConfiguration {
return &CounterSetApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration {
b.Name = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use
// with apply.
type DeviceCounterConsumptionApplyConfiguration struct {
SharedCounter *string `json:"sharedCounter,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with
// apply.
func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration {
return &DeviceCounterConsumptionApplyConfiguration{}
}
// WithSharedCounter sets the SharedCounter field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SharedCounter field is set to the value of the last call.
func (b *DeviceCounterConsumptionApplyConfiguration) WithSharedCounter(value string) *DeviceCounterConsumptionApplyConfiguration {
b.SharedCounter = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -25,12 +25,14 @@ import (
// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use
// with apply.
type ResourceSliceSpecApplyConfiguration struct {
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"`
SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"`
}
// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with
@@ -91,3 +93,24 @@ func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApply
}
return b
}
// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PerDeviceNodeSelection field is set to the value of the last call.
func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration {
b.PerDeviceNodeSelection = &value
return b
}
// WithSharedCounters adds the given value to the SharedCounters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the SharedCounters field.
func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithSharedCounters")
}
b.SharedCounters = append(b.SharedCounters, *values[i])
}
return b
}

View File

@@ -20,14 +20,19 @@ package v1beta1
import (
resourcev1beta1 "k8s.io/api/resource/v1beta1"
v1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use
// with apply.
type BasicDeviceApplyConfiguration struct {
Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"`
ConsumesCounter []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounter,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
}
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
@@ -64,6 +69,43 @@ func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1beta1
return b
}
// WithConsumesCounter adds the given value to the ConsumesCounter field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ConsumesCounter field.
func (b *BasicDeviceApplyConfiguration) WithConsumesCounter(values ...*DeviceCounterConsumptionApplyConfiguration) *BasicDeviceApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConsumesCounter")
}
b.ConsumesCounter = append(b.ConsumesCounter, *values[i])
}
return b
}
// WithNodeName sets the NodeName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeName field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeName(value string) *BasicDeviceApplyConfiguration {
b.NodeName = &value
return b
}
// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeSelector field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *BasicDeviceApplyConfiguration {
b.NodeSelector = value
return b
}
// WithAllNodes sets the AllNodes field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the AllNodes field is set to the value of the last call.
func (b *BasicDeviceApplyConfiguration) WithAllNodes(value bool) *BasicDeviceApplyConfiguration {
b.AllNodes = &value
return b
}
// WithTaints adds the given value to the Taints field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Taints field.

View File

@@ -0,0 +1,43 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
resource "k8s.io/apimachinery/pkg/api/resource"
)
// CounterApplyConfiguration represents a declarative configuration of the Counter type for use
// with apply.
type CounterApplyConfiguration struct {
Value *resource.Quantity `json:"value,omitempty"`
}
// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with
// apply.
func Counter() *CounterApplyConfiguration {
return &CounterApplyConfiguration{}
}
// WithValue sets the Value field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Value field is set to the value of the last call.
func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration {
b.Value = &value
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use
// with apply.
type CounterSetApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with
// apply.
func CounterSet() *CounterSetApplyConfiguration {
return &CounterSetApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration {
b.Name = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -0,0 +1,54 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use
// with apply.
type DeviceCounterConsumptionApplyConfiguration struct {
SharedCounter *string `json:"sharedCounter,omitempty"`
Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"`
}
// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with
// apply.
func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration {
return &DeviceCounterConsumptionApplyConfiguration{}
}
// WithSharedCounter sets the SharedCounter field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SharedCounter field is set to the value of the last call.
func (b *DeviceCounterConsumptionApplyConfiguration) WithSharedCounter(value string) *DeviceCounterConsumptionApplyConfiguration {
b.SharedCounter = &value
return b
}
// WithCounters puts the entries into the Counters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Counters field,
// overwriting an existing map entries in Counters field with the same key.
func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration {
if b.Counters == nil && len(entries) > 0 {
b.Counters = make(map[string]CounterApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Counters[k] = v
}
return b
}

View File

@@ -25,12 +25,14 @@ import (
// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use
// with apply.
type ResourceSliceSpecApplyConfiguration struct {
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
Driver *string `json:"driver,omitempty"`
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
AllNodes *bool `json:"allNodes,omitempty"`
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"`
SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"`
}
// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with
@@ -91,3 +93,24 @@ func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApply
}
return b
}
// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PerDeviceNodeSelection field is set to the value of the last call.
func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration {
b.PerDeviceNodeSelection = &value
return b
}
// WithSharedCounters adds the given value to the SharedCounters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the SharedCounters field.
func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithSharedCounters")
}
b.SharedCounters = append(b.SharedCounters, *values[i])
}
return b
}

View File

@@ -1616,6 +1616,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &resourcev1alpha3.BasicDeviceApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"):
return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("Counter"):
return &resourcev1alpha3.CounterApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("CounterSet"):
return &resourcev1alpha3.CounterSetApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("Device"):
return &resourcev1alpha3.DeviceApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"):
@@ -1638,6 +1642,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"):
return &resourcev1alpha3.DeviceConstraintApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceCounterConsumption"):
return &resourcev1alpha3.DeviceCounterConsumptionApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequest"):
return &resourcev1alpha3.DeviceRequestApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"):
@@ -1688,6 +1694,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsresourcev1beta1.BasicDeviceApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("CELDeviceSelector"):
return &applyconfigurationsresourcev1beta1.CELDeviceSelectorApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("Counter"):
return &applyconfigurationsresourcev1beta1.CounterApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("CounterSet"):
return &applyconfigurationsresourcev1beta1.CounterSetApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("Device"):
return &applyconfigurationsresourcev1beta1.DeviceApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"):
@@ -1712,6 +1722,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsresourcev1beta1.DeviceConfigurationApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceConstraint"):
return &applyconfigurationsresourcev1beta1.DeviceConstraintApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceCounterConsumption"):
return &applyconfigurationsresourcev1beta1.DeviceCounterConsumptionApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequest"):
return &applyconfigurationsresourcev1beta1.DeviceRequestApplyConfiguration{}
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"):

View File

@@ -24,9 +24,9 @@ package api
import (
unsafe "unsafe"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
v1beta1 "k8s.io/api/resource/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -48,6 +48,26 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*Counter)(nil), (*v1beta1.Counter)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_api_Counter_To_v1beta1_Counter(a.(*Counter), b.(*v1beta1.Counter), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1beta1.Counter)(nil), (*Counter)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_Counter_To_api_Counter(a.(*v1beta1.Counter), b.(*Counter), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CounterSet)(nil), (*v1beta1.CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_api_CounterSet_To_v1beta1_CounterSet(a.(*CounterSet), b.(*v1beta1.CounterSet), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1beta1.CounterSet)(nil), (*CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_CounterSet_To_api_CounterSet(a.(*v1beta1.CounterSet), b.(*CounterSet), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*Device)(nil), (*v1beta1.Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_api_Device_To_v1beta1_Device(a.(*Device), b.(*v1beta1.Device), scope)
}); err != nil {
@@ -78,6 +98,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*DeviceCounterConsumption)(nil), (*v1beta1.DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(a.(*DeviceCounterConsumption), b.(*v1beta1.DeviceCounterConsumption), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1beta1.DeviceCounterConsumption)(nil), (*DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(a.(*v1beta1.DeviceCounterConsumption), b.(*DeviceCounterConsumption), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*DeviceTaint)(nil), (*v1beta1.DeviceTaint)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_api_DeviceTaint_To_v1beta1_DeviceTaint(a.(*DeviceTaint), b.(*v1beta1.DeviceTaint), scope)
}); err != nil {
@@ -134,6 +164,20 @@ func RegisterConversions(s *runtime.Scheme) error {
func autoConvert_api_BasicDevice_To_v1beta1_BasicDevice(in *BasicDevice, out *v1beta1.BasicDevice, s conversion.Scope) error {
out.Attributes = *(*map[v1beta1.QualifiedName]v1beta1.DeviceAttribute)(unsafe.Pointer(&in.Attributes))
out.Capacity = *(*map[v1beta1.QualifiedName]v1beta1.DeviceCapacity)(unsafe.Pointer(&in.Capacity))
if in.ConsumesCounter != nil {
in, out := &in.ConsumesCounter, &out.ConsumesCounter
*out = make([]v1beta1.DeviceCounterConsumption, len(*in))
for i := range *in {
if err := Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.ConsumesCounter = nil
}
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes))
out.Taints = *(*[]v1beta1.DeviceTaint)(unsafe.Pointer(&in.Taints))
return nil
}
@@ -146,6 +190,20 @@ func Convert_api_BasicDevice_To_v1beta1_BasicDevice(in *BasicDevice, out *v1beta
func autoConvert_v1beta1_BasicDevice_To_api_BasicDevice(in *v1beta1.BasicDevice, out *BasicDevice, s conversion.Scope) error {
out.Attributes = *(*map[QualifiedName]DeviceAttribute)(unsafe.Pointer(&in.Attributes))
out.Capacity = *(*map[QualifiedName]DeviceCapacity)(unsafe.Pointer(&in.Capacity))
if in.ConsumesCounter != nil {
in, out := &in.ConsumesCounter, &out.ConsumesCounter
*out = make([]DeviceCounterConsumption, len(*in))
for i := range *in {
if err := Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.ConsumesCounter = nil
}
out.NodeName = (*string)(unsafe.Pointer(in.NodeName))
out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes))
out.Taints = *(*[]v1beta1.DeviceTaint)(unsafe.Pointer(&in.Taints))
return nil
}
@@ -155,11 +213,65 @@ func Convert_v1beta1_BasicDevice_To_api_BasicDevice(in *v1beta1.BasicDevice, out
return autoConvert_v1beta1_BasicDevice_To_api_BasicDevice(in, out, s)
}
func autoConvert_api_Counter_To_v1beta1_Counter(in *Counter, out *v1beta1.Counter, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_api_Counter_To_v1beta1_Counter is an autogenerated conversion function.
func Convert_api_Counter_To_v1beta1_Counter(in *Counter, out *v1beta1.Counter, s conversion.Scope) error {
return autoConvert_api_Counter_To_v1beta1_Counter(in, out, s)
}
func autoConvert_v1beta1_Counter_To_api_Counter(in *v1beta1.Counter, out *Counter, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_v1beta1_Counter_To_api_Counter is an autogenerated conversion function.
func Convert_v1beta1_Counter_To_api_Counter(in *v1beta1.Counter, out *Counter, s conversion.Scope) error {
return autoConvert_v1beta1_Counter_To_api_Counter(in, out, s)
}
func autoConvert_api_CounterSet_To_v1beta1_CounterSet(in *CounterSet, out *v1beta1.CounterSet, s conversion.Scope) error {
if err := Convert_api_UniqueString_To_string(&in.Name, &out.Name, s); err != nil {
return err
}
out.Counters = *(*map[string]v1beta1.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_api_CounterSet_To_v1beta1_CounterSet is an autogenerated conversion function.
func Convert_api_CounterSet_To_v1beta1_CounterSet(in *CounterSet, out *v1beta1.CounterSet, s conversion.Scope) error {
return autoConvert_api_CounterSet_To_v1beta1_CounterSet(in, out, s)
}
func autoConvert_v1beta1_CounterSet_To_api_CounterSet(in *v1beta1.CounterSet, out *CounterSet, s conversion.Scope) error {
if err := Convert_string_To_api_UniqueString(&in.Name, &out.Name, s); err != nil {
return err
}
out.Counters = *(*map[string]Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_v1beta1_CounterSet_To_api_CounterSet is an autogenerated conversion function.
func Convert_v1beta1_CounterSet_To_api_CounterSet(in *v1beta1.CounterSet, out *CounterSet, s conversion.Scope) error {
return autoConvert_v1beta1_CounterSet_To_api_CounterSet(in, out, s)
}
func autoConvert_api_Device_To_v1beta1_Device(in *Device, out *v1beta1.Device, s conversion.Scope) error {
if err := Convert_api_UniqueString_To_string(&in.Name, &out.Name, s); err != nil {
return err
}
out.Basic = (*v1beta1.BasicDevice)(unsafe.Pointer(in.Basic))
if in.Basic != nil {
in, out := &in.Basic, &out.Basic
*out = new(v1beta1.BasicDevice)
if err := Convert_api_BasicDevice_To_v1beta1_BasicDevice(*in, *out, s); err != nil {
return err
}
} else {
out.Basic = nil
}
return nil
}
@@ -172,7 +284,15 @@ func autoConvert_v1beta1_Device_To_api_Device(in *v1beta1.Device, out *Device, s
if err := Convert_string_To_api_UniqueString(&in.Name, &out.Name, s); err != nil {
return err
}
out.Basic = (*BasicDevice)(unsafe.Pointer(in.Basic))
if in.Basic != nil {
in, out := &in.Basic, &out.Basic
*out = new(BasicDevice)
if err := Convert_v1beta1_BasicDevice_To_api_BasicDevice(*in, *out, s); err != nil {
return err
}
} else {
out.Basic = nil
}
return nil
}
@@ -227,11 +347,37 @@ func Convert_v1beta1_DeviceCapacity_To_api_DeviceCapacity(in *v1beta1.DeviceCapa
return autoConvert_v1beta1_DeviceCapacity_To_api_DeviceCapacity(in, out, s)
}
func autoConvert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in *DeviceCounterConsumption, out *v1beta1.DeviceCounterConsumption, s conversion.Scope) error {
if err := Convert_api_UniqueString_To_string(&in.SharedCounter, &out.SharedCounter, s); err != nil {
return err
}
out.Counters = *(*map[string]v1beta1.Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption is an autogenerated conversion function.
func Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in *DeviceCounterConsumption, out *v1beta1.DeviceCounterConsumption, s conversion.Scope) error {
return autoConvert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in, out, s)
}
func autoConvert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(in *v1beta1.DeviceCounterConsumption, out *DeviceCounterConsumption, s conversion.Scope) error {
if err := Convert_string_To_api_UniqueString(&in.SharedCounter, &out.SharedCounter, s); err != nil {
return err
}
out.Counters = *(*map[string]Counter)(unsafe.Pointer(&in.Counters))
return nil
}
// Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption is an autogenerated conversion function.
func Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(in *v1beta1.DeviceCounterConsumption, out *DeviceCounterConsumption, s conversion.Scope) error {
return autoConvert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(in, out, s)
}
func autoConvert_api_DeviceTaint_To_v1beta1_DeviceTaint(in *DeviceTaint, out *v1beta1.DeviceTaint, s conversion.Scope) error {
out.Key = in.Key
out.Value = in.Value
out.Effect = v1beta1.DeviceTaintEffect(in.Effect)
out.TimeAdded = (*v1.Time)(unsafe.Pointer(in.TimeAdded))
out.TimeAdded = (*metav1.Time)(unsafe.Pointer(in.TimeAdded))
return nil
}
@@ -244,7 +390,7 @@ func autoConvert_v1beta1_DeviceTaint_To_api_DeviceTaint(in *v1beta1.DeviceTaint,
out.Key = in.Key
out.Value = in.Value
out.Effect = DeviceTaintEffect(in.Effect)
out.TimeAdded = (*v1.Time)(unsafe.Pointer(in.TimeAdded))
out.TimeAdded = (*metav1.Time)(unsafe.Pointer(in.TimeAdded))
return nil
}
@@ -317,7 +463,7 @@ func autoConvert_api_ResourceSliceSpec_To_v1beta1_ResourceSliceSpec(in *Resource
if err := Convert_api_UniqueString_To_string(&in.NodeName, &out.NodeName, s); err != nil {
return err
}
out.NodeSelector = (*corev1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = in.AllNodes
if in.Devices != nil {
in, out := &in.Devices, &out.Devices
@@ -330,6 +476,18 @@ func autoConvert_api_ResourceSliceSpec_To_v1beta1_ResourceSliceSpec(in *Resource
} else {
out.Devices = nil
}
out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection))
if in.SharedCounters != nil {
in, out := &in.SharedCounters, &out.SharedCounters
*out = make([]v1beta1.CounterSet, len(*in))
for i := range *in {
if err := Convert_api_CounterSet_To_v1beta1_CounterSet(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.SharedCounters = nil
}
return nil
}
@@ -348,7 +506,7 @@ func autoConvert_v1beta1_ResourceSliceSpec_To_api_ResourceSliceSpec(in *v1beta1.
if err := Convert_string_To_api_UniqueString(&in.NodeName, &out.NodeName, s); err != nil {
return err
}
out.NodeSelector = (*corev1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector))
out.AllNodes = in.AllNodes
if in.Devices != nil {
in, out := &in.Devices, &out.Devices
@@ -361,6 +519,18 @@ func autoConvert_v1beta1_ResourceSliceSpec_To_api_ResourceSliceSpec(in *v1beta1.
} else {
out.Devices = nil
}
out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection))
if in.SharedCounters != nil {
in, out := &in.SharedCounters, &out.SharedCounters
*out = make([]CounterSet, len(*in))
for i := range *in {
if err := Convert_v1beta1_CounterSet_To_api_CounterSet(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.SharedCounters = nil
}
return nil
}

View File

@@ -103,6 +103,18 @@ func (in *Slice) DeepCopyInto(out *Slice) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.SharedCounters != nil {
in, out := &in.SharedCounters, &out.SharedCounters
*out = make([]v1beta1.CounterSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.PerDeviceNodeSelection != nil {
in, out := &in.PerDeviceNodeSelection, &out.PerDeviceNodeSelection
*out = new(bool)
**out = **in
}
return
}