diff --git a/api/api-rules/violation_exceptions.list b/api/api-rules/violation_exceptions.list index af559e0e0333c..fc4997fad703d 100644 --- a/api/api-rules/violation_exceptions.list +++ b/api/api-rules/violation_exceptions.list @@ -52,13 +52,10 @@ API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,CephFS API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,StorageOS API rule violation: names_match,k8s.io/api/networking/v1alpha1,ServiceCIDRSpec,CIDRs API rule violation: names_match,k8s.io/api/networking/v1beta1,ServiceCIDRSpec,CIDRs -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,BoolValue -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,IntSliceValue -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,IntValue -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,QuantityValue -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,StringSliceValue -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,StringValue -API rule violation: names_match,k8s.io/api/resource/v1alpha2,NamedResourcesAttributeValue,VersionValue +API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,BoolValue +API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,IntValue +API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,StringValue +API rule violation: names_match,k8s.io/api/resource/v1alpha3,DeviceAttribute,VersionValue API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,Ref API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,Schema API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XEmbeddedResource diff --git a/api/discovery/aggregated_v2.json b/api/discovery/aggregated_v2.json index b710275edd8a3..33ada3450e481 100644 --- a/api/discovery/aggregated_v2.json +++ b/api/discovery/aggregated_v2.json @@ -1891,6 +1891,26 @@ { "freshness": "Current", "resources": [ + { + "resource": "deviceclasses", + "responseKind": { + "group": "", + "kind": "DeviceClass", + "version": "" + }, + "scope": "Cluster", + "singularResource": "deviceclass", + "verbs": [ + "create", + "delete", + "deletecollection", + "get", + "list", + "patch", + "update", + "watch" + ] + }, { "resource": "podschedulingcontexts", "responseKind": { @@ -1926,26 +1946,6 @@ "watch" ] }, - { - "resource": "resourceclaimparameters", - "responseKind": { - "group": "", - "kind": "ResourceClaimParameters", - "version": "" - }, - "scope": "Namespaced", - "singularResource": "resourceclaimparameters", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, { "resource": "resourceclaims", "responseKind": { @@ -2001,46 +2001,6 @@ "watch" ] }, - { - "resource": "resourceclasses", - "responseKind": { - "group": "", - "kind": "ResourceClass", - "version": "" - }, - "scope": "Cluster", - "singularResource": "resourceclass", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, - { - "resource": "resourceclassparameters", - "responseKind": { - "group": "", - "kind": "ResourceClassParameters", - "version": "" - }, - "scope": "Namespaced", - "singularResource": "resourceclassparameters", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, { "resource": "resourceslices", "responseKind": { @@ -2062,7 +2022,7 @@ ] } ], - "version": "v1alpha2" + "version": "v1alpha3" } ] }, diff --git a/api/discovery/aggregated_v2beta1.json b/api/discovery/aggregated_v2beta1.json index f4ee9917bc541..f9fed0bd40b6a 100644 --- a/api/discovery/aggregated_v2beta1.json +++ b/api/discovery/aggregated_v2beta1.json @@ -1891,6 +1891,26 @@ { "freshness": "Current", "resources": [ + { + "resource": "deviceclasses", + "responseKind": { + "group": "", + "kind": "DeviceClass", + "version": "" + }, + "scope": "Cluster", + "singularResource": "deviceclass", + "verbs": [ + "create", + "delete", + "deletecollection", + "get", + "list", + "patch", + "update", + "watch" + ] + }, { "resource": "podschedulingcontexts", "responseKind": { @@ -1926,26 +1946,6 @@ "watch" ] }, - { - "resource": "resourceclaimparameters", - "responseKind": { - "group": "", - "kind": "ResourceClaimParameters", - "version": "" - }, - "scope": "Namespaced", - "singularResource": "resourceclaimparameters", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, { "resource": "resourceclaims", "responseKind": { @@ -2001,46 +2001,6 @@ "watch" ] }, - { - "resource": "resourceclasses", - "responseKind": { - "group": "", - "kind": "ResourceClass", - "version": "" - }, - "scope": "Cluster", - "singularResource": "resourceclass", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, - { - "resource": "resourceclassparameters", - "responseKind": { - "group": "", - "kind": "ResourceClassParameters", - "version": "" - }, - "scope": "Namespaced", - "singularResource": "resourceclassparameters", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, { "resource": "resourceslices", "responseKind": { @@ -2062,7 +2022,7 @@ ] } ], - "version": "v1alpha2" + "version": "v1alpha3" } ] }, diff --git a/api/discovery/apis.json b/api/discovery/apis.json index 1a4d60b3ad85c..725b3fc350b4e 100644 --- a/api/discovery/apis.json +++ b/api/discovery/apis.json @@ -300,13 +300,13 @@ { "name": "resource.k8s.io", "preferredVersion": { - "groupVersion": "resource.k8s.io/v1alpha2", - "version": "v1alpha2" + "groupVersion": "resource.k8s.io/v1alpha3", + "version": "v1alpha3" }, "versions": [ { - "groupVersion": "resource.k8s.io/v1alpha2", - "version": "v1alpha2" + "groupVersion": "resource.k8s.io/v1alpha3", + "version": "v1alpha3" } ] }, diff --git a/api/discovery/apis__resource.k8s.io.json b/api/discovery/apis__resource.k8s.io.json index 5dd7e0820e537..85333d70e425e 100644 --- a/api/discovery/apis__resource.k8s.io.json +++ b/api/discovery/apis__resource.k8s.io.json @@ -3,13 +3,13 @@ "kind": "APIGroup", "name": "resource.k8s.io", "preferredVersion": { - "groupVersion": "resource.k8s.io/v1alpha2", - "version": "v1alpha2" + "groupVersion": "resource.k8s.io/v1alpha3", + "version": "v1alpha3" }, "versions": [ { - "groupVersion": "resource.k8s.io/v1alpha2", - "version": "v1alpha2" + "groupVersion": "resource.k8s.io/v1alpha3", + "version": "v1alpha3" } ] } diff --git a/api/discovery/apis__resource.k8s.io__v1alpha2.json b/api/discovery/apis__resource.k8s.io__v1alpha3.json similarity index 63% rename from api/discovery/apis__resource.k8s.io__v1alpha2.json rename to api/discovery/apis__resource.k8s.io__v1alpha3.json index 5c5643952713d..535ae34c33f2e 100644 --- a/api/discovery/apis__resource.k8s.io__v1alpha2.json +++ b/api/discovery/apis__resource.k8s.io__v1alpha3.json @@ -1,14 +1,14 @@ { "apiVersion": "v1", - "groupVersion": "resource.k8s.io/v1alpha2", + "groupVersion": "resource.k8s.io/v1alpha3", "kind": "APIResourceList", "resources": [ { - "kind": "PodSchedulingContext", - "name": "podschedulingcontexts", - "namespaced": true, - "singularName": "podschedulingcontext", - "storageVersionHash": "qtdNX2rnDEA=", + "kind": "DeviceClass", + "name": "deviceclasses", + "namespaced": false, + "singularName": "deviceclass", + "storageVersionHash": "12soGlw2WzE=", "verbs": [ "create", "delete", @@ -22,30 +22,30 @@ }, { "kind": "PodSchedulingContext", - "name": "podschedulingcontexts/status", + "name": "podschedulingcontexts", "namespaced": true, - "singularName": "", + "singularName": "podschedulingcontext", + "storageVersionHash": "SkSsa067T7g=", "verbs": [ + "create", + "delete", + "deletecollection", "get", + "list", "patch", - "update" + "update", + "watch" ] }, { - "kind": "ResourceClaimParameters", - "name": "resourceclaimparameters", + "kind": "PodSchedulingContext", + "name": "podschedulingcontexts/status", "namespaced": true, - "singularName": "resourceclaimparameters", - "storageVersionHash": "DWM408h+ZHE=", + "singularName": "", "verbs": [ - "create", - "delete", - "deletecollection", "get", - "list", "patch", - "update", - "watch" + "update" ] }, { @@ -53,7 +53,7 @@ "name": "resourceclaims", "namespaced": true, "singularName": "resourceclaim", - "storageVersionHash": "sMQbgChfibk=", + "storageVersionHash": "ozQSw6/HyJ4=", "verbs": [ "create", "delete", @@ -81,41 +81,7 @@ "name": "resourceclaimtemplates", "namespaced": true, "singularName": "resourceclaimtemplate", - "storageVersionHash": "1o2b66bFoGM=", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, - { - "kind": "ResourceClass", - "name": "resourceclasses", - "namespaced": false, - "singularName": "resourceclass", - "storageVersionHash": "wkt0Tpte++U=", - "verbs": [ - "create", - "delete", - "deletecollection", - "get", - "list", - "patch", - "update", - "watch" - ] - }, - { - "kind": "ResourceClassParameters", - "name": "resourceclassparameters", - "namespaced": true, - "singularName": "resourceclassparameters", - "storageVersionHash": "MDq5XoTnXWQ=", + "storageVersionHash": "lbw3G0J+kqQ=", "verbs": [ "create", "delete", @@ -132,7 +98,7 @@ "name": "resourceslices", "namespaced": false, "singularName": "resourceslice", - "storageVersionHash": "IECvOcO76kw=", + "storageVersionHash": "8Uqm6frD4H0=", "verbs": [ "create", "delete", diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index d51c1efb2f2ec..d474a369fdec2 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -10369,6 +10369,10 @@ "name": { "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + "type": "string" } }, "required": [ @@ -14949,220 +14953,412 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "io.k8s.api.resource.v1alpha2.AllocationResult": { + "io.k8s.api.resource.v1alpha3.AllocationResult": { "description": "AllocationResult contains attributes of an allocated resource.", "properties": { - "availableOnNodes": { - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", - "description": "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere." + "controller": { + "description": "Controller is the name of the DRA driver which handled the allocation. That driver is also responsible for deallocating the claim. It is empty when the claim can be deallocated without involving a driver.\n\nA driver may allocate devices provided by other drivers, so this driver name here can be different from the driver names listed for the results.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", + "type": "string" }, - "resourceHandles": { - "description": "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceHandle" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "devices": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceAllocationResult", + "description": "Devices is the result of allocating devices." }, - "shareable": { - "description": "Shareable determines whether the resource supports more than one consumer at a time.", - "type": "boolean" + "nodeSelector": { + "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", + "description": "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere." } }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.DriverAllocationResult": { - "description": "DriverAllocationResult contains vendor parameters and the allocation result for one request.", + "io.k8s.api.resource.v1alpha3.BasicDevice": { + "description": "BasicDevice defines one device instance using fields that are supported by all clients which support DRA.", "properties": { - "namedResources": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult", - "description": "NamedResources describes the allocation result when using the named resources model." + "attributes": { + "additionalProperties": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceAttribute" + }, + "description": "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.", + "type": "object" }, - "vendorRequestParameters": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", - "description": "VendorRequestParameters are the per-request configuration parameters from the time that the claim was allocated." + "capacity": { + "additionalProperties": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" + }, + "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" } }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.DriverRequests": { - "description": "DriverRequests describes all resources that are needed from one particular driver.", + "io.k8s.api.resource.v1alpha3.CELDeviceSelector": { + "description": "CELDeviceSelector contains a CEL expression for selecting a device.", "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", + "expression": { + "description": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)", "type": "string" + } + }, + "required": [ + "expression" + ], + "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": { + "basic": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.BasicDevice", + "description": "Basic defines one device instance using fields that are supported by all clients which support DRA." + }, + "name": { + "description": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration": { + "description": "DeviceAllocationConfiguration gets embedded in an AllocationResult.", + "properties": { + "opaque": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration", + "description": "Opaque provides driver-specific configuration parameters." }, "requests": { - "description": "Requests describes all resources that are needed from the driver.", + "description": "Requests lists the names of requests where the configuration applies. If empty, its applies to all requests.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceRequest" + "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, - "vendorParameters": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", - "description": "VendorParameters are arbitrary setup parameters for all requests of the claim. They are ignored while allocating the claim." + "source": { + "description": "Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim.", + "type": "string" } }, + "required": [ + "source" + ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult": { - "description": "NamedResourcesAllocationResult is used in AllocationResultModel.", + "io.k8s.api.resource.v1alpha3.DeviceAllocationResult": { + "description": "DeviceAllocationResult is the result of allocating devices.", "properties": { - "name": { - "description": "Name is the name of the selected resource instance.", - "type": "string" + "config": { + "description": "This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag.\n\nThis includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "results": { + "description": "Results lists all allocated devices.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, - "required": [ - "name" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesAttribute": { - "description": "NamedResourcesAttribute is a combination of an attribute name and its value.", + "io.k8s.api.resource.v1alpha3.DeviceAttribute": { + "description": "DeviceAttribute must have exactly one field set.", "properties": { "bool": { "description": "BoolValue is a true/false value.", "type": "boolean" }, "int": { - "description": "IntValue is a 64-bit integer.", + "description": "IntValue is a number.", "format": "int64", "type": "integer" }, - "intSlice": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice", - "description": "IntSliceValue is an array of 64-bit integers." + "string": { + "description": "StringValue is a string. Must not be longer than 64 characters.", + "type": "string" }, - "name": { - "description": "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", + "version": { + "description": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.", "type": "string" + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceClaim": { + "description": "DeviceClaim defines how to request devices with a ResourceClaim.", + "properties": { + "config": { + "description": "This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "quantity": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity", - "description": "QuantityValue is a quantity." + "constraints": { + "description": "These constraints must be satisfied by the set of devices that get allocated for the claim.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceConstraint" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "string": { - "description": "StringValue is a string.", - "type": "string" + "requests": { + "description": "Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceRequest" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration": { + "description": "DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.", + "properties": { + "opaque": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration", + "description": "Opaque provides driver-specific configuration parameters." }, - "stringSlice": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice", - "description": "StringSliceValue is an array of strings." + "requests": { + "description": "Requests lists the names of requests where the configuration applies. If empty, it applies to all requests.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceClass": { + "description": "DeviceClass is a vendor or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" }, - "version": { - "description": "VersionValue is a semantic version according to semver.org spec 2.0.0.", + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" + }, + "metadata": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", + "description": "Standard object metadata" + }, + "spec": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClassSpec", + "description": "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number." } }, "required": [ - "name" + "spec" ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "resource.k8s.io", + "kind": "DeviceClass", + "version": "v1alpha3" + } + ] + }, + "io.k8s.api.resource.v1alpha3.DeviceClassConfiguration": { + "description": "DeviceClassConfiguration is used in DeviceClass.", + "properties": { + "opaque": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration", + "description": "Opaque provides driver-specific configuration parameters." + } + }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesFilter": { - "description": "NamedResourcesFilter is used in ResourceFilterModel.", + "io.k8s.api.resource.v1alpha3.DeviceClassList": { + "description": "DeviceClassList is a collection of classes.", "properties": { - "selector": { - "description": "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type in NamedResourcesAttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" + }, + "items": { + "description": "Items is the list of resource classes.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" + }, + "type": "array" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta", + "description": "Standard list metadata" } }, "required": [ - "selector" + "items" ], - "type": "object" + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "resource.k8s.io", + "kind": "DeviceClassList", + "version": "v1alpha3" + } + ] }, - "io.k8s.api.resource.v1alpha2.NamedResourcesInstance": { - "description": "NamedResourcesInstance represents one individual hardware instance that can be selected based on its attributes.", + "io.k8s.api.resource.v1alpha3.DeviceClassSpec": { "properties": { - "attributes": { - "description": "Attributes defines the attributes of this resource instance. The name of each attribute must be unique.", + "config": { + "description": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesAttribute" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClassConfiguration" }, "type": "array", "x-kubernetes-list-type": "atomic" }, - "name": { - "description": "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", + "selectors": { + "description": "Each selector must be satisfied by a device which is claimed via this class.", + "items": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceSelector" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "suitableNodes": { + "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", + "description": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a claim that has not been allocated yet *and* that claim gets allocated through a control plane controller. It is ignored when the claim does not use a control plane controller for allocation.\n\nSetting this field is optional. If unset, all Nodes are candidates.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate." + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceConstraint": { + "description": "DeviceConstraint must have exactly one field set besides Requests.", + "properties": { + "matchAttribute": { + "description": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.", "type": "string" + }, + "requests": { + "description": "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.", + "items": { + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, - "required": [ - "name" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice": { - "description": "NamedResourcesIntSlice contains a slice of 64-bit integers.", + "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.\n\nA DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request.", "properties": { - "ints": { - "description": "Ints is the slice of 64-bit integers.", + "adminAccess": { + "description": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.", + "type": "boolean" + }, + "count": { + "description": "Count is used only when the count mode is \"Exact\". Must be greater than zero. If CountMode is Exact and this field is not specified, the default is one.", + "format": "int64", + "type": "integer" + }, + "countMode": { + "description": "CountMode and its related fields define how many devices are needed to satisfy this request. Supported values are:\n\n- Exact: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf countMode is not specified, the default countMode is Exact. If countMode is Exact and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "type": "string" + }, + "deviceClassName": { + "description": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "type": "string" + }, + "name": { + "description": "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.", + "type": "string" + }, + "selectors": { + "description": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", "items": { - "format": "int64", - "type": "integer" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceSelector" }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "required": [ - "ints" + "name", + "deviceClassName" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesRequest": { - "description": "NamedResourcesRequest is used in ResourceRequestModel.", + "io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult": { + "description": "DeviceRequestAllocationResult contains the allocation result for one request.", "properties": { - "selector": { - "description": "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type NamedResourcesin AttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", + "device": { + "description": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.", + "type": "string" + }, + "driver": { + "description": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "type": "string" + }, + "pool": { + "description": "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.", + "type": "string" + }, + "request": { + "description": "Request is the name of the request in the claim which caused this device to be allocated. Multiple devices may have been allocated per request.", "type": "string" } }, "required": [ - "selector" + "request", + "driver", + "pool", + "device" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesResources": { - "description": "NamedResourcesResources is used in ResourceModel.", + "io.k8s.api.resource.v1alpha3.DeviceSelector": { + "description": "DeviceSelector must have exactly one field set.", "properties": { - "instances": { - "description": "The list of all individual resources instances currently available.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesInstance" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "cel": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.CELDeviceSelector", + "description": "CEL contains a CEL expression for selecting a device." } }, "required": [ - "instances" + "cel" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice": { - "description": "NamedResourcesStringSlice contains a slice of strings.", + "io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration": { + "description": "OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor.", "properties": { - "strings": { - "description": "Strings is the slice of strings.", - "items": { - "type": "string" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "driver": { + "description": "Driver is used to determine which kubelet plugin needs to be passed these configuration parameters.\n\nAn admission policy provided by the driver developer could use this to decide whether it needs to validate them.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "type": "string" + }, + "parameters": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", + "description": "Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions." } }, "required": [ - "strings" + "driver", + "parameters" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContext": { - "description": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "io.k8s.api.resource.v1alpha3.PodSchedulingContext": { + "description": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DRAControlPlaneController feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -15177,11 +15373,11 @@ "description": "Standard object metadata" }, "spec": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec", + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec", "description": "Spec describes where resources for the Pod are needed." }, "status": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus", + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus", "description": "Status describes where resources for the Pod can be allocated." } }, @@ -15193,11 +15389,11 @@ { "group": "resource.k8s.io", "kind": "PodSchedulingContext", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContextList": { + "io.k8s.api.resource.v1alpha3.PodSchedulingContextList": { "description": "PodSchedulingContextList is a collection of Pod scheduling objects.", "properties": { "apiVersion": { @@ -15207,7 +15403,7 @@ "items": { "description": "Items is the list of PodSchedulingContext objects.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" }, "type": "array" }, @@ -15228,11 +15424,11 @@ { "group": "resource.k8s.io", "kind": "PodSchedulingContextList", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec": { + "io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec": { "description": "PodSchedulingContextSpec describes where resources for the Pod are needed.", "properties": { "potentialNodes": { @@ -15250,13 +15446,13 @@ }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus": { + "io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus": { "description": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", "properties": { "resourceClaims": { "description": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus" }, "type": "array", "x-kubernetes-list-map-keys": [ @@ -15267,8 +15463,8 @@ }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaim": { - "description": "ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "io.k8s.api.resource.v1alpha3.ResourceClaim": { + "description": "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -15283,12 +15479,12 @@ "description": "Standard object metadata" }, "spec": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimSpec", - "description": "Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim." + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimSpec", + "description": "Spec describes what is being requested and how to configure it. The spec is immutable." }, "status": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimStatus", - "description": "Status describes whether the resource is available and with which attributes." + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimStatus", + "description": "Status describes whether the claim is ready to use and what has been allocated." } }, "required": [ @@ -15299,11 +15495,11 @@ { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference": { + "io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference": { "description": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", "properties": { "apiGroup": { @@ -15330,7 +15526,7 @@ ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimList": { + "io.k8s.api.resource.v1alpha3.ResourceClaimList": { "description": "ResourceClaimList is a collection of claims.", "properties": { "apiVersion": { @@ -15340,7 +15536,7 @@ "items": { "description": "Items is the list of resource claims.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" }, "type": "array" }, @@ -15361,109 +15557,11 @@ { "group": "resource.k8s.io", "kind": "ResourceClaimList", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimParameters": { - "description": "ResourceClaimParameters defines resource requests for a ResourceClaim in an in-tree format understood by Kubernetes.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "driverRequests": { - "description": "DriverRequests describes all resources that are needed for the allocated claim. A single claim may use resources coming from different drivers. For each driver, this array has at most one entry which then may have one or more per-driver requests.\n\nMay be empty, in which case the claim can always be allocated.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.DriverRequests" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "generatedFrom": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference", - "description": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the claim parameters when the parameter reference of the claim refers to some unknown type." - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", - "description": "Standard object metadata" - }, - "shareable": { - "description": "Shareable indicates whether the allocated claim is meant to be shareable by multiple consumers at the same time.", - "type": "boolean" - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClaimParametersList": { - "description": "ResourceClaimParametersList is a collection of ResourceClaimParameters.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of node resource capacity objects.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta", - "description": "Standard list metadata" - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClaimParametersList", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference": { - "description": "ResourceClaimParametersReference contains enough information to let you locate the parameters for a ResourceClaim. The object must be in the same namespace as the ResourceClaim.", - "properties": { - "apiGroup": { - "description": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "type": "string" - }, - "kind": { - "description": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata, for example \"ConfigMap\".", - "type": "string" - }, - "name": { - "description": "Name is the name of resource being referenced.", - "type": "string" - } - }, - "required": [ - "kind", - "name" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus": { + "io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus": { "description": "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.", "properties": { "name": { @@ -15479,48 +15577,40 @@ "x-kubernetes-list-type": "atomic" } }, + "required": [ + "name" + ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimSpec": { - "description": "ResourceClaimSpec defines how a resource is to be allocated.", + "io.k8s.api.resource.v1alpha3.ResourceClaimSpec": { + "description": "ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.", "properties": { - "allocationMode": { - "description": "Allocation can start immediately or when a Pod wants to use the resource. \"WaitForFirstConsumer\" is the default.", + "controller": { + "description": "Controller is the name of the DRA driver that is meant to handle allocation of this claim. If empty, allocation is handled by the scheduler while scheduling a pod.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", "type": "string" }, - "parametersRef": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference", - "description": "ParametersRef references a separate object with arbitrary parameters that will be used by the driver when allocating a resource for the claim.\n\nThe object must be in the same namespace as the ResourceClaim." - }, - "resourceClassName": { - "description": "ResourceClassName references the driver and additional parameters via the name of a ResourceClass that was created as part of the driver deployment.", - "type": "string" + "devices": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClaim", + "description": "Devices defines how to request devices." } }, - "required": [ - "resourceClassName" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimStatus": { - "description": "ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.", + "io.k8s.api.resource.v1alpha3.ResourceClaimStatus": { + "description": "ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.", "properties": { "allocation": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.AllocationResult", - "description": "Allocation is set by the resource driver once a resource or set of resources has been allocated successfully. If this is not specified, the resources have not been allocated yet." + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.AllocationResult", + "description": "Allocation is set once the claim has been allocated successfully." }, "deallocationRequested": { - "description": "DeallocationRequested indicates that a ResourceClaim is to be deallocated.\n\nThe driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nWhile DeallocationRequested is set, no new consumers may be added to ReservedFor.", + "description": "Indicates that a claim is to be deallocated. While this is set, no new consumers may be added to ReservedFor.\n\nThis is only used if the claim needs to be deallocated by a DRA driver. That driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", "type": "boolean" }, - "driverName": { - "description": "DriverName is a copy of the driver name from the ResourceClass at the time when allocation started.", - "type": "string" - }, "reservedFor": { - "description": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", + "description": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.\n\nIn a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.\n\nBoth schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference" }, "type": "array", "x-kubernetes-list-map-keys": [ @@ -15533,8 +15623,8 @@ }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimTemplate": { - "description": "ResourceClaimTemplate is used to produce ResourceClaim objects.", + "io.k8s.api.resource.v1alpha3.ResourceClaimTemplate": { + "description": "ResourceClaimTemplate is used to produce ResourceClaim objects.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -15549,7 +15639,7 @@ "description": "Standard object metadata" }, "spec": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec", + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec", "description": "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore." } }, @@ -15561,11 +15651,11 @@ { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList": { + "io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList": { "description": "ResourceClaimTemplateList is a collection of claim templates.", "properties": { "apiVersion": { @@ -15575,7 +15665,7 @@ "items": { "description": "Items is the list of resource claim templates.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" }, "type": "array" }, @@ -15596,11 +15686,11 @@ { "group": "resource.k8s.io", "kind": "ResourceClaimTemplateList", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec": { + "io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec": { "description": "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.", "properties": { "metadata": { @@ -15608,7 +15698,7 @@ "description": "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation." }, "spec": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimSpec", + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimSpec", "description": "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here." } }, @@ -15617,251 +15707,38 @@ ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClass": { - "description": "ResourceClass is used by administrators to influence how resources are allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "io.k8s.api.resource.v1alpha3.ResourcePool": { + "description": "ResourcePool describes the pool that ResourceSlices belong to.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "driverName": { - "description": "DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.\n\nResource drivers have a unique name in forward domain order (acme.example.com).", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", - "description": "Standard object metadata" - }, - "parametersRef": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParametersReference", - "description": "ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec." - }, - "structuredParameters": { - "description": "If and only if allocation of claims using this class is handled via structured parameters, then StructuredParameters must be set to true.", - "type": "boolean" - }, - "suitableNodes": { - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", - "description": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.\n\nSetting this field is optional. If null, all nodes are candidates." - } - }, - "required": [ - "driverName" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClassList": { - "description": "ResourceClassList is a collection of classes.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of resource classes.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta", - "description": "Standard list metadata" - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClassList", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClassParameters": { - "description": "ResourceClassParameters defines resource requests for a ResourceClass in an in-tree format understood by Kubernetes.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "filters": { - "description": "Filters describes additional contraints that must be met when using the class.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceFilter" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "generatedFrom": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParametersReference", - "description": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the class parameters when the parameter reference of the class refers to some unknown type." - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", - "description": "Standard object metadata" - }, - "vendorParameters": { - "description": "VendorParameters are arbitrary setup parameters for all claims using this class. They are ignored while allocating the claim. There must not be more than one entry per driver.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.VendorParameters" - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClassParametersList": { - "description": "ResourceClassParametersList is a collection of ResourceClassParameters.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of node resource capacity objects.", - "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta", - "description": "Standard list metadata" - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClassParametersList", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClassParametersReference": { - "description": "ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass.", - "properties": { - "apiGroup": { - "description": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "type": "string" - }, - "kind": { - "description": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata.", - "type": "string" + "generation": { + "description": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", + "format": "int64", + "type": "integer" }, "name": { - "description": "Name is the name of resource being referenced.", - "type": "string" - }, - "namespace": { - "description": "Namespace that contains the referenced resource. Must be empty for cluster-scoped resources and non-empty for namespaced resources.", - "type": "string" - } - }, - "required": [ - "kind", - "name" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceFilter": { - "description": "ResourceFilter is a filter for resources from one particular driver.", - "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", + "description": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes.", "type": "string" }, - "namedResources": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesFilter", - "description": "NamedResources describes a resource filter using the named resources model." - } - }, - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceHandle": { - "description": "ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.", - "properties": { - "data": { - "description": "Data contains the opaque data associated with this ResourceHandle. It is set by the controller component of the resource driver whose name matches the DriverName set in the ResourceClaimStatus this ResourceHandle is embedded in. It is set at allocation time and is intended for processing by the kubelet plugin whose name matches the DriverName set in this ResourceHandle.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.", - "type": "string" - }, - "driverName": { - "description": "DriverName specifies the name of the resource driver whose kubelet plugin should be invoked to process this ResourceHandle's data once it lands on a node. This may differ from the DriverName set in ResourceClaimStatus this ResourceHandle is embedded in.", - "type": "string" - }, - "structuredData": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.StructuredResourceHandle", - "description": "If StructuredData is set, then it needs to be used instead of Data." + "resourceSliceCount": { + "description": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be higher than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", + "format": "int64", + "type": "integer" } }, "required": [ - "driverName" + "name", + "generation", + "resourceSliceCount" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceRequest": { - "description": "ResourceRequest is a request for resources from one particular driver.", - "properties": { - "namedResources": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesRequest", - "description": "NamedResources describes a request for resources with the named resources model." - }, - "vendorParameters": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", - "description": "VendorParameters are arbitrary setup parameters for the requested resource. They are ignored while allocating a claim." - } - }, - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceSlice": { - "description": "ResourceSlice provides information about available resources on individual nodes.", + "io.k8s.api.resource.v1alpha3.ResourceSlice": { + "description": "ResourceSlice represents one or more resources in a pool of similar resources, managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple , , .\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, - "driverName": { - "description": "DriverName identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.", - "type": "string" - }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" @@ -15870,28 +15747,24 @@ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", "description": "Standard object metadata" }, - "namedResources": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.NamedResourcesResources", - "description": "NamedResources describes available resources using the named resources model." - }, - "nodeName": { - "description": "NodeName identifies the node which provides the resources if they are local to a node.\n\nA field selector can be used to list only ResourceSlice objects with a certain node name.", - "type": "string" + "spec": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSliceSpec", + "description": "Contains the information published by the driver.\n\nChanging the spec automatically increments the metadata.generation number." } }, "required": [ - "driverName" + "spec" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", "kind": "ResourceSlice", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceSliceList": { + "io.k8s.api.resource.v1alpha3.ResourceSliceList": { "description": "ResourceSliceList is a collection of ResourceSlices.", "properties": { "apiVersion": { @@ -15899,9 +15772,9 @@ "type": "string" }, "items": { - "description": "Items is the list of node resource capacity objects.", + "description": "Items is the list of resource ResourceSlices.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" }, "type": "array" }, @@ -15909,7 +15782,7 @@ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, - "metadata": { + "listMeta": { "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta", "description": "Standard list metadata" } @@ -15922,51 +15795,46 @@ { "group": "resource.k8s.io", "kind": "ResourceSliceList", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.StructuredResourceHandle": { - "description": "StructuredResourceHandle is the in-tree representation of the allocation result.", + "io.k8s.api.resource.v1alpha3.ResourceSliceSpec": { + "description": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.", "properties": { - "nodeName": { - "description": "NodeName is the name of the node providing the necessary resources if the resources are local to a node.", - "type": "string" + "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.", + "type": "boolean" }, - "results": { - "description": "Results lists all allocated driver resources.", + "devices": { + "description": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.", "items": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.DriverAllocationResult" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.Device" }, "type": "array", "x-kubernetes-list-type": "atomic" }, - "vendorClaimParameters": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", - "description": "VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated." + "driver": { + "description": "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.", + "type": "string" }, - "vendorClassParameters": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", - "description": "VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated." - } - }, - "required": [ - "results" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.VendorParameters": { - "description": "VendorParameters are opaque parameters for one particular driver.", - "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", + "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.", "type": "string" }, - "parameters": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension", - "description": "Parameters can be arbitrary setup parameters. They are ignored while allocating a claim." + "nodeSelector": { + "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", + "description": "NodeSelector defines which nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set." + }, + "pool": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourcePool", + "description": "Pool describes the pool that this ResourceSlice belongs to. This field is immutable." } }, + "required": [ + "driver", + "pool" + ], "type": "object" }, "io.k8s.api.scheduling.v1.PriorityClass": { @@ -18147,7 +18015,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -18531,7 +18399,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -18868,7 +18736,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -70424,7 +70292,7 @@ ] } }, - "/apis/resource.k8s.io/v1alpha2/": { + "/apis/resource.k8s.io/v1alpha3/": { "get": { "consumes": [ "application/json", @@ -70432,7 +70300,7 @@ "application/vnd.kubernetes.protobuf" ], "description": "get available resources", - "operationId": "getResourceV1alpha2APIResources", + "operationId": "getResourceV1alpha3APIResources", "produces": [ "application/json", "application/yaml", @@ -70453,17 +70321,17 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ] } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts": { + "/apis/resource.k8s.io/v1alpha3/deviceclasses": { "delete": { "consumes": [ "*/*" ], - "description": "delete collection of PodSchedulingContext", - "operationId": "deleteResourceV1alpha2CollectionNamespacedPodSchedulingContext", + "description": "delete collection of DeviceClass", + "operationId": "deleteResourceV1alpha3CollectionDeviceClass", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -70529,21 +70397,21 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "get": { "consumes": [ "*/*" ], - "description": "list or watch objects of kind PodSchedulingContext", - "operationId": "listResourceV1alpha2NamespacedPodSchedulingContext", + "description": "list or watch objects of kind DeviceClass", + "operationId": "listResourceV1alpha3DeviceClass", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" @@ -70587,7 +70455,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClassList" } }, "401": { @@ -70598,19 +70466,16 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, { "$ref": "#/parameters/pretty-tJGM1-ng" } @@ -70619,15 +70484,15 @@ "consumes": [ "*/*" ], - "description": "create a PodSchedulingContext", - "operationId": "createResourceV1alpha2NamespacedPodSchedulingContext", + "description": "create a DeviceClass", + "operationId": "createResourceV1alpha3DeviceClass", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, { @@ -70657,19 +70522,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "401": { @@ -70680,23 +70545,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}": { + "/apis/resource.k8s.io/v1alpha3/deviceclasses/{name}": { "delete": { "consumes": [ "*/*" ], - "description": "delete a PodSchedulingContext", - "operationId": "deleteResourceV1alpha2NamespacedPodSchedulingContext", + "description": "delete a DeviceClass", + "operationId": "deleteResourceV1alpha3DeviceClass", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -70727,13 +70592,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "401": { @@ -70744,21 +70609,21 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "get": { "consumes": [ "*/*" ], - "description": "read the specified PodSchedulingContext", - "operationId": "readResourceV1alpha2NamespacedPodSchedulingContext", + "description": "read the specified DeviceClass", + "operationId": "readResourceV1alpha3DeviceClass", "produces": [ "application/json", "application/yaml", @@ -70768,7 +70633,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "401": { @@ -70779,27 +70644,24 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ { - "description": "name of the PodSchedulingContext", + "description": "name of the DeviceClass", "in": "path", "name": "name", "required": true, "type": "string", "uniqueItems": true }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, { "$ref": "#/parameters/pretty-tJGM1-ng" } @@ -70811,8 +70673,8 @@ "application/strategic-merge-patch+json", "application/apply-patch+yaml" ], - "description": "partially update the specified PodSchedulingContext", - "operationId": "patchResourceV1alpha2NamespacedPodSchedulingContext", + "description": "partially update the specified DeviceClass", + "operationId": "patchResourceV1alpha3DeviceClass", "parameters": [ { "$ref": "#/parameters/body-78PwaGsr" @@ -70847,13 +70709,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "401": { @@ -70864,28 +70726,28 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "put": { "consumes": [ "*/*" ], - "description": "replace the specified PodSchedulingContext", - "operationId": "replaceResourceV1alpha2NamespacedPodSchedulingContext", + "description": "replace the specified DeviceClass", + "operationId": "replaceResourceV1alpha3DeviceClass", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, { @@ -70915,13 +70777,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "401": { @@ -70932,23 +70794,68 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status": { - "get": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/podschedulingcontexts": { + "delete": { "consumes": [ "*/*" ], - "description": "read status of the specified PodSchedulingContext", - "operationId": "readResourceV1alpha2NamespacedPodSchedulingContextStatus", + "description": "delete collection of PodSchedulingContext", + "operationId": "deleteResourceV1alpha3CollectionNamespacedPodSchedulingContext", + "parameters": [ + { + "$ref": "#/parameters/body-2Y1dVQaQ" + }, + { + "$ref": "#/parameters/continue-QfD61s0i" + }, + { + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "in": "query", + "name": "dryRun", + "type": "string", + "uniqueItems": true + }, + { + "$ref": "#/parameters/fieldSelector-xIcQKXFG" + }, + { + "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" + }, + { + "$ref": "#/parameters/labelSelector-5Zw57w4C" + }, + { + "$ref": "#/parameters/limit-1NfNmdNH" + }, + { + "$ref": "#/parameters/orphanDependents-uRB25kX5" + }, + { + "$ref": "#/parameters/propagationPolicy-6jk3prlO" + }, + { + "$ref": "#/parameters/resourceVersion-5WAnf1kx" + }, + { + "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" + }, + { + "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" + }, + { + "$ref": "#/parameters/timeoutSeconds-yvYezaOC" + } + ], "produces": [ "application/json", "application/yaml", @@ -70958,7 +70865,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "401": { @@ -70969,81 +70876,65 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "get", + "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "PodSchedulingContext", - "version": "v1alpha2" + "version": "v1alpha3" } }, - "parameters": [ - { - "description": "name of the PodSchedulingContext", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - } - ], - "patch": { + "get": { "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json", - "application/apply-patch+yaml" + "*/*" ], - "description": "partially update status of the specified PodSchedulingContext", - "operationId": "patchResourceV1alpha2NamespacedPodSchedulingContextStatus", + "description": "list or watch objects of kind PodSchedulingContext", + "operationId": "listResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { - "$ref": "#/parameters/body-78PwaGsr" + "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" }, { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true + "$ref": "#/parameters/continue-QfD61s0i" }, { - "$ref": "#/parameters/fieldManager-7c6nTn1T" + "$ref": "#/parameters/fieldSelector-xIcQKXFG" }, { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true + "$ref": "#/parameters/labelSelector-5Zw57w4C" }, { - "$ref": "#/parameters/force-tOGGb0Yi" + "$ref": "#/parameters/limit-1NfNmdNH" + }, + { + "$ref": "#/parameters/resourceVersion-5WAnf1kx" + }, + { + "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" + }, + { + "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" + }, + { + "$ref": "#/parameters/timeoutSeconds-yvYezaOC" + }, + { + "$ref": "#/parameters/watch-XNNPZGbK" } ], "produces": [ "application/json", "application/yaml", - "application/vnd.kubernetes.protobuf" + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } }, "401": { @@ -71054,28 +70945,36 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "patch", + "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "PodSchedulingContext", - "version": "v1alpha2" + "version": "v1alpha3" } }, - "put": { + "parameters": [ + { + "$ref": "#/parameters/namespace-vgWSWtn3" + }, + { + "$ref": "#/parameters/pretty-tJGM1-ng" + } + ], + "post": { "consumes": [ "*/*" ], - "description": "replace status of the specified PodSchedulingContext", - "operationId": "replaceResourceV1alpha2NamespacedPodSchedulingContextStatus", + "description": "create a PodSchedulingContext", + "operationId": "createResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, { @@ -71105,13 +71004,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71122,30 +71027,27 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "put", + "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "PodSchedulingContext", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/podschedulingcontexts/{name}": { "delete": { "consumes": [ "*/*" ], - "description": "delete collection of ResourceClaimParameters", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaimParameters", + "description": "delete a PodSchedulingContext", + "operationId": "deleteResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", @@ -71153,35 +71055,14 @@ "type": "string", "uniqueItems": true }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, { "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, { "$ref": "#/parameters/orphanDependents-uRB25kX5" }, { "$ref": "#/parameters/propagationPolicy-6jk3prlO" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" } ], "produces": [ @@ -71193,7 +71074,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71204,65 +71091,31 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "deletecollection", + "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "get": { "consumes": [ "*/*" ], - "description": "list or watch objects of kind ResourceClaimParameters", - "operationId": "listResourceV1alpha2NamespacedResourceClaimParameters", - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ], + "description": "read the specified PodSchedulingContext", + "operationId": "readResourceV1alpha3NamespacedPodSchedulingContext", "produces": [ "application/json", "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" + "application/vnd.kubernetes.protobuf" ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71273,16 +71126,24 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "list", + "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ + { + "description": "name of the PodSchedulingContext", + "in": "path", + "name": "name", + "required": true, + "type": "string", + "uniqueItems": true + }, { "$ref": "#/parameters/namespace-vgWSWtn3" }, @@ -71290,20 +71151,18 @@ "$ref": "#/parameters/pretty-tJGM1-ng" } ], - "post": { + "patch": { "consumes": [ - "*/*" + "application/json-patch+json", + "application/merge-patch+json", + "application/strategic-merge-patch+json", + "application/apply-patch+yaml" ], - "description": "create ResourceClaimParameters", - "operationId": "createResourceV1alpha2NamespacedResourceClaimParameters", + "description": "partially update the specified PodSchedulingContext", + "operationId": "patchResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" - } + "$ref": "#/parameters/body-78PwaGsr" }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -71313,7 +71172,7 @@ "uniqueItems": true }, { - "$ref": "#/parameters/fieldManager-Qy4HdaTW" + "$ref": "#/parameters/fieldManager-7c6nTn1T" }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", @@ -71321,6 +71180,9 @@ "name": "fieldValidation", "type": "string", "uniqueItems": true + }, + { + "$ref": "#/parameters/force-tOGGb0Yi" } ], "produces": [ @@ -71332,19 +71194,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71355,26 +71211,29 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "post", + "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } - } - }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}": { - "delete": { + }, + "put": { "consumes": [ "*/*" ], - "description": "delete ResourceClaimParameters", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaimParameters", + "description": "replace the specified PodSchedulingContext", + "operationId": "replaceResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { - "$ref": "#/parameters/body-2Y1dVQaQ" + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -71384,13 +71243,14 @@ "uniqueItems": true }, { - "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" - }, - { - "$ref": "#/parameters/orphanDependents-uRB25kX5" + "$ref": "#/parameters/fieldManager-Qy4HdaTW" }, { - "$ref": "#/parameters/propagationPolicy-6jk3prlO" + "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "in": "query", + "name": "fieldValidation", + "type": "string", + "uniqueItems": true } ], "produces": [ @@ -71402,13 +71262,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, - "202": { - "description": "Accepted", + "201": { + "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71419,21 +71279,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "delete", + "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } - }, + } + }, + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/podschedulingcontexts/{name}/status": { "get": { "consumes": [ "*/*" ], - "description": "read the specified ResourceClaimParameters", - "operationId": "readResourceV1alpha2NamespacedResourceClaimParameters", + "description": "read status of the specified PodSchedulingContext", + "operationId": "readResourceV1alpha3NamespacedPodSchedulingContextStatus", "produces": [ "application/json", "application/yaml", @@ -71443,7 +71305,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71454,18 +71316,18 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ { - "description": "name of the ResourceClaimParameters", + "description": "name of the PodSchedulingContext", "in": "path", "name": "name", "required": true, @@ -71486,8 +71348,8 @@ "application/strategic-merge-patch+json", "application/apply-patch+yaml" ], - "description": "partially update the specified ResourceClaimParameters", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimParameters", + "description": "partially update status of the specified PodSchedulingContext", + "operationId": "patchResourceV1alpha3NamespacedPodSchedulingContextStatus", "parameters": [ { "$ref": "#/parameters/body-78PwaGsr" @@ -71522,13 +71384,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71539,28 +71401,28 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "put": { "consumes": [ "*/*" ], - "description": "replace the specified ResourceClaimParameters", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimParameters", + "description": "replace status of the specified PodSchedulingContext", + "operationId": "replaceResourceV1alpha3NamespacedPodSchedulingContextStatus", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, { @@ -71590,13 +71452,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "401": { @@ -71607,23 +71469,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims": { "delete": { "consumes": [ "*/*" ], "description": "delete collection of ResourceClaim", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaim", + "operationId": "deleteResourceV1alpha3CollectionNamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -71689,13 +71551,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { @@ -71703,7 +71565,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClaim", - "operationId": "listResourceV1alpha2NamespacedResourceClaim", + "operationId": "listResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" @@ -71747,7 +71609,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "401": { @@ -71758,13 +71620,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -71780,14 +71642,14 @@ "*/*" ], "description": "create a ResourceClaim", - "operationId": "createResourceV1alpha2NamespacedResourceClaim", + "operationId": "createResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, { @@ -71817,19 +71679,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -71840,23 +71702,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}": { "delete": { "consumes": [ "*/*" ], "description": "delete a ResourceClaim", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaim", + "operationId": "deleteResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -71887,13 +71749,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -71904,13 +71766,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { @@ -71918,7 +71780,7 @@ "*/*" ], "description": "read the specified ResourceClaim", - "operationId": "readResourceV1alpha2NamespacedResourceClaim", + "operationId": "readResourceV1alpha3NamespacedResourceClaim", "produces": [ "application/json", "application/yaml", @@ -71928,7 +71790,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -71939,13 +71801,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -71972,7 +71834,7 @@ "application/apply-patch+yaml" ], "description": "partially update the specified ResourceClaim", - "operationId": "patchResourceV1alpha2NamespacedResourceClaim", + "operationId": "patchResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/body-78PwaGsr" @@ -72007,13 +71869,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -72024,13 +71886,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "put": { @@ -72038,14 +71900,14 @@ "*/*" ], "description": "replace the specified ResourceClaim", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaim", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, { @@ -72075,13 +71937,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -72092,23 +71954,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status": { "get": { "consumes": [ "*/*" ], "description": "read status of the specified ResourceClaim", - "operationId": "readResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "readResourceV1alpha3NamespacedResourceClaimStatus", "produces": [ "application/json", "application/yaml", @@ -72118,7 +71980,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -72129,13 +71991,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -72162,7 +72024,7 @@ "application/apply-patch+yaml" ], "description": "partially update status of the specified ResourceClaim", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "patchResourceV1alpha3NamespacedResourceClaimStatus", "parameters": [ { "$ref": "#/parameters/body-78PwaGsr" @@ -72197,13 +72059,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -72214,13 +72076,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "put": { @@ -72228,14 +72090,14 @@ "*/*" ], "description": "replace status of the specified ResourceClaim", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaimStatus", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, { @@ -72265,13 +72127,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "401": { @@ -72282,23 +72144,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates": { "delete": { "consumes": [ "*/*" ], "description": "delete collection of ResourceClaimTemplate", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaimTemplate", + "operationId": "deleteResourceV1alpha3CollectionNamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -72364,13 +72226,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { @@ -72378,7 +72240,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClaimTemplate", - "operationId": "listResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "listResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" @@ -72422,7 +72284,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "401": { @@ -72433,13 +72295,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -72455,14 +72317,14 @@ "*/*" ], "description": "create a ResourceClaimTemplate", - "operationId": "createResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "createResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, { @@ -72492,19 +72354,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "401": { @@ -72515,23 +72377,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name}": { "delete": { "consumes": [ "*/*" ], "description": "delete a ResourceClaimTemplate", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "deleteResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -72562,13 +72424,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "401": { @@ -72579,13 +72441,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { @@ -72593,7 +72455,7 @@ "*/*" ], "description": "read the specified ResourceClaimTemplate", - "operationId": "readResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "readResourceV1alpha3NamespacedResourceClaimTemplate", "produces": [ "application/json", "application/yaml", @@ -72603,7 +72465,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "401": { @@ -72614,13 +72476,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -72647,7 +72509,7 @@ "application/apply-patch+yaml" ], "description": "partially update the specified ResourceClaimTemplate", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "patchResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/body-78PwaGsr" @@ -72682,13 +72544,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "401": { @@ -72699,13 +72561,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "put": { @@ -72713,14 +72575,14 @@ "*/*" ], "description": "replace the specified ResourceClaimTemplate", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, { @@ -72750,13 +72612,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "401": { @@ -72767,135 +72629,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters": { - "delete": { - "consumes": [ - "*/*" - ], - "description": "delete collection of ResourceClassParameters", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClassParameters", - "parameters": [ - { - "$ref": "#/parameters/body-2Y1dVQaQ" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/orphanDependents-uRB25kX5" - }, - { - "$ref": "#/parameters/propagationPolicy-6jk3prlO" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, + "/apis/resource.k8s.io/v1alpha3/podschedulingcontexts": { "get": { "consumes": [ "*/*" ], - "description": "list or watch objects of kind ResourceClassParameters", - "operationId": "listResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ], + "description": "list or watch objects of kind PodSchedulingContext", + "operationId": "listResourceV1alpha3PodSchedulingContextForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -72907,7 +72657,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } }, "401": { @@ -72918,460 +72668,13 @@ "https" ], "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - } - ], - "post": { - "consumes": [ - "*/*" - ], - "description": "create ResourceClassParameters", - "operationId": "createResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldManager-Qy4HdaTW" - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}": { - "delete": { - "consumes": [ - "*/*" - ], - "description": "delete ResourceClassParameters", - "operationId": "deleteResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "$ref": "#/parameters/body-2Y1dVQaQ" - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" - }, - { - "$ref": "#/parameters/orphanDependents-uRB25kX5" - }, - { - "$ref": "#/parameters/propagationPolicy-6jk3prlO" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "get": { - "consumes": [ - "*/*" - ], - "description": "read the specified ResourceClassParameters", - "operationId": "readResourceV1alpha2NamespacedResourceClassParameters", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "name of the ResourceClassParameters", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - } - ], - "patch": { - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json", - "application/apply-patch+yaml" - ], - "description": "partially update the specified ResourceClassParameters", - "operationId": "patchResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "$ref": "#/parameters/body-78PwaGsr" - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldManager-7c6nTn1T" - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/force-tOGGb0Yi" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "put": { - "consumes": [ - "*/*" - ], - "description": "replace the specified ResourceClassParameters", - "operationId": "replaceResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldManager-Qy4HdaTW" - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/podschedulingcontexts": { - "get": { - "consumes": [ - "*/*" - ], - "description": "list or watch objects of kind PodSchedulingContext", - "operationId": "listResourceV1alpha2PodSchedulingContextForAllNamespaces", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "PodSchedulingContext", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/resourceclaimparameters": { - "get": { - "consumes": [ - "*/*" - ], - "description": "list or watch objects of kind ResourceClaimParameters", - "operationId": "listResourceV1alpha2ResourceClaimParametersForAllNamespaces", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -73410,13 +72713,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/resourceclaims": { + "/apis/resource.k8s.io/v1alpha3/resourceclaims": { "get": { "consumes": [ "*/*" ], "description": "list or watch objects of kind ResourceClaim", - "operationId": "listResourceV1alpha2ResourceClaimForAllNamespaces", + "operationId": "listResourceV1alpha3ResourceClaimForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -73428,7 +72731,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "401": { @@ -73439,13 +72742,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -73484,13 +72787,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/resourceclaimtemplates": { + "/apis/resource.k8s.io/v1alpha3/resourceclaimtemplates": { "get": { "consumes": [ "*/*" ], "description": "list or watch objects of kind ResourceClaimTemplate", - "operationId": "listResourceV1alpha2ResourceClaimTemplateForAllNamespaces", + "operationId": "listResourceV1alpha3ResourceClaimTemplateForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -73502,7 +72805,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "401": { @@ -73513,13 +72816,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -73558,13 +72861,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/resourceclasses": { + "/apis/resource.k8s.io/v1alpha3/resourceslices": { "delete": { "consumes": [ "*/*" ], - "description": "delete collection of ResourceClass", - "operationId": "deleteResourceV1alpha2CollectionResourceClass", + "description": "delete collection of ResourceSlice", + "operationId": "deleteResourceV1alpha3CollectionResourceSlice", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -73630,21 +72933,21 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "get": { "consumes": [ "*/*" ], - "description": "list or watch objects of kind ResourceClass", - "operationId": "listResourceV1alpha2ResourceClass", + "description": "list or watch objects of kind ResourceSlice", + "operationId": "listResourceV1alpha3ResourceSlice", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" @@ -73688,7 +72991,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassList" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSliceList" } }, "401": { @@ -73699,13 +73002,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "parameters": [ @@ -73717,15 +73020,15 @@ "consumes": [ "*/*" ], - "description": "create a ResourceClass", - "operationId": "createResourceV1alpha2ResourceClass", + "description": "create a ResourceSlice", + "operationId": "createResourceV1alpha3ResourceSlice", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, { @@ -73755,19 +73058,19 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "401": { @@ -73778,23 +73081,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}": { + "/apis/resource.k8s.io/v1alpha3/resourceslices/{name}": { "delete": { "consumes": [ "*/*" ], - "description": "delete a ResourceClass", - "operationId": "deleteResourceV1alpha2ResourceClass", + "description": "delete a ResourceSlice", + "operationId": "deleteResourceV1alpha3ResourceSlice", "parameters": [ { "$ref": "#/parameters/body-2Y1dVQaQ" @@ -73825,13 +73128,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "202": { "description": "Accepted", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "401": { @@ -73842,21 +73145,21 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "get": { "consumes": [ "*/*" ], - "description": "read the specified ResourceClass", - "operationId": "readResourceV1alpha2ResourceClass", + "description": "read the specified ResourceSlice", + "operationId": "readResourceV1alpha3ResourceSlice", "produces": [ "application/json", "application/yaml", @@ -73866,7 +73169,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "401": { @@ -73877,18 +73180,18 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "parameters": [ { - "description": "name of the ResourceClass", + "description": "name of the ResourceSlice", "in": "path", "name": "name", "required": true, @@ -73906,8 +73209,8 @@ "application/strategic-merge-patch+json", "application/apply-patch+yaml" ], - "description": "partially update the specified ResourceClass", - "operationId": "patchResourceV1alpha2ResourceClass", + "description": "partially update the specified ResourceSlice", + "operationId": "patchResourceV1alpha3ResourceSlice", "parameters": [ { "$ref": "#/parameters/body-78PwaGsr" @@ -73942,13 +73245,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "401": { @@ -73959,28 +73262,28 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "put": { "consumes": [ "*/*" ], - "description": "replace the specified ResourceClass", - "operationId": "replaceResourceV1alpha2ResourceClass", + "description": "replace the specified ResourceSlice", + "operationId": "replaceResourceV1alpha3ResourceSlice", "parameters": [ { "in": "body", "name": "body", "required": true, "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, { @@ -74010,13 +73313,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "201": { "description": "Created", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/definitions/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "401": { @@ -74027,23 +73330,23 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/resourceclassparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/deviceclasses": { "get": { "consumes": [ "*/*" ], - "description": "list or watch objects of kind ResourceClassParameters", - "operationId": "listResourceV1alpha2ResourceClassParametersForAllNamespaces", + "description": "watch individual changes to a list of DeviceClass. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3DeviceClassList", "produces": [ "application/json", "application/yaml", @@ -74055,7 +73358,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "401": { @@ -74066,13 +73369,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "list", + "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ @@ -74111,68 +73414,25 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/resourceslices": { - "delete": { + "/apis/resource.k8s.io/v1alpha3/watch/deviceclasses/{name}": { + "get": { "consumes": [ "*/*" ], - "description": "delete collection of ResourceSlice", - "operationId": "deleteResourceV1alpha2CollectionResourceSlice", - "parameters": [ - { - "$ref": "#/parameters/body-2Y1dVQaQ" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/orphanDependents-uRB25kX5" - }, - { - "$ref": "#/parameters/propagationPolicy-6jk3prlO" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - } - ], + "description": "watch changes to an object of kind DeviceClass. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3DeviceClass", "produces": [ "application/json", "application/yaml", - "application/vnd.kubernetes.protobuf" + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "401": { @@ -74183,449 +73443,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "deletecollection", + "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, - "get": { - "consumes": [ - "*/*" - ], - "description": "list or watch objects of kind ResourceSlice", - "operationId": "listResourceV1alpha2ResourceSlice", - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSliceList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/pretty-tJGM1-ng" - } - ], - "post": { - "consumes": [ - "*/*" - ], - "description": "create a ResourceSlice", - "operationId": "createResourceV1alpha2ResourceSlice", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldManager-Qy4HdaTW" - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/resourceslices/{name}": { - "delete": { - "consumes": [ - "*/*" - ], - "description": "delete a ResourceSlice", - "operationId": "deleteResourceV1alpha2ResourceSlice", - "parameters": [ - { - "$ref": "#/parameters/body-2Y1dVQaQ" - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/gracePeriodSeconds--K5HaBOS" - }, - { - "$ref": "#/parameters/orphanDependents-uRB25kX5" - }, - { - "$ref": "#/parameters/propagationPolicy-6jk3prlO" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, - "get": { - "consumes": [ - "*/*" - ], - "description": "read the specified ResourceSlice", - "operationId": "readResourceV1alpha2ResourceSlice", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "name of the ResourceSlice", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - } - ], - "patch": { - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json", - "application/apply-patch+yaml" - ], - "description": "partially update the specified ResourceSlice", - "operationId": "patchResourceV1alpha2ResourceSlice", - "parameters": [ - { - "$ref": "#/parameters/body-78PwaGsr" - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldManager-7c6nTn1T" - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/force-tOGGb0Yi" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, - "put": { - "consumes": [ - "*/*" - ], - "description": "replace the specified ResourceSlice", - "operationId": "replaceResourceV1alpha2ResourceSlice", - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/fieldManager-Qy4HdaTW" - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "type": "string", - "uniqueItems": true - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/podschedulingcontexts": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedPodSchedulingContextList", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ @@ -74645,93 +73469,13 @@ "$ref": "#/parameters/limit-1NfNmdNH" }, { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/podschedulingcontexts/{name}": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch changes to an object of kind PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedPodSchedulingContext", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "description": "name of the PodSchedulingContext", + "description": "name of the DeviceClass", "in": "path", "name": "name", "required": true, "type": "string", "uniqueItems": true }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, { "$ref": "#/parameters/pretty-tJGM1-ng" }, @@ -74752,252 +73496,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/podschedulingcontexts": { "get": { "consumes": [ "*/*" ], - "description": "watch individual changes to a list of ResourceClaimParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimParametersList", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimparameters/{name}": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch changes to an object of kind ResourceClaimParameters. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimParameters", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "description": "name of the ResourceClaimParameters", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaims": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimList", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaims/{name}": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch changes to an object of kind ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaim", + "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3NamespacedPodSchedulingContextList", "produces": [ "application/json", "application/yaml", @@ -75020,98 +73525,13 @@ "https" ], "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" - }, - { - "description": "name of the ResourceClaim", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, - { - "$ref": "#/parameters/namespace-vgWSWtn3" - }, - { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimtemplates": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimTemplateList", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -75153,13 +73573,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimtemplates/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/podschedulingcontexts/{name}": { "get": { "consumes": [ "*/*" ], - "description": "watch changes to an object of kind ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimTemplate", + "description": "watch changes to an object of kind PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3NamespacedPodSchedulingContext", "produces": [ "application/json", "application/yaml", @@ -75182,13 +73602,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -75208,7 +73628,7 @@ "$ref": "#/parameters/limit-1NfNmdNH" }, { - "description": "name of the ResourceClaimTemplate", + "description": "name of the PodSchedulingContext", "in": "path", "name": "name", "required": true, @@ -75238,13 +73658,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclassparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaims": { "get": { "consumes": [ "*/*" ], - "description": "watch individual changes to a list of ResourceClassParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClassParametersList", + "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimList", "produces": [ "application/json", "application/yaml", @@ -75267,13 +73687,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ @@ -75315,13 +73735,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclassparameters/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaims/{name}": { "get": { "consumes": [ "*/*" ], - "description": "watch changes to an object of kind ResourceClassParameters. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClassParameters", + "description": "watch changes to an object of kind ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaim", "produces": [ "application/json", "application/yaml", @@ -75344,13 +73764,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ @@ -75370,7 +73790,7 @@ "$ref": "#/parameters/limit-1NfNmdNH" }, { - "description": "name of the ResourceClassParameters", + "description": "name of the ResourceClaim", "in": "path", "name": "name", "required": true, @@ -75400,13 +73820,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/podschedulingcontexts": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaimtemplates": { "get": { "consumes": [ "*/*" ], - "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2PodSchedulingContextListForAllNamespaces", + "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimTemplateList", "produces": [ "application/json", "application/yaml", @@ -75429,13 +73849,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "ResourceClaimTemplate", + "version": "v1alpha3" } }, "parameters": [ @@ -75455,78 +73875,7 @@ "$ref": "#/parameters/limit-1NfNmdNH" }, { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclaimparameters": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch individual changes to a list of ResourceClaimParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimParametersListForAllNamespaces", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" - }, - { - "$ref": "#/parameters/limit-1NfNmdNH" + "$ref": "#/parameters/namespace-vgWSWtn3" }, { "$ref": "#/parameters/pretty-tJGM1-ng" @@ -75548,13 +73897,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclaims": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaimtemplates/{name}": { "get": { "consumes": [ "*/*" ], - "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimListForAllNamespaces", + "description": "watch changes to an object of kind ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimTemplate", "produces": [ "application/json", "application/yaml", @@ -75577,13 +73926,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watchlist", + "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" + "kind": "ResourceClaimTemplate", + "version": "v1alpha3" } }, "parameters": [ @@ -75603,78 +73952,15 @@ "$ref": "#/parameters/limit-1NfNmdNH" }, { - "$ref": "#/parameters/pretty-tJGM1-ng" - }, - { - "$ref": "#/parameters/resourceVersion-5WAnf1kx" - }, - { - "$ref": "#/parameters/resourceVersionMatch-t8XhRHeC" - }, - { - "$ref": "#/parameters/sendInitialEvents-rLXlEK_k" - }, - { - "$ref": "#/parameters/timeoutSeconds-yvYezaOC" - }, - { - "$ref": "#/parameters/watch-XNNPZGbK" - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclaimtemplates": { - "get": { - "consumes": [ - "*/*" - ], - "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimTemplateListForAllNamespaces", - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "schemes": [ - "https" - ], - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimTemplate", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "$ref": "#/parameters/allowWatchBookmarks-HC2hJt-J" - }, - { - "$ref": "#/parameters/continue-QfD61s0i" - }, - { - "$ref": "#/parameters/fieldSelector-xIcQKXFG" - }, - { - "$ref": "#/parameters/labelSelector-5Zw57w4C" + "description": "name of the ResourceClaimTemplate", + "in": "path", + "name": "name", + "required": true, + "type": "string", + "uniqueItems": true }, { - "$ref": "#/parameters/limit-1NfNmdNH" + "$ref": "#/parameters/namespace-vgWSWtn3" }, { "$ref": "#/parameters/pretty-tJGM1-ng" @@ -75696,13 +73982,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclasses": { + "/apis/resource.k8s.io/v1alpha3/watch/podschedulingcontexts": { "get": { "consumes": [ "*/*" ], - "description": "watch individual changes to a list of ResourceClass. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClassList", + "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3PodSchedulingContextListForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -75725,13 +74011,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -75770,13 +74056,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclasses/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceclaims": { "get": { "consumes": [ "*/*" ], - "description": "watch changes to an object of kind ResourceClass. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2ResourceClass", + "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3ResourceClaimListForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -75799,13 +74085,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watch", + "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ @@ -75824,14 +74110,6 @@ { "$ref": "#/parameters/limit-1NfNmdNH" }, - { - "description": "name of the ResourceClass", - "in": "path", - "name": "name", - "required": true, - "type": "string", - "uniqueItems": true - }, { "$ref": "#/parameters/pretty-tJGM1-ng" }, @@ -75852,13 +74130,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclassparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceclaimtemplates": { "get": { "consumes": [ "*/*" ], - "description": "watch individual changes to a list of ResourceClassParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClassParametersListForAllNamespaces", + "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3ResourceClaimTemplateListForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -75881,13 +74159,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "ResourceClaimTemplate", + "version": "v1alpha3" } }, "parameters": [ @@ -75926,13 +74204,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceslices": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceslices": { "get": { "consumes": [ "*/*" ], "description": "watch individual changes to a list of ResourceSlice. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceSliceList", + "operationId": "watchResourceV1alpha3ResourceSliceList", "produces": [ "application/json", "application/yaml", @@ -75955,13 +74233,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceSlice", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -76000,13 +74278,13 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceslices/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceslices/{name}": { "get": { "consumes": [ "*/*" ], "description": "watch changes to an object of kind ResourceSlice. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2ResourceSlice", + "operationId": "watchResourceV1alpha3ResourceSlice", "produces": [ "application/json", "application/yaml", @@ -76029,13 +74307,13 @@ "https" ], "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceSlice", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ diff --git a/api/openapi-spec/v3/api__v1_openapi.json b/api/openapi-spec/v3/api__v1_openapi.json index c974fc0b87f78..e24eb73b4127e 100644 --- a/api/openapi-spec/v3/api__v1_openapi.json +++ b/api/openapi-spec/v3/api__v1_openapi.json @@ -6516,6 +6516,10 @@ "default": "", "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + "type": "string" } }, "required": [ @@ -8960,7 +8964,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -9359,7 +9363,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -9706,7 +9710,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json index b769eefeefd42..9bd51f953705a 100644 --- a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1_openapi.json @@ -1555,7 +1555,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1949,7 +1949,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -2296,7 +2296,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1alpha1_openapi.json b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1alpha1_openapi.json index 88173bb896824..7600ba179c0f5 100644 --- a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1alpha1_openapi.json +++ b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1alpha1_openapi.json @@ -1067,7 +1067,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1461,7 +1461,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1808,7 +1808,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1beta1_openapi.json b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1beta1_openapi.json index ead9b882f569d..7b4a7d735ec5c 100644 --- a/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1beta1_openapi.json +++ b/api/openapi-spec/v3/apis__admissionregistration.k8s.io__v1beta1_openapi.json @@ -1069,7 +1069,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1463,7 +1463,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1810,7 +1810,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json index fe414447ae30e..c27c46c411a7b 100644 --- a/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json @@ -1284,7 +1284,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1621,7 +1621,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1968,7 +1968,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__apiregistration.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__apiregistration.k8s.io__v1_openapi.json index cfd09f0406bd4..bac6e66592999 100644 --- a/api/openapi-spec/v3/apis__apiregistration.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__apiregistration.k8s.io__v1_openapi.json @@ -417,7 +417,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -754,7 +754,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1101,7 +1101,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__apps__v1_openapi.json b/api/openapi-spec/v3/apis__apps__v1_openapi.json index 5d7ee38038fb3..26c11dbaac87d 100644 --- a/api/openapi-spec/v3/apis__apps__v1_openapi.json +++ b/api/openapi-spec/v3/apis__apps__v1_openapi.json @@ -4286,6 +4286,10 @@ "default": "", "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + "type": "string" } }, "required": [ @@ -5755,7 +5759,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -6149,7 +6153,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -6496,7 +6500,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json b/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json index 47bfcfa89b61f..c4c5de1371a73 100644 --- a/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json +++ b/api/openapi-spec/v3/apis__autoscaling__v1_openapi.json @@ -610,7 +610,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -947,7 +947,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1294,7 +1294,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json b/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json index 2329392ee0344..54a03a41c4c91 100644 --- a/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json +++ b/api/openapi-spec/v3/apis__autoscaling__v2_openapi.json @@ -1262,7 +1262,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1656,7 +1656,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -2003,7 +2003,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__batch__v1_openapi.json b/api/openapi-spec/v3/apis__batch__v1_openapi.json index 7885d315946b4..e8e27469e53e9 100644 --- a/api/openapi-spec/v3/apis__batch__v1_openapi.json +++ b/api/openapi-spec/v3/apis__batch__v1_openapi.json @@ -3490,6 +3490,10 @@ "default": "", "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" + }, + "request": { + "description": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + "type": "string" } }, "required": [ @@ -4959,7 +4963,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -5353,7 +5357,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -5700,7 +5704,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__certificates.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__certificates.k8s.io__v1_openapi.json index db7c780a2259e..67c90503e0ea7 100644 --- a/api/openapi-spec/v3/apis__certificates.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__certificates.k8s.io__v1_openapi.json @@ -646,7 +646,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -983,7 +983,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1330,7 +1330,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__certificates.k8s.io__v1alpha1_openapi.json b/api/openapi-spec/v3/apis__certificates.k8s.io__v1alpha1_openapi.json index 1c5fa179825ec..2d26fcf3be388 100644 --- a/api/openapi-spec/v3/apis__certificates.k8s.io__v1alpha1_openapi.json +++ b/api/openapi-spec/v3/apis__certificates.k8s.io__v1alpha1_openapi.json @@ -522,7 +522,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -859,7 +859,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1206,7 +1206,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__coordination.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__coordination.k8s.io__v1_openapi.json index d0bb9ff249e4a..3938d6e619c11 100644 --- a/api/openapi-spec/v3/apis__coordination.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__coordination.k8s.io__v1_openapi.json @@ -537,7 +537,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -879,7 +879,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1226,7 +1226,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__discovery.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__discovery.k8s.io__v1_openapi.json index b04950e2ff863..6f41f5fd326e3 100644 --- a/api/openapi-spec/v3/apis__discovery.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__discovery.k8s.io__v1_openapi.json @@ -700,7 +700,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1037,7 +1037,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1384,7 +1384,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__events.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__events.k8s.io__v1_openapi.json index 4f40ca344f5eb..c0df343418d0b 100644 --- a/api/openapi-spec/v3/apis__events.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__events.k8s.io__v1_openapi.json @@ -655,7 +655,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -997,7 +997,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1344,7 +1344,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1_openapi.json index a8a5f7cf492b2..34c70daea9b53 100644 --- a/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1_openapi.json @@ -1146,7 +1146,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1483,7 +1483,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1830,7 +1830,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1beta3_openapi.json b/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1beta3_openapi.json index b05112078966e..6c69e0c92b848 100644 --- a/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1beta3_openapi.json +++ b/api/openapi-spec/v3/apis__flowcontrol.apiserver.k8s.io__v1beta3_openapi.json @@ -1147,7 +1147,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1484,7 +1484,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1831,7 +1831,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json b/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json index e580ce3acf04c..6d0959b0d421e 100644 --- a/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json +++ b/api/openapi-spec/v3/apis__internal.apiserver.k8s.io__v1alpha1_openapi.json @@ -636,7 +636,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -973,7 +973,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1320,7 +1320,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json index b33cc9dae024f..79089323f4e62 100644 --- a/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__networking.k8s.io__v1_openapi.json @@ -1217,7 +1217,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1611,7 +1611,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1958,7 +1958,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json b/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json index 5e385fde4f75c..c6e357f24d459 100644 --- a/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json +++ b/api/openapi-spec/v3/apis__networking.k8s.io__v1beta1_openapi.json @@ -722,7 +722,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1059,7 +1059,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1406,7 +1406,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__node.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__node.k8s.io__v1_openapi.json index ef99a634b7daa..9862438545b54 100644 --- a/api/openapi-spec/v3/apis__node.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__node.k8s.io__v1_openapi.json @@ -595,7 +595,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -932,7 +932,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1279,7 +1279,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__policy__v1_openapi.json b/api/openapi-spec/v3/apis__policy__v1_openapi.json index 85d83be73d19d..789cf20ab651f 100644 --- a/api/openapi-spec/v3/apis__policy__v1_openapi.json +++ b/api/openapi-spec/v3/apis__policy__v1_openapi.json @@ -657,7 +657,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1051,7 +1051,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1398,7 +1398,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__rbac.authorization.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__rbac.authorization.k8s.io__v1_openapi.json index 23a0779239e42..35ee1cfd3abc5 100644 --- a/api/openapi-spec/v3/apis__rbac.authorization.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__rbac.authorization.k8s.io__v1_openapi.json @@ -930,7 +930,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -1324,7 +1324,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1671,7 +1671,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__resource.k8s.io__v1alpha2_openapi.json b/api/openapi-spec/v3/apis__resource.k8s.io__v1alpha3_openapi.json similarity index 69% rename from api/openapi-spec/v3/apis__resource.k8s.io__v1alpha2_openapi.json rename to api/openapi-spec/v3/apis__resource.k8s.io__v1alpha3_openapi.json index abe72129b03fb..24d52b8ffa52c 100644 --- a/api/openapi-spec/v3/apis__resource.k8s.io__v1alpha2_openapi.json +++ b/api/openapi-spec/v3/apis__resource.k8s.io__v1alpha3_openapi.json @@ -86,151 +86,86 @@ "type": "object", "x-kubernetes-map-type": "atomic" }, - "io.k8s.api.resource.v1alpha2.AllocationResult": { + "io.k8s.api.resource.v1alpha3.AllocationResult": { "description": "AllocationResult contains attributes of an allocated resource.", "properties": { - "availableOnNodes": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" - } - ], - "description": "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere." - }, - "resourceHandles": { - "description": "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceHandle" - } - ], - "default": {} - }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "controller": { + "description": "Controller is the name of the DRA driver which handled the allocation. That driver is also responsible for deallocating the claim. It is empty when the claim can be deallocated without involving a driver.\n\nA driver may allocate devices provided by other drivers, so this driver name here can be different from the driver names listed for the results.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", + "type": "string" }, - "shareable": { - "description": "Shareable determines whether the resource supports more than one consumer at a time.", - "type": "boolean" - } - }, - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.DriverAllocationResult": { - "description": "DriverAllocationResult contains vendor parameters and the allocation result for one request.", - "properties": { - "namedResources": { + "devices": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceAllocationResult" } ], - "description": "NamedResources describes the allocation result when using the named resources model." + "default": {}, + "description": "Devices is the result of allocating devices." }, - "vendorRequestParameters": { + "nodeSelector": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" + "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" } ], - "description": "VendorRequestParameters are the per-request configuration parameters from the time that the claim was allocated." + "description": "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere." } }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.DriverRequests": { - "description": "DriverRequests describes all resources that are needed from one particular driver.", + "io.k8s.api.resource.v1alpha3.BasicDevice": { + "description": "BasicDevice defines one device instance using fields that are supported by all clients which support DRA.", "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", - "type": "string" - }, - "requests": { - "description": "Requests describes all resources that are needed from the driver.", - "items": { + "attributes": { + "additionalProperties": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceRequest" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceAttribute" } ], "default": {} }, - "type": "array", - "x-kubernetes-list-type": "atomic" + "description": "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.", + "type": "object" }, - "vendorParameters": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" - } - ], - "description": "VendorParameters are arbitrary setup parameters for all requests of the claim. They are ignored while allocating the claim." + "capacity": { + "additionalProperties": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" + }, + "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" } }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult": { - "description": "NamedResourcesAllocationResult is used in AllocationResultModel.", + "io.k8s.api.resource.v1alpha3.CELDeviceSelector": { + "description": "CELDeviceSelector contains a CEL expression for selecting a device.", "properties": { - "name": { + "expression": { "default": "", - "description": "Name is the name of the selected resource instance.", + "description": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)", "type": "string" } }, "required": [ - "name" + "expression" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesAttribute": { - "description": "NamedResourcesAttribute is a combination of an attribute name and its value.", + "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": { - "bool": { - "description": "BoolValue is a true/false value.", - "type": "boolean" - }, - "int": { - "description": "IntValue is a 64-bit integer.", - "format": "int64", - "type": "integer" - }, - "intSlice": { + "basic": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.BasicDevice" } ], - "description": "IntSliceValue is an array of 64-bit integers." + "description": "Basic defines one device instance using fields that are supported by all clients which support DRA." }, "name": { "default": "", - "description": "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", - "type": "string" - }, - "quantity": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" - } - ], - "description": "QuantityValue is a quantity." - }, - "string": { - "description": "StringValue is a string.", - "type": "string" - }, - "stringSlice": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice" - } - ], - "description": "StringSliceValue is an array of strings." - }, - "version": { - "description": "VersionValue is a semantic version according to semver.org spec 2.0.0.", + "description": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", "type": "string" } }, @@ -239,29 +174,46 @@ ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesFilter": { - "description": "NamedResourcesFilter is used in ResourceFilterModel.", + "io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration": { + "description": "DeviceAllocationConfiguration gets embedded in an AllocationResult.", "properties": { - "selector": { + "opaque": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration" + } + ], + "description": "Opaque provides driver-specific configuration parameters." + }, + "requests": { + "description": "Requests lists the names of requests where the configuration applies. If empty, its applies to all requests.", + "items": { + "default": "", + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "source": { "default": "", - "description": "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type in NamedResourcesAttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", + "description": "Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim.", "type": "string" } }, "required": [ - "selector" + "source" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesInstance": { - "description": "NamedResourcesInstance represents one individual hardware instance that can be selected based on its attributes.", + "io.k8s.api.resource.v1alpha3.DeviceAllocationResult": { + "description": "DeviceAllocationResult is the result of allocating devices.", "properties": { - "attributes": { - "description": "Attributes defines the attributes of this resource instance. The name of each attribute must be unique.", + "config": { + "description": "This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag.\n\nThis includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesAttribute" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration" } ], "default": {} @@ -269,59 +221,80 @@ "type": "array", "x-kubernetes-list-type": "atomic" }, - "name": { - "default": "", - "description": "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice": { - "description": "NamedResourcesIntSlice contains a slice of 64-bit integers.", - "properties": { - "ints": { - "description": "Ints is the slice of 64-bit integers.", + "results": { + "description": "Results lists all allocated devices.", "items": { - "default": 0, - "format": "int64", - "type": "integer" + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult" + } + ], + "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" } }, - "required": [ - "ints" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesRequest": { - "description": "NamedResourcesRequest is used in ResourceRequestModel.", + "io.k8s.api.resource.v1alpha3.DeviceAttribute": { + "description": "DeviceAttribute must have exactly one field set.", "properties": { - "selector": { - "default": "", - "description": "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type NamedResourcesin AttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", + "bool": { + "description": "BoolValue is a true/false value.", + "type": "boolean" + }, + "int": { + "description": "IntValue is a number.", + "format": "int64", + "type": "integer" + }, + "string": { + "description": "StringValue is a string. Must not be longer than 64 characters.", + "type": "string" + }, + "version": { + "description": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.", "type": "string" } }, - "required": [ - "selector" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesResources": { - "description": "NamedResourcesResources is used in ResourceModel.", + "io.k8s.api.resource.v1alpha3.DeviceClaim": { + "description": "DeviceClaim defines how to request devices with a ResourceClaim.", "properties": { - "instances": { - "description": "The list of all individual resources instances currently available.", + "config": { + "description": "This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration" + } + ], + "default": {} + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "constraints": { + "description": "These constraints must be satisfied by the set of devices that get allocated for the claim.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceConstraint" + } + ], + "default": {} + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "requests": { + "description": "Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesInstance" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceRequest" } ], "default": {} @@ -330,16 +303,21 @@ "x-kubernetes-list-type": "atomic" } }, - "required": [ - "instances" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice": { - "description": "NamedResourcesStringSlice contains a slice of strings.", + "io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration": { + "description": "DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.", "properties": { - "strings": { - "description": "Strings is the slice of strings.", + "opaque": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration" + } + ], + "description": "Opaque provides driver-specific configuration parameters." + }, + "requests": { + "description": "Requests lists the names of requests where the configuration applies. If empty, it applies to all requests.", "items": { "default": "", "type": "string" @@ -348,13 +326,10 @@ "x-kubernetes-list-type": "atomic" } }, - "required": [ - "strings" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContext": { - "description": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "io.k8s.api.resource.v1alpha3.DeviceClass": { + "description": "DeviceClass is a vendor or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -376,20 +351,11 @@ "spec": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec" - } - ], - "default": {}, - "description": "Spec describes where resources for the Pod are needed." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassSpec" } ], "default": {}, - "description": "Status describes where resources for the Pod can be allocated." + "description": "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number." } }, "required": [ @@ -399,24 +365,38 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContextList": { - "description": "PodSchedulingContextList is a collection of Pod scheduling objects.", + "io.k8s.api.resource.v1alpha3.DeviceClassConfiguration": { + "description": "DeviceClassConfiguration is used in DeviceClass.", + "properties": { + "opaque": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration" + } + ], + "description": "Opaque provides driver-specific configuration parameters." + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceClassList": { + "description": "DeviceClassList is a collection of classes.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "Items is the list of PodSchedulingContext objects.", + "description": "Items is the list of resource classes.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } ], "default": {} @@ -444,146 +424,252 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "PodSchedulingContextList", - "version": "v1alpha2" + "kind": "DeviceClassList", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec": { - "description": "PodSchedulingContextSpec describes where resources for the Pod are needed.", + "io.k8s.api.resource.v1alpha3.DeviceClassSpec": { "properties": { - "potentialNodes": { - "description": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", + "config": { + "description": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", "items": { - "default": "", - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassConfiguration" + } + ], + "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" }, - "selectedNode": { - "description": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", + "selectors": { + "description": "Each selector must be satisfied by a device which is claimed via this class.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceSelector" + } + ], + "default": {} + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "suitableNodes": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" + } + ], + "description": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a claim that has not been allocated yet *and* that claim gets allocated through a control plane controller. It is ignored when the claim does not use a control plane controller for allocation.\n\nSetting this field is optional. If unset, all Nodes are candidates.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate." + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceConstraint": { + "description": "DeviceConstraint must have exactly one field set besides Requests.", + "properties": { + "matchAttribute": { + "description": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.", "type": "string" + }, + "requests": { + "description": "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.", + "items": { + "default": "", + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus": { - "description": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", + "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.\n\nA DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request.", "properties": { - "resourceClaims": { - "description": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", + "adminAccess": { + "default": false, + "description": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.", + "type": "boolean" + }, + "count": { + "description": "Count is used only when the count mode is \"Exact\". Must be greater than zero. If CountMode is Exact and this field is not specified, the default is one.", + "format": "int64", + "type": "integer" + }, + "countMode": { + "description": "CountMode and its related fields define how many devices are needed to satisfy this request. Supported values are:\n\n- Exact: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf countMode is not specified, the default countMode is Exact. If countMode is Exact and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "type": "string" + }, + "deviceClassName": { + "default": "", + "description": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "type": "string" + }, + "name": { + "default": "", + "description": "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.", + "type": "string" + }, + "selectors": { + "description": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceSelector" } ], "default": {} }, "type": "array", - "x-kubernetes-list-map-keys": [ - "name" - ], - "x-kubernetes-list-type": "map" + "x-kubernetes-list-type": "atomic" } }, + "required": [ + "name", + "deviceClassName" + ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaim": { - "description": "ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult": { + "description": "DeviceRequestAllocationResult contains the allocation result for one request.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "device": { + "default": "", + "description": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.", "type": "string" }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "driver": { + "default": "", + "description": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", "type": "string" }, - "metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - } - ], - "default": {}, - "description": "Standard object metadata" + "pool": { + "default": "", + "description": "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.", + "type": "string" }, - "spec": { - "allOf": [ + "request": { + "default": "", + "description": "Request is the name of the request in the claim which caused this device to be allocated. Multiple devices may have been allocated per request.", + "type": "string" + } + }, + "required": [ + "request", + "driver", + "pool", + "device" + ], + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.DeviceSelector": { + "description": "DeviceSelector must have exactly one field set.", + "properties": { + "cel": { + "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimSpec" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.CELDeviceSelector" } ], - "default": {}, - "description": "Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim." + "description": "CEL contains a CEL expression for selecting a device." + } + }, + "required": [ + "cel" + ], + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration": { + "description": "OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor.", + "properties": { + "driver": { + "default": "", + "description": "Driver is used to determine which kubelet plugin needs to be passed these configuration parameters.\n\nAn admission policy provided by the driver developer could use this to decide whether it needs to validate them.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "type": "string" }, - "status": { + "parameters": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimStatus" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], - "default": {}, - "description": "Status describes whether the resource is available and with which attributes." + "description": "Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions." } }, "required": [ - "spec" + "driver", + "parameters" ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" - } - ] + "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference": { - "description": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", + "io.k8s.api.resource.v1alpha3.PodSchedulingContext": { + "description": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DRAControlPlaneController feature gate.", "properties": { - "apiGroup": { - "description": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, - "name": { - "default": "", - "description": "Name is the name of resource being referenced.", + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, - "resource": { - "default": "", - "description": "Resource is the type of resource being referenced, for example \"pods\".", - "type": "string" + "metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + } + ], + "default": {}, + "description": "Standard object metadata" }, - "uid": { - "default": "", - "description": "UID identifies exactly one incarnation of the resource.", - "type": "string" + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec" + } + ], + "default": {}, + "description": "Spec describes where resources for the Pod are needed." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus" + } + ], + "default": {}, + "description": "Status describes where resources for the Pod can be allocated." } }, "required": [ - "resource", - "name", - "uid" + "spec" ], - "type": "object" + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "resource.k8s.io", + "kind": "PodSchedulingContext", + "version": "v1alpha3" + } + ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimList": { - "description": "ResourceClaimList is a collection of claims.", + "io.k8s.api.resource.v1alpha3.PodSchedulingContextList": { + "description": "PodSchedulingContextList is a collection of Pod scheduling objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "Items is the list of resource claims.", + "description": "Items is the list of PodSchedulingContext objects.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } ], "default": {} @@ -611,38 +697,58 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "ResourceClaimList", - "version": "v1alpha2" + "kind": "PodSchedulingContextList", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimParameters": { - "description": "ResourceClaimParameters defines resource requests for a ResourceClaim in an in-tree format understood by Kubernetes.", + "io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec": { + "description": "PodSchedulingContextSpec describes where resources for the Pod are needed.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" + "potentialNodes": { + "description": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", + "items": { + "default": "", + "type": "string" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" }, - "driverRequests": { - "description": "DriverRequests describes all resources that are needed for the allocated claim. A single claim may use resources coming from different drivers. For each driver, this array has at most one entry which then may have one or more per-driver requests.\n\nMay be empty, in which case the claim can always be allocated.", + "selectedNode": { + "description": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", + "type": "string" + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus": { + "description": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", + "properties": { + "resourceClaims": { + "description": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.DriverRequests" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus" } ], "default": {} }, "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "generatedFrom": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference" - } + "x-kubernetes-list-map-keys": [ + "name" ], - "description": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the claim parameters when the parameter reference of the claim refers to some unknown type." + "x-kubernetes-list-type": "map" + } + }, + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.ResourceClaim": { + "description": "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", @@ -657,33 +763,80 @@ "default": {}, "description": "Standard object metadata" }, - "shareable": { - "description": "Shareable indicates whether the allocated claim is meant to be shareable by multiple consumers at the same time.", - "type": "boolean" + "spec": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimSpec" + } + ], + "default": {}, + "description": "Spec describes what is being requested and how to configure it. The spec is immutable." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimStatus" + } + ], + "default": {}, + "description": "Status describes whether the claim is ready to use and what has been allocated." } }, + "required": [ + "spec" + ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimParametersList": { - "description": "ResourceClaimParametersList is a collection of ResourceClaimParameters.", + "io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference": { + "description": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", + "properties": { + "apiGroup": { + "description": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", + "type": "string" + }, + "name": { + "default": "", + "description": "Name is the name of resource being referenced.", + "type": "string" + }, + "resource": { + "default": "", + "description": "Resource is the type of resource being referenced, for example \"pods\".", + "type": "string" + }, + "uid": { + "default": "", + "description": "UID identifies exactly one incarnation of the resource.", + "type": "string" + } + }, + "required": [ + "resource", + "name", + "uid" + ], + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.ResourceClaimList": { + "description": "ResourceClaimList is a collection of claims.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "Items is the list of node resource capacity objects.", + "description": "Items is the list of resource claims.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } ], "default": {} @@ -711,39 +864,16 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "ResourceClaimParametersList", - "version": "v1alpha2" + "kind": "ResourceClaimList", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference": { - "description": "ResourceClaimParametersReference contains enough information to let you locate the parameters for a ResourceClaim. The object must be in the same namespace as the ResourceClaim.", - "properties": { - "apiGroup": { - "description": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "type": "string" - }, - "kind": { - "default": "", - "description": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata, for example \"ConfigMap\".", - "type": "string" - }, - "name": { - "default": "", - "description": "Name is the name of resource being referenced.", - "type": "string" - } - }, - "required": [ - "kind", - "name" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus": { + "io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus": { "description": "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.", "properties": { "name": { + "default": "", "description": "Name matches the pod.spec.resourceClaims[*].Name field.", "type": "string" }, @@ -757,59 +887,51 @@ "x-kubernetes-list-type": "atomic" } }, + "required": [ + "name" + ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimSpec": { - "description": "ResourceClaimSpec defines how a resource is to be allocated.", + "io.k8s.api.resource.v1alpha3.ResourceClaimSpec": { + "description": "ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.", "properties": { - "allocationMode": { - "description": "Allocation can start immediately or when a Pod wants to use the resource. \"WaitForFirstConsumer\" is the default.", + "controller": { + "description": "Controller is the name of the DRA driver that is meant to handle allocation of this claim. If empty, allocation is handled by the scheduler while scheduling a pod.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", "type": "string" }, - "parametersRef": { + "devices": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClaim" } ], - "description": "ParametersRef references a separate object with arbitrary parameters that will be used by the driver when allocating a resource for the claim.\n\nThe object must be in the same namespace as the ResourceClaim." - }, - "resourceClassName": { - "default": "", - "description": "ResourceClassName references the driver and additional parameters via the name of a ResourceClass that was created as part of the driver deployment.", - "type": "string" + "default": {}, + "description": "Devices defines how to request devices." } }, - "required": [ - "resourceClassName" - ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimStatus": { - "description": "ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.", + "io.k8s.api.resource.v1alpha3.ResourceClaimStatus": { + "description": "ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.", "properties": { "allocation": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.AllocationResult" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.AllocationResult" } ], - "description": "Allocation is set by the resource driver once a resource or set of resources has been allocated successfully. If this is not specified, the resources have not been allocated yet." + "description": "Allocation is set once the claim has been allocated successfully." }, "deallocationRequested": { - "description": "DeallocationRequested indicates that a ResourceClaim is to be deallocated.\n\nThe driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nWhile DeallocationRequested is set, no new consumers may be added to ReservedFor.", + "description": "Indicates that a claim is to be deallocated. While this is set, no new consumers may be added to ReservedFor.\n\nThis is only used if the claim needs to be deallocated by a DRA driver. That driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", "type": "boolean" }, - "driverName": { - "description": "DriverName is a copy of the driver name from the ResourceClass at the time when allocation started.", - "type": "string" - }, "reservedFor": { - "description": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", + "description": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.\n\nIn a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.\n\nBoth schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference" } ], "default": {} @@ -825,8 +947,8 @@ }, "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClaimTemplate": { - "description": "ResourceClaimTemplate is used to produce ResourceClaim objects.", + "io.k8s.api.resource.v1alpha3.ResourceClaimTemplate": { + "description": "ResourceClaimTemplate is used to produce ResourceClaim objects.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", @@ -848,7 +970,7 @@ "spec": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec" } ], "default": {}, @@ -863,11 +985,11 @@ { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList": { + "io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList": { "description": "ResourceClaimTemplateList is a collection of claim templates.", "properties": { "apiVersion": { @@ -879,7 +1001,7 @@ "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } ], "default": {} @@ -908,11 +1030,11 @@ { "group": "resource.k8s.io", "kind": "ResourceClaimTemplateList", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec": { + "io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec": { "description": "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.", "properties": { "metadata": { @@ -927,7 +1049,7 @@ "spec": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimSpec" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimSpec" } ], "default": {}, @@ -939,16 +1061,39 @@ ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.ResourceClass": { - "description": "ResourceClass is used by administrators to influence how resources are allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "io.k8s.api.resource.v1alpha3.ResourcePool": { + "description": "ResourcePool describes the pool that ResourceSlices belong to.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" + "generation": { + "default": 0, + "description": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", + "format": "int64", + "type": "integer" }, - "driverName": { + "name": { "default": "", - "description": "DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.\n\nResource drivers have a unique name in forward domain order (acme.example.com).", + "description": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes.", + "type": "string" + }, + "resourceSliceCount": { + "default": 0, + "description": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be higher than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", + "format": "int64", + "type": "integer" + } + }, + "required": [ + "name", + "generation", + "resourceSliceCount" + ], + "type": "object" + }, + "io.k8s.api.resource.v1alpha3.ResourceSlice": { + "description": "ResourceSlice represents one or more resources in a pool of similar resources, managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple , , .\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { @@ -964,52 +1109,41 @@ "default": {}, "description": "Standard object metadata" }, - "parametersRef": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersReference" - } - ], - "description": "ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec." - }, - "structuredParameters": { - "description": "If and only if allocation of claims using this class is handled via structured parameters, then StructuredParameters must be set to true.", - "type": "boolean" - }, - "suitableNodes": { + "spec": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSliceSpec" } ], - "description": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.\n\nSetting this field is optional. If null, all nodes are candidates." + "default": {}, + "description": "Contains the information published by the driver.\n\nChanging the spec automatically increments the metadata.generation number." } }, "required": [ - "driverName" + "spec" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClassList": { - "description": "ResourceClassList is a collection of classes.", + "io.k8s.api.resource.v1alpha3.ResourceSliceList": { + "description": "ResourceSliceList is a collection of ResourceSlices.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { - "description": "Items is the list of resource classes.", + "description": "Items is the list of resource ResourceSlices.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } ], "default": {} @@ -1020,7 +1154,7 @@ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, - "metadata": { + "listMeta": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" @@ -1037,369 +1171,64 @@ "x-kubernetes-group-version-kind": [ { "group": "resource.k8s.io", - "kind": "ResourceClassList", - "version": "v1alpha2" + "kind": "ResourceSliceList", + "version": "v1alpha3" } ] }, - "io.k8s.api.resource.v1alpha2.ResourceClassParameters": { - "description": "ResourceClassParameters defines resource requests for a ResourceClass in an in-tree format understood by Kubernetes.", + "io.k8s.api.resource.v1alpha3.ResourceSliceSpec": { + "description": "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.", "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "filters": { - "description": "Filters describes additional contraints that must be met when using the class.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceFilter" - } - ], - "default": {} - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "generatedFrom": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersReference" - } - ], - "description": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the class parameters when the parameter reference of the class refers to some unknown type." - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - } - ], - "default": {}, - "description": "Standard object metadata" + "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.", + "type": "boolean" }, - "vendorParameters": { - "description": "VendorParameters are arbitrary setup parameters for all claims using this class. They are ignored while allocating the claim. There must not be more than one entry per driver.", + "devices": { + "description": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.", "items": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.VendorParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.Device" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" - } - }, - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClassParametersList": { - "description": "ResourceClassParametersList is a collection of ResourceClassParameters.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of node resource capacity objects.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - ], - "default": {} - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - ], - "default": {}, - "description": "Standard list metadata" - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceClassParametersList", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceClassParametersReference": { - "description": "ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass.", - "properties": { - "apiGroup": { - "description": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "type": "string" - }, - "kind": { - "default": "", - "description": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata.", - "type": "string" - }, - "name": { - "default": "", - "description": "Name is the name of resource being referenced.", - "type": "string" - }, - "namespace": { - "description": "Namespace that contains the referenced resource. Must be empty for cluster-scoped resources and non-empty for namespaced resources.", - "type": "string" - } - }, - "required": [ - "kind", - "name" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceFilter": { - "description": "ResourceFilter is a filter for resources from one particular driver.", - "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", - "type": "string" - }, - "namedResources": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesFilter" - } - ], - "description": "NamedResources describes a resource filter using the named resources model." - } - }, - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceHandle": { - "description": "ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.", - "properties": { - "data": { - "description": "Data contains the opaque data associated with this ResourceHandle. It is set by the controller component of the resource driver whose name matches the DriverName set in the ResourceClaimStatus this ResourceHandle is embedded in. It is set at allocation time and is intended for processing by the kubelet plugin whose name matches the DriverName set in this ResourceHandle.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.", - "type": "string" - }, - "driverName": { - "default": "", - "description": "DriverName specifies the name of the resource driver whose kubelet plugin should be invoked to process this ResourceHandle's data once it lands on a node. This may differ from the DriverName set in ResourceClaimStatus this ResourceHandle is embedded in.", - "type": "string" - }, - "structuredData": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.StructuredResourceHandle" - } - ], - "description": "If StructuredData is set, then it needs to be used instead of Data." - } - }, - "required": [ - "driverName" - ], - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceRequest": { - "description": "ResourceRequest is a request for resources from one particular driver.", - "properties": { - "namedResources": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesRequest" - } - ], - "description": "NamedResources describes a request for resources with the named resources model." - }, - "vendorParameters": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" - } - ], - "description": "VendorParameters are arbitrary setup parameters for the requested resource. They are ignored while allocating a claim." - } - }, - "type": "object" - }, - "io.k8s.api.resource.v1alpha2.ResourceSlice": { - "description": "ResourceSlice provides information about available resources on individual nodes.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" }, - "driverName": { + "driver": { "default": "", - "description": "DriverName identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - } - ], - "default": {}, - "description": "Standard object metadata" - }, - "namedResources": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.NamedResourcesResources" - } - ], - "description": "NamedResources describes available resources using the named resources model." - }, - "nodeName": { - "description": "NodeName identifies the node which provides the resources if they are local to a node.\n\nA field selector can be used to list only ResourceSlice objects with a certain node name.", - "type": "string" - } - }, - "required": [ - "driverName" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.ResourceSliceList": { - "description": "ResourceSliceList is a collection of ResourceSlices.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of node resource capacity objects.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - ], - "default": {} - }, - "type": "array" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "description": "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.", "type": "string" }, - "metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - ], - "default": {}, - "description": "Standard list metadata" - } - }, - "required": [ - "items" - ], - "type": "object", - "x-kubernetes-group-version-kind": [ - { - "group": "resource.k8s.io", - "kind": "ResourceSliceList", - "version": "v1alpha2" - } - ] - }, - "io.k8s.api.resource.v1alpha2.StructuredResourceHandle": { - "description": "StructuredResourceHandle is the in-tree representation of the allocation result.", - "properties": { "nodeName": { - "description": "NodeName is the name of the node providing the necessary resources if the resources are local to a node.", + "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.", "type": "string" }, - "results": { - "description": "Results lists all allocated driver resources.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.DriverAllocationResult" - } - ], - "default": {} - }, - "type": "array", - "x-kubernetes-list-type": "atomic" - }, - "vendorClaimParameters": { + "nodeSelector": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" + "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" } ], - "description": "VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated." + "description": "NodeSelector defines which nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes must be set." }, - "vendorClassParameters": { + "pool": { "allOf": [ { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourcePool" } ], - "description": "VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated." + "default": {}, + "description": "Pool describes the pool that this ResourceSlice belongs to. This field is immutable." } }, "required": [ - "results" + "driver", + "pool" ], "type": "object" }, - "io.k8s.api.resource.v1alpha2.VendorParameters": { - "description": "VendorParameters are opaque parameters for one particular driver.", - "properties": { - "driverName": { - "description": "DriverName is the name used by the DRA driver kubelet plugin.", - "type": "string" - }, - "parameters": { - "allOf": [ - { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" - } - ], - "description": "Parameters can be arbitrary setup parameters. They are ignored while allocating a claim." - } - }, - "type": "object" - }, "io.k8s.apimachinery.pkg.api.resource.Quantity": { "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", "oneOf": [ @@ -1827,7 +1656,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -2164,7 +1993,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -2511,7 +2340,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -2570,10 +2399,10 @@ }, "openapi": "3.0.0", "paths": { - "/apis/resource.k8s.io/v1alpha2/": { + "/apis/resource.k8s.io/v1alpha3/": { "get": { "description": "get available resources", - "operationId": "getResourceV1alpha2APIResources", + "operationId": "getResourceV1alpha3APIResources", "responses": { "200": { "content": { @@ -2600,14 +2429,14 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ] } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts": { + "/apis/resource.k8s.io/v1alpha3/deviceclasses": { "delete": { - "description": "delete collection of PodSchedulingContext", - "operationId": "deleteResourceV1alpha2CollectionNamespacedPodSchedulingContext", + "description": "delete collection of DeviceClass", + "operationId": "deleteResourceV1alpha3CollectionDeviceClass", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", @@ -2753,18 +2582,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "get": { - "description": "list or watch objects of kind PodSchedulingContext", - "operationId": "listResourceV1alpha2NamespacedPodSchedulingContext", + "description": "list or watch objects of kind DeviceClass", + "operationId": "listResourceV1alpha3DeviceClass", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", @@ -2862,27 +2691,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassList" } }, "application/json;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClassList" } } }, @@ -2893,26 +2722,16 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -2924,8 +2743,8 @@ } ], "post": { - "description": "create a PodSchedulingContext", - "operationId": "createResourceV1alpha2NamespacedPodSchedulingContext", + "description": "create a DeviceClass", + "operationId": "createResourceV1alpha3DeviceClass", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -2959,7 +2778,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -2970,17 +2789,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -2990,17 +2809,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3010,17 +2829,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3031,20 +2850,20 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}": { + "/apis/resource.k8s.io/v1alpha3/deviceclasses/{name}": { "delete": { - "description": "delete a PodSchedulingContext", - "operationId": "deleteResourceV1alpha2NamespacedPodSchedulingContext", + "description": "delete a DeviceClass", + "operationId": "deleteResourceV1alpha3DeviceClass", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -3097,17 +2916,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3117,17 +2936,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3138,34 +2957,34 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "get": { - "description": "read the specified PodSchedulingContext", - "operationId": "readResourceV1alpha2NamespacedPodSchedulingContext", + "description": "read the specified DeviceClass", + "operationId": "readResourceV1alpha3DeviceClass", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3176,18 +2995,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ { - "description": "name of the PodSchedulingContext", + "description": "name of the DeviceClass", "in": "path", "name": "name", "required": true, @@ -3196,16 +3015,6 @@ "uniqueItems": true } }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -3217,8 +3026,8 @@ } ], "patch": { - "description": "partially update the specified PodSchedulingContext", - "operationId": "patchResourceV1alpha2NamespacedPodSchedulingContext", + "description": "partially update the specified DeviceClass", + "operationId": "patchResourceV1alpha3DeviceClass", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -3287,17 +3096,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3307,17 +3116,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3328,18 +3137,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "put": { - "description": "replace the specified PodSchedulingContext", - "operationId": "replaceResourceV1alpha2NamespacedPodSchedulingContext", + "description": "replace the specified DeviceClass", + "operationId": "replaceResourceV1alpha3DeviceClass", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -3373,7 +3182,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3384,17 +3193,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3404,17 +3213,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceClass" } } }, @@ -3425,90 +3234,30 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status": { - "get": { - "description": "read status of the specified PodSchedulingContext", - "operationId": "readResourceV1alpha2NamespacedPodSchedulingContextStatus", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "name of the PodSchedulingContext", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "patch": { - "description": "partially update status of the specified PodSchedulingContext", - "operationId": "patchResourceV1alpha2NamespacedPodSchedulingContextStatus", + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/podschedulingcontexts": { + "delete": { + "description": "delete collection of PodSchedulingContext", + "operationId": "deleteResourceV1alpha3CollectionNamespacedPodSchedulingContext", "parameters": [ + { + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "in": "query", + "name": "continue", + "schema": { + "type": "string", + "uniqueItems": true + } + }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", @@ -3519,407 +3268,178 @@ } }, { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", - "name": "fieldManager", + "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", - "name": "fieldValidation", + "name": "gracePeriodSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", - "name": "force", + "name": "limit", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "in": "query", + "name": "orphanDependents", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", + "in": "query", + "name": "propagationPolicy", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersion", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersionMatch", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "in": "query", + "name": "sendInitialEvents", "schema": { "type": "boolean", "uniqueItems": true } + }, + { + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "in": "query", + "name": "timeoutSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } } ], "requestBody": { "content": { - "application/apply-patch+yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/json-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/strategic-merge-patch+json": { + "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } - }, - "required": true + } }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - } - }, - "description": "Created" - }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "patch", + "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "PodSchedulingContext", - "version": "v1alpha2" + "version": "v1alpha3" } }, - "put": { - "description": "replace status of the specified PodSchedulingContext", - "operationId": "replaceResourceV1alpha2NamespacedPodSchedulingContextStatus", + "get": { + "description": "list or watch objects of kind PodSchedulingContext", + "operationId": "listResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", - "name": "dryRun", + "name": "allowWatchBookmarks", "schema": { - "type": "string", + "type": "boolean", "uniqueItems": true } }, { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", - "name": "fieldManager", + "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", - "name": "fieldValidation", + "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContext" - } - } - }, - "description": "Created" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters": { - "delete": { - "description": "delete collection of ResourceClaimParameters", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaimParameters", - "parameters": [ - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" - } - }, - "get": { - "description": "list or watch objects of kind ResourceClaimParameters", - "operationId": "listResourceV1alpha2NamespacedResourceClaimParameters", - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", + "schema": { + "type": "string", + "uniqueItems": true } }, { @@ -3982,27 +3502,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } }, "application/json;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" } } }, @@ -4013,13 +3533,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -4044,8 +3564,8 @@ } ], "post": { - "description": "create ResourceClaimParameters", - "operationId": "createResourceV1alpha2NamespacedResourceClaimParameters", + "description": "create a PodSchedulingContext", + "operationId": "createResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -4079,7 +3599,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4090,17 +3610,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4110,17 +3630,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4130,17 +3650,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4151,20 +3671,20 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimparameters/{name}": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/podschedulingcontexts/{name}": { "delete": { - "description": "delete ResourceClaimParameters", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaimParameters", + "description": "delete a PodSchedulingContext", + "operationId": "deleteResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -4217,17 +3737,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4237,17 +3757,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4258,34 +3778,34 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "get": { - "description": "read the specified ResourceClaimParameters", - "operationId": "readResourceV1alpha2NamespacedResourceClaimParameters", + "description": "read the specified PodSchedulingContext", + "operationId": "readResourceV1alpha3NamespacedPodSchedulingContext", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4296,18 +3816,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ { - "description": "name of the ResourceClaimParameters", + "description": "name of the PodSchedulingContext", "in": "path", "name": "name", "required": true, @@ -4337,8 +3857,8 @@ } ], "patch": { - "description": "partially update the specified ResourceClaimParameters", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimParameters", + "description": "partially update the specified PodSchedulingContext", + "operationId": "patchResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -4407,17 +3927,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4427,17 +3947,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4448,18 +3968,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "put": { - "description": "replace the specified ResourceClaimParameters", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimParameters", + "description": "replace the specified PodSchedulingContext", + "operationId": "replaceResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -4493,7 +4013,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4504,17 +4024,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4524,17 +4044,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParameters" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, @@ -4545,30 +4065,90 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims": { - "delete": { - "description": "delete collection of ResourceClaim", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaim", - "parameters": [ - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/podschedulingcontexts/{name}/status": { + "get": { + "description": "read status of the specified PodSchedulingContext", + "operationId": "readResourceV1alpha3NamespacedPodSchedulingContextStatus", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + } + }, + "description": "OK" }, + "401": { + "description": "Unauthorized" + } + }, + "tags": [ + "resource_v1alpha3" + ], + "x-kubernetes-action": "get", + "x-kubernetes-group-version-kind": { + "group": "resource.k8s.io", + "kind": "PodSchedulingContext", + "version": "v1alpha3" + } + }, + "parameters": [ + { + "description": "name of the PodSchedulingContext", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "object name and auth scope, such as for teams and projects", + "in": "path", + "name": "namespace", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", + "in": "query", + "name": "pretty", + "schema": { + "type": "string", + "uniqueItems": true + } + } + ], + "patch": { + "description": "partially update status of the specified PodSchedulingContext", + "operationId": "patchResourceV1alpha3NamespacedPodSchedulingContextStatus", + "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", @@ -4579,92 +4159,141 @@ } }, { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", - "name": "fieldSelector", + "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", - "name": "labelSelector", + "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", - "name": "orphanDependents", + "name": "force", "schema": { "type": "boolean", "uniqueItems": true } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true + } + ], + "requestBody": { + "content": { + "application/apply-patch+yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + "application/merge-patch+json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + "application/strategic-merge-patch+json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } } }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + } + }, + "description": "OK" }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + } + }, + "description": "Created" + }, + "401": { + "description": "Unauthorized" + } + }, + "tags": [ + "resource_v1alpha3" + ], + "x-kubernetes-action": "patch", + "x-kubernetes-group-version-kind": { + "group": "resource.k8s.io", + "kind": "PodSchedulingContext", + "version": "v1alpha3" + } + }, + "put": { + "description": "replace status of the specified PodSchedulingContext", + "operationId": "replaceResourceV1alpha3NamespacedPodSchedulingContextStatus", + "parameters": [ { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", - "name": "resourceVersionMatch", + "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", - "name": "sendInitialEvents", + "name": "fieldManager", "schema": { - "type": "boolean", + "type": "string", "uniqueItems": true } }, { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", - "name": "timeoutSeconds", + "name": "fieldValidation", "schema": { - "type": "integer", + "type": "string", "uniqueItems": true } } @@ -4673,63 +4302,86 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } - } + }, + "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" } } }, "description": "OK" }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContext" + } + } + }, + "description": "Created" + }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "deletecollection", + "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } - }, - "get": { - "description": "list or watch objects of kind ResourceClaim", - "operationId": "listResourceV1alpha2NamespacedResourceClaim", + } + }, + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims": { + "delete": { + "description": "delete collection of ResourceClaim", + "operationId": "deleteResourceV1alpha3CollectionNamespacedResourceClaim", "parameters": [ { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", - "name": "allowWatchBookmarks", + "name": "continue", "schema": { - "type": "boolean", + "type": "string", "uniqueItems": true } }, { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", - "name": "continue", + "name": "dryRun", "schema": { "type": "string", "uniqueItems": true @@ -4745,9 +4397,166 @@ } }, { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", - "name": "labelSelector", + "name": "gracePeriodSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "in": "query", + "name": "orphanDependents", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", + "in": "query", + "name": "propagationPolicy", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersion", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersionMatch", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "in": "query", + "name": "sendInitialEvents", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "in": "query", + "name": "timeoutSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } + } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + } + } + }, + "description": "OK" + }, + "401": { + "description": "Unauthorized" + } + }, + "tags": [ + "resource_v1alpha3" + ], + "x-kubernetes-action": "deletecollection", + "x-kubernetes-group-version-kind": { + "group": "resource.k8s.io", + "kind": "ResourceClaim", + "version": "v1alpha3" + } + }, + "get": { + "description": "list or watch objects of kind ResourceClaim", + "operationId": "listResourceV1alpha3NamespacedResourceClaim", + "parameters": [ + { + "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", + "in": "query", + "name": "allowWatchBookmarks", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "in": "query", + "name": "continue", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "in": "query", + "name": "fieldSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true @@ -4813,27 +4622,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/json;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } } }, @@ -4844,13 +4653,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -4876,7 +4685,7 @@ ], "post": { "description": "create a ResourceClaim", - "operationId": "createResourceV1alpha2NamespacedResourceClaim", + "operationId": "createResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -4910,7 +4719,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -4921,17 +4730,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -4941,17 +4750,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -4961,17 +4770,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -4982,20 +4791,20 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}": { "delete": { "description": "delete a ResourceClaim", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaim", + "operationId": "deleteResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -5048,17 +4857,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5068,17 +4877,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5089,34 +4898,34 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { "description": "read the specified ResourceClaim", - "operationId": "readResourceV1alpha2NamespacedResourceClaim", + "operationId": "readResourceV1alpha3NamespacedResourceClaim", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5127,13 +4936,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -5169,7 +4978,7 @@ ], "patch": { "description": "partially update the specified ResourceClaim", - "operationId": "patchResourceV1alpha2NamespacedResourceClaim", + "operationId": "patchResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -5238,17 +5047,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5258,17 +5067,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5279,18 +5088,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "put": { "description": "replace the specified ResourceClaim", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaim", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -5324,7 +5133,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5335,17 +5144,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5355,17 +5164,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5376,36 +5185,36 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status": { "get": { "description": "read status of the specified ResourceClaim", - "operationId": "readResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "readResourceV1alpha3NamespacedResourceClaimStatus", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5416,13 +5225,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -5458,7 +5267,7 @@ ], "patch": { "description": "partially update status of the specified ResourceClaim", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "patchResourceV1alpha3NamespacedResourceClaimStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -5527,17 +5336,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5547,17 +5356,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5568,18 +5377,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } }, "put": { "description": "replace status of the specified ResourceClaim", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaimStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -5613,7 +5422,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5624,17 +5433,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5644,17 +5453,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaim" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaim" } } }, @@ -5665,20 +5474,20 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaim", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates": { "delete": { "description": "delete collection of ResourceClaimTemplate", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaimTemplate", + "operationId": "deleteResourceV1alpha3CollectionNamespacedResourceClaimTemplate", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", @@ -5824,18 +5633,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { "description": "list or watch objects of kind ResourceClaimTemplate", - "operationId": "listResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "listResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", @@ -5933,27 +5742,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "application/json;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } } }, @@ -5964,13 +5773,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -5996,7 +5805,7 @@ ], "post": { "description": "create a ResourceClaimTemplate", - "operationId": "createResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "createResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -6030,7 +5839,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6041,17 +5850,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6061,17 +5870,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6081,17 +5890,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6102,20 +5911,20 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}": { + "/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name}": { "delete": { "description": "delete a ResourceClaimTemplate", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "deleteResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -6168,17 +5977,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6188,17 +5997,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6209,34 +6018,34 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "get": { "description": "read the specified ResourceClaimTemplate", - "operationId": "readResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "readResourceV1alpha3NamespacedResourceClaimTemplate", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6247,13 +6056,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -6289,7 +6098,7 @@ ], "patch": { "description": "partially update the specified ResourceClaimTemplate", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "patchResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -6358,17 +6167,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6378,17 +6187,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6399,18 +6208,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "put": { "description": "replace the specified ResourceClaimTemplate", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", @@ -6444,7 +6253,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6455,17 +6264,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6475,17 +6284,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplate" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplate" } } }, @@ -6496,2309 +6305,63 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } } }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters": { - "delete": { - "description": "delete collection of ResourceClassParameters", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClassParameters", - "parameters": [ - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "get": { - "description": "list or watch objects of kind ResourceClassParameters", - "operationId": "listResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "post": { - "description": "create ResourceClassParameters", - "operationId": "createResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "Created" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "Accepted" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclassparameters/{name}": { - "delete": { - "description": "delete ResourceClassParameters", - "operationId": "deleteResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "OK" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "Accepted" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "get": { - "description": "read the specified ResourceClassParameters", - "operationId": "readResourceV1alpha2NamespacedResourceClassParameters", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "name of the ResourceClassParameters", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "patch": { - "description": "partially update the specified ResourceClassParameters", - "operationId": "patchResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - "in": "query", - "name": "force", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "application/apply-patch+yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/json-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/strategic-merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "Created" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - }, - "put": { - "description": "replace the specified ResourceClassParameters", - "operationId": "replaceResourceV1alpha2NamespacedResourceClassParameters", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParameters" - } - } - }, - "description": "Created" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/podschedulingcontexts": { - "get": { - "description": "list or watch objects of kind PodSchedulingContext", - "operationId": "listResourceV1alpha2PodSchedulingContextForAllNamespaces", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.PodSchedulingContextList" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/resourceclaimparameters": { - "get": { - "description": "list or watch objects of kind ResourceClaimParameters", - "operationId": "listResourceV1alpha2ResourceClaimParametersForAllNamespaces", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimParametersList" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/resourceclaims": { - "get": { - "description": "list or watch objects of kind ResourceClaim", - "operationId": "listResourceV1alpha2ResourceClaimForAllNamespaces", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimList" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/resourceclaimtemplates": { - "get": { - "description": "list or watch objects of kind ResourceClaimTemplate", - "operationId": "listResourceV1alpha2ResourceClaimTemplateForAllNamespaces", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClaimTemplateList" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClaimTemplate", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/resourceclasses": { - "delete": { - "description": "delete collection of ResourceClass", - "operationId": "deleteResourceV1alpha2CollectionResourceClass", - "parameters": [ - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - }, - "get": { - "description": "list or watch objects of kind ResourceClass", - "operationId": "listResourceV1alpha2ResourceClass", - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassList" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "post": { - "description": "create a ResourceClass", - "operationId": "createResourceV1alpha2ResourceClass", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "Created" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "Accepted" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/resourceclasses/{name}": { - "delete": { - "description": "delete a ResourceClass", - "operationId": "deleteResourceV1alpha2ResourceClass", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "OK" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "Accepted" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - }, - "get": { - "description": "read the specified ResourceClass", - "operationId": "readResourceV1alpha2ResourceClass", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "name of the ResourceClass", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "patch": { - "description": "partially update the specified ResourceClass", - "operationId": "patchResourceV1alpha2ResourceClass", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - "in": "query", - "name": "force", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "application/apply-patch+yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/json-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/strategic-merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "Created" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - }, - "put": { - "description": "replace the specified ResourceClass", - "operationId": "replaceResourceV1alpha2ResourceClass", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClass" - } - } - }, - "description": "Created" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/resourceclassparameters": { - "get": { - "description": "list or watch objects of kind ResourceClassParameters", - "operationId": "listResourceV1alpha2ResourceClassParametersForAllNamespaces", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceClassParametersList" - } - } - }, - "description": "OK" + "/apis/resource.k8s.io/v1alpha3/podschedulingcontexts": { + "get": { + "description": "list or watch objects of kind PodSchedulingContext", + "operationId": "listResourceV1alpha3PodSchedulingContextForAllNamespaces", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" + } + }, + "application/json;stream=watch": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" + } + }, + "application/vnd.kubernetes.protobuf;stream=watch": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.PodSchedulingContextList" + } + } + }, + "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -8903,285 +6466,36 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/resourceslices": { - "delete": { - "description": "delete collection of ResourceSlice", - "operationId": "deleteResourceV1alpha2CollectionResourceSlice", - "parameters": [ - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - } - }, - "description": "OK" - }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, + "/apis/resource.k8s.io/v1alpha3/resourceclaims": { "get": { - "description": "list or watch objects of kind ResourceSlice", - "operationId": "listResourceV1alpha2ResourceSlice", - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ], + "description": "list or watch objects of kind ResourceClaim", + "operationId": "listResourceV1alpha3ResourceClaimForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSliceList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/json;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSliceList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSliceList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSliceList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSliceList" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimList" } } }, @@ -9192,16 +6506,61 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ + { + "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", + "in": "query", + "name": "allowWatchBookmarks", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "in": "query", + "name": "continue", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "in": "query", + "name": "fieldSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -9210,251 +6569,84 @@ "type": "string", "uniqueItems": true } - } - ], - "post": { - "description": "create a ResourceSlice", - "operationId": "createResourceV1alpha2ResourceSlice", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - "in": "query", - "name": "fieldManager", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - "in": "query", - "name": "fieldValidation", - "schema": { - "type": "string", - "uniqueItems": true - } - } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "required": true }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "OK" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "Created" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "Accepted" - }, - "401": { - "description": "Unauthorized" + { + "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersion", + "schema": { + "type": "string", + "uniqueItems": true } }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - } - }, - "/apis/resource.k8s.io/v1alpha2/resourceslices/{name}": { - "delete": { - "description": "delete a ResourceSlice", - "operationId": "deleteResourceV1alpha2ResourceSlice", - "parameters": [ - { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "in": "query", - "name": "dryRun", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "in": "query", - "name": "gracePeriodSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query", - "name": "orphanDependents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - "in": "query", - "name": "propagationPolicy", - "schema": { - "type": "string", - "uniqueItems": true - } + { + "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersionMatch", + "schema": { + "type": "string", + "uniqueItems": true } - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - } + }, + { + "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "in": "query", + "name": "sendInitialEvents", + "schema": { + "type": "boolean", + "uniqueItems": true } }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "OK" - }, - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "Accepted" - }, - "401": { - "description": "Unauthorized" + { + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "in": "query", + "name": "timeoutSeconds", + "schema": { + "type": "integer", + "uniqueItems": true } }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" + { + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "in": "query", + "name": "watch", + "schema": { + "type": "boolean", + "uniqueItems": true + } } - }, + ] + }, + "/apis/resource.k8s.io/v1alpha3/resourceclaimtemplates": { "get": { - "description": "read the specified ResourceSlice", - "operationId": "readResourceV1alpha2ResourceSlice", + "description": "list or watch objects of kind ResourceClaimTemplate", + "operationId": "listResourceV1alpha3ResourceClaimTemplateForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" + } + }, + "application/json;stream=watch": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" + } + }, + "application/vnd.kubernetes.protobuf;stream=watch": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceClaimTemplateList" } } }, @@ -9465,26 +6657,61 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "get", + "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" + "kind": "ResourceClaimTemplate", + "version": "v1alpha3" } }, "parameters": [ { - "description": "name of the ResourceSlice", - "in": "path", - "name": "name", - "required": true, + "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", + "in": "query", + "name": "allowWatchBookmarks", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "in": "query", + "name": "continue", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "in": "query", + "name": "fieldSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, + { + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -9493,12 +6720,68 @@ "type": "string", "uniqueItems": true } + }, + { + "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersion", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersionMatch", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "in": "query", + "name": "sendInitialEvents", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "in": "query", + "name": "timeoutSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "in": "query", + "name": "watch", + "schema": { + "type": "boolean", + "uniqueItems": true + } } - ], - "patch": { - "description": "partially update the specified ResourceSlice", - "operationId": "patchResourceV1alpha2ResourceSlice", + ] + }, + "/apis/resource.k8s.io/v1alpha3/resourceslices": { + "delete": { + "description": "delete collection of ResourceSlice", + "operationId": "deleteResourceV1alpha3CollectionResourceSlice", "parameters": [ + { + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "in": "query", + "name": "continue", + "schema": { + "type": "string", + "uniqueItems": true + } + }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", @@ -9509,141 +6792,92 @@ } }, { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", - "name": "fieldManager", + "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", - "name": "fieldValidation", + "name": "gracePeriodSeconds", "schema": { - "type": "string", + "type": "integer", "uniqueItems": true } }, { - "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", - "name": "force", + "name": "labelSelector", "schema": { - "type": "boolean", + "type": "string", "uniqueItems": true } - } - ], - "requestBody": { - "content": { - "application/apply-patch+yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/json-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - "application/strategic-merge-patch+json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } + }, + { + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "uniqueItems": true } }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "OK" + { + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "in": "query", + "name": "orphanDependents", + "schema": { + "type": "boolean", + "uniqueItems": true + } }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "Created" + { + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", + "in": "query", + "name": "propagationPolicy", + "schema": { + "type": "string", + "uniqueItems": true + } }, - "401": { - "description": "Unauthorized" - } - }, - "tags": [ - "resource_v1alpha2" - ], - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "resource.k8s.io", - "kind": "ResourceSlice", - "version": "v1alpha2" - } - }, - "put": { - "description": "replace the specified ResourceSlice", - "operationId": "replaceResourceV1alpha2ResourceSlice", - "parameters": [ { - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", - "name": "dryRun", + "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", - "name": "fieldManager", + "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { - "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", "in": "query", - "name": "fieldValidation", + "name": "sendInitialEvents", "schema": { - "type": "string", + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "in": "query", + "name": "timeoutSeconds", + "schema": { + "type": "integer", "uniqueItems": true } } @@ -9652,98 +6886,167 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } - }, - "required": true + } }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/vnd.kubernetes.protobuf": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - }, - "application/yaml": { - "schema": { - "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha2.ResourceSlice" - } - } - }, - "description": "Created" - }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "put", + "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceSlice", - "version": "v1alpha2" + "version": "v1alpha3" } - } - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/podschedulingcontexts": { + }, "get": { - "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedPodSchedulingContextList", + "description": "list or watch objects of kind ResourceSlice", + "operationId": "listResourceV1alpha3ResourceSlice", + "parameters": [ + { + "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", + "in": "query", + "name": "allowWatchBookmarks", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "in": "query", + "name": "continue", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "in": "query", + "name": "fieldSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "in": "query", + "name": "labelSelector", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersion", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + "in": "query", + "name": "resourceVersionMatch", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "in": "query", + "name": "sendInitialEvents", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "in": "query", + "name": "timeoutSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "in": "query", + "name": "watch", + "schema": { + "type": "boolean", + "uniqueItems": true + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSliceList" } }, "application/json;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSliceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSliceList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSliceList" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSliceList" } } }, @@ -9754,71 +7057,16 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watchlist", + "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -9827,416 +7075,251 @@ "type": "string", "uniqueItems": true } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true + } + ], + "post": { + "description": "create a ResourceSlice", + "operationId": "createResourceV1alpha3ResourceSlice", + "parameters": [ + { + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "in": "query", + "name": "dryRun", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + "in": "query", + "name": "fieldManager", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "in": "query", + "name": "fieldValidation", + "schema": { + "type": "string", + "uniqueItems": true + } } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + } + }, + "required": true }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/podschedulingcontexts/{name}": { - "get": { - "description": "watch changes to an object of kind PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedPodSchedulingContext", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/json;stream=watch": { + "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + }, + "application/yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + } + }, + "description": "OK" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/vnd.kubernetes.protobuf;stream=watch": { + "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + } + }, + "description": "Created" + }, + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } } }, - "description": "OK" + "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watch", + "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "name of the PodSchedulingContext", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true + } + }, + "/apis/resource.k8s.io/v1alpha3/resourceslices/{name}": { + "delete": { + "description": "delete a ResourceSlice", + "operationId": "deleteResourceV1alpha3ResourceSlice", + "parameters": [ + { + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "in": "query", + "name": "dryRun", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", + "in": "query", + "name": "gracePeriodSeconds", + "schema": { + "type": "integer", + "uniqueItems": true + } + }, + { + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "in": "query", + "name": "orphanDependents", + "schema": { + "type": "boolean", + "uniqueItems": true + } + }, + { + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", + "in": "query", + "name": "propagationPolicy", + "schema": { + "type": "string", + "uniqueItems": true + } } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" + } + } } }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimparameters": { - "get": { - "description": "watch individual changes to a list of ResourceClaimParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimParametersList", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + }, + "application/vnd.kubernetes.protobuf": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/json;stream=watch": { + "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } - }, - "application/vnd.kubernetes.protobuf": { + } + }, + "description": "OK" + }, + "202": { + "content": { + "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/vnd.kubernetes.protobuf;stream=watch": { + "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } } }, - "description": "OK" + "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watchlist", + "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimparameters/{name}": { "get": { - "description": "watch changes to an object of kind ResourceClaimParameters. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimParameters", + "description": "read the specified ResourceSlice", + "operationId": "readResourceV1alpha3ResourceSlice", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "application/json;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "application/vnd.kubernetes.protobuf;stream=watch": { - "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } } }, @@ -10247,63 +7330,18 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watch", + "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, "parameters": [ { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "name of the ResourceClaimParameters", + "description": "name of the ResourceSlice", "in": "path", "name": "name", "required": true, @@ -10312,16 +7350,6 @@ "uniqueItems": true } }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -10330,390 +7358,231 @@ "type": "string", "uniqueItems": true } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true + } + ], + "patch": { + "description": "partially update the specified ResourceSlice", + "operationId": "patchResourceV1alpha3ResourceSlice", + "parameters": [ + { + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "in": "query", + "name": "dryRun", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", + "in": "query", + "name": "fieldManager", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "in": "query", + "name": "fieldValidation", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", + "in": "query", + "name": "force", + "schema": { + "type": "boolean", + "uniqueItems": true + } } + ], + "requestBody": { + "content": { + "application/apply-patch+yaml": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + "application/json-patch+json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + "application/merge-patch+json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + "application/strategic-merge-patch+json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + } + }, + "required": true }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaims": { - "get": { - "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimList", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/json;stream=watch": { + "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/vnd.kubernetes.protobuf": { + "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + } + }, + "description": "OK" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/vnd.kubernetes.protobuf;stream=watch": { + "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } } }, - "description": "OK" + "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watchlist", + "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" + "kind": "ResourceSlice", + "version": "v1alpha3" } }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true + "put": { + "description": "replace the specified ResourceSlice", + "operationId": "replaceResourceV1alpha3ResourceSlice", + "parameters": [ + { + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "in": "query", + "name": "dryRun", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + "in": "query", + "name": "fieldManager", + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + "in": "query", + "name": "fieldValidation", + "schema": { + "type": "string", + "uniqueItems": true + } } + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + } + }, + "required": true }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } - } - ] - }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaims/{name}": { - "get": { - "description": "watch changes to an object of kind ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaim", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/json;stream=watch": { + "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/vnd.kubernetes.protobuf": { + "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" + } + } + }, + "description": "OK" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, - "application/vnd.kubernetes.protobuf;stream=watch": { + "application/vnd.kubernetes.protobuf": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } }, "application/yaml": { "schema": { - "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + "$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.ResourceSlice" } } }, - "description": "OK" + "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watch", + "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" - } - }, - "parameters": [ - { - "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - "in": "query", - "name": "allowWatchBookmarks", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "in": "query", - "name": "continue", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "in": "query", - "name": "fieldSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "in": "query", - "name": "labelSelector", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "in": "query", - "name": "limit", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "name of the ResourceClaim", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", - "in": "query", - "name": "pretty", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersion", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - "in": "query", - "name": "resourceVersionMatch", - "schema": { - "type": "string", - "uniqueItems": true - } - }, - { - "description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - "in": "query", - "name": "sendInitialEvents", - "schema": { - "type": "boolean", - "uniqueItems": true - } - }, - { - "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - "in": "query", - "name": "timeoutSeconds", - "schema": { - "type": "integer", - "uniqueItems": true - } - }, - { - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "in": "query", - "name": "watch", - "schema": { - "type": "boolean", - "uniqueItems": true - } + "kind": "ResourceSlice", + "version": "v1alpha3" } - ] + } }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimtemplates": { + "/apis/resource.k8s.io/v1alpha3/watch/deviceclasses": { "get": { - "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimTemplateList", + "description": "watch individual changes to a list of DeviceClass. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3DeviceClassList", "responses": { "200": { "content": { @@ -10750,13 +7619,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ @@ -10805,16 +7674,6 @@ "uniqueItems": true } }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -10871,10 +7730,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclaimtemplates/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/deviceclasses/{name}": { "get": { - "description": "watch changes to an object of kind ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimTemplate", + "description": "watch changes to an object of kind DeviceClass. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3DeviceClass", "responses": { "200": { "content": { @@ -10911,13 +7770,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "kind": "DeviceClass", + "version": "v1alpha3" } }, "parameters": [ @@ -10967,7 +7826,7 @@ } }, { - "description": "name of the ResourceClaimTemplate", + "description": "name of the DeviceClass", "in": "path", "name": "name", "required": true, @@ -10976,16 +7835,6 @@ "uniqueItems": true } }, - { - "description": "object name and auth scope, such as for teams and projects", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -11042,10 +7891,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclassparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/podschedulingcontexts": { "get": { - "description": "watch individual changes to a list of ResourceClassParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClassParametersList", + "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3NamespacedPodSchedulingContextList", "responses": { "200": { "content": { @@ -11082,13 +7931,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -11203,10 +8052,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/namespaces/{namespace}/resourceclassparameters/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/podschedulingcontexts/{name}": { "get": { - "description": "watch changes to an object of kind ResourceClassParameters. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClassParameters", + "description": "watch changes to an object of kind PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3NamespacedPodSchedulingContext", "responses": { "200": { "content": { @@ -11243,13 +8092,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -11299,7 +8148,7 @@ } }, { - "description": "name of the ResourceClassParameters", + "description": "name of the PodSchedulingContext", "in": "path", "name": "name", "required": true, @@ -11374,10 +8223,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/podschedulingcontexts": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaims": { "get": { - "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2PodSchedulingContextListForAllNamespaces", + "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimList", "responses": { "200": { "content": { @@ -11414,13 +8263,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "PodSchedulingContext", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ @@ -11469,6 +8318,16 @@ "uniqueItems": true } }, + { + "description": "object name and auth scope, such as for teams and projects", + "in": "path", + "name": "namespace", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -11525,10 +8384,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclaimparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaims/{name}": { "get": { - "description": "watch individual changes to a list of ResourceClaimParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimParametersListForAllNamespaces", + "description": "watch changes to an object of kind ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaim", "responses": { "200": { "content": { @@ -11565,13 +8424,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watchlist", + "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaimParameters", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ @@ -11620,6 +8479,26 @@ "uniqueItems": true } }, + { + "description": "name of the ResourceClaim", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "object name and auth scope, such as for teams and projects", + "in": "path", + "name": "namespace", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -11676,10 +8555,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclaims": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaimtemplates": { "get": { - "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimListForAllNamespaces", + "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimTemplateList", "responses": { "200": { "content": { @@ -11716,13 +8595,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClaim", - "version": "v1alpha2" + "kind": "ResourceClaimTemplate", + "version": "v1alpha3" } }, "parameters": [ @@ -11771,6 +8650,16 @@ "uniqueItems": true } }, + { + "description": "object name and auth scope, such as for teams and projects", + "in": "path", + "name": "namespace", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -11827,10 +8716,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclaimtemplates": { + "/apis/resource.k8s.io/v1alpha3/watch/namespaces/{namespace}/resourceclaimtemplates/{name}": { "get": { - "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimTemplateListForAllNamespaces", + "description": "watch changes to an object of kind ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimTemplate", "responses": { "200": { "content": { @@ -11867,13 +8756,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watchlist", + "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceClaimTemplate", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -11922,6 +8811,26 @@ "uniqueItems": true } }, + { + "description": "name of the ResourceClaimTemplate", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, + { + "description": "object name and auth scope, such as for teams and projects", + "in": "path", + "name": "namespace", + "required": true, + "schema": { + "type": "string", + "uniqueItems": true + } + }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -11978,10 +8887,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclasses": { + "/apis/resource.k8s.io/v1alpha3/watch/podschedulingcontexts": { "get": { - "description": "watch individual changes to a list of ResourceClass. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClassList", + "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3PodSchedulingContextListForAllNamespaces", "responses": { "200": { "content": { @@ -12018,13 +8927,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "PodSchedulingContext", + "version": "v1alpha3" } }, "parameters": [ @@ -12129,10 +9038,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclasses/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceclaims": { "get": { - "description": "watch changes to an object of kind ResourceClass. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2ResourceClass", + "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3ResourceClaimListForAllNamespaces", "responses": { "200": { "content": { @@ -12169,13 +9078,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], - "x-kubernetes-action": "watch", + "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClass", - "version": "v1alpha2" + "kind": "ResourceClaim", + "version": "v1alpha3" } }, "parameters": [ @@ -12224,16 +9133,6 @@ "uniqueItems": true } }, - { - "description": "name of the ResourceClass", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string", - "uniqueItems": true - } - }, { "description": "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", "in": "query", @@ -12290,10 +9189,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceclassparameters": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceclaimtemplates": { "get": { - "description": "watch individual changes to a list of ResourceClassParameters. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClassParametersListForAllNamespaces", + "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", + "operationId": "watchResourceV1alpha3ResourceClaimTemplateListForAllNamespaces", "responses": { "200": { "content": { @@ -12330,13 +9229,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", - "kind": "ResourceClassParameters", - "version": "v1alpha2" + "kind": "ResourceClaimTemplate", + "version": "v1alpha3" } }, "parameters": [ @@ -12441,10 +9340,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceslices": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceslices": { "get": { "description": "watch individual changes to a list of ResourceSlice. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceSliceList", + "operationId": "watchResourceV1alpha3ResourceSliceList", "responses": { "200": { "content": { @@ -12481,13 +9380,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceSlice", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ @@ -12592,10 +9491,10 @@ } ] }, - "/apis/resource.k8s.io/v1alpha2/watch/resourceslices/{name}": { + "/apis/resource.k8s.io/v1alpha3/watch/resourceslices/{name}": { "get": { "description": "watch changes to an object of kind ResourceSlice. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2ResourceSlice", + "operationId": "watchResourceV1alpha3ResourceSlice", "responses": { "200": { "content": { @@ -12632,13 +9531,13 @@ } }, "tags": [ - "resource_v1alpha2" + "resource_v1alpha3" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "resource.k8s.io", "kind": "ResourceSlice", - "version": "v1alpha2" + "version": "v1alpha3" } }, "parameters": [ diff --git a/api/openapi-spec/v3/apis__scheduling.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__scheduling.k8s.io__v1_openapi.json index e6c656ef143c8..511c4adc1bc95 100644 --- a/api/openapi-spec/v3/apis__scheduling.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__scheduling.k8s.io__v1_openapi.json @@ -513,7 +513,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -850,7 +850,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1197,7 +1197,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__storage.k8s.io__v1_openapi.json b/api/openapi-spec/v3/apis__storage.k8s.io__v1_openapi.json index d08ac408ec2a1..5d519c93c3a9b 100644 --- a/api/openapi-spec/v3/apis__storage.k8s.io__v1_openapi.json +++ b/api/openapi-spec/v3/apis__storage.k8s.io__v1_openapi.json @@ -2375,7 +2375,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -2769,7 +2769,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -3116,7 +3116,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__storage.k8s.io__v1alpha1_openapi.json b/api/openapi-spec/v3/apis__storage.k8s.io__v1alpha1_openapi.json index ba9a32166e68a..5704af3b2a442 100644 --- a/api/openapi-spec/v3/apis__storage.k8s.io__v1alpha1_openapi.json +++ b/api/openapi-spec/v3/apis__storage.k8s.io__v1alpha1_openapi.json @@ -508,7 +508,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -845,7 +845,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1192,7 +1192,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/api/openapi-spec/v3/apis__storagemigration.k8s.io__v1alpha1_openapi.json b/api/openapi-spec/v3/apis__storagemigration.k8s.io__v1alpha1_openapi.json index 297efef20fd8a..e04a7c7ce7a63 100644 --- a/api/openapi-spec/v3/apis__storagemigration.k8s.io__v1alpha1_openapi.json +++ b/api/openapi-spec/v3/apis__storagemigration.k8s.io__v1alpha1_openapi.json @@ -620,7 +620,7 @@ { "group": "resource.k8s.io", "kind": "DeleteOptions", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", @@ -957,7 +957,7 @@ { "group": "resource.k8s.io", "kind": "Status", - "version": "v1alpha2" + "version": "v1alpha3" } ] }, @@ -1304,7 +1304,7 @@ { "group": "resource.k8s.io", "kind": "WatchEvent", - "version": "v1alpha2" + "version": "v1alpha3" }, { "group": "scheduling.k8s.io", diff --git a/cmd/kube-controller-manager/app/core.go b/cmd/kube-controller-manager/app/core.go index 5f34bff5edbe3..41ea747071557 100644 --- a/cmd/kube-controller-manager/app/core.go +++ b/cmd/kube-controller-manager/app/core.go @@ -467,9 +467,9 @@ func startResourceClaimController(ctx context.Context, controllerContext Control klog.FromContext(ctx), controllerContext.ClientBuilder.ClientOrDie("resource-claim-controller"), controllerContext.InformerFactory.Core().V1().Pods(), - controllerContext.InformerFactory.Resource().V1alpha2().PodSchedulingContexts(), - controllerContext.InformerFactory.Resource().V1alpha2().ResourceClaims(), - controllerContext.InformerFactory.Resource().V1alpha2().ResourceClaimTemplates()) + controllerContext.InformerFactory.Resource().V1alpha3().PodSchedulingContexts(), + controllerContext.InformerFactory.Resource().V1alpha3().ResourceClaims(), + controllerContext.InformerFactory.Resource().V1alpha3().ResourceClaimTemplates()) if err != nil { return nil, true, fmt.Errorf("failed to start resource claim controller: %v", err) } diff --git a/hack/lib/init.sh b/hack/lib/init.sh index 1122395122b6a..8ed24eb091753 100755 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -93,7 +93,7 @@ coordination.k8s.io/v1beta1 \ coordination.k8s.io/v1 \ discovery.k8s.io/v1 \ discovery.k8s.io/v1beta1 \ -resource.k8s.io/v1alpha2 \ +resource.k8s.io/v1alpha3 \ extensions/v1beta1 \ events.k8s.io/v1 \ events.k8s.io/v1beta1 \ diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 8824651086828..7b65a50807ee4 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -37,7 +37,7 @@ API_KNOWN_VIOLATIONS_DIR="${API_KNOWN_VIOLATIONS_DIR:-"${KUBE_ROOT}/api/api-rule OUT_DIR="_output" BOILERPLATE_FILENAME="hack/boilerplate/boilerplate.generatego.txt" APPLYCONFIG_PKG="k8s.io/client-go/applyconfigurations" -PLURAL_EXCEPTIONS="Endpoints:Endpoints,ResourceClaimParameters:ResourceClaimParameters,ResourceClassParameters:ResourceClassParameters" +PLURAL_EXCEPTIONS="Endpoints:Endpoints" # Any time we call sort, we want it in the same locale. export LC_ALL="C" diff --git a/pkg/api/testing/defaulting_test.go b/pkg/api/testing/defaulting_test.go index 07c63b4c0085e..75a5e0b1cfd02 100644 --- a/pkg/api/testing/defaulting_test.go +++ b/pkg/api/testing/defaulting_test.go @@ -135,10 +135,10 @@ func TestDefaulting(t *testing.T) { {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBindingList"}: {}, {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBinding"}: {}, {Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBindingList"}: {}, - {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaim"}: {}, - {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaimList"}: {}, - {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaimTemplate"}: {}, - {Group: "resource.k8s.io", Version: "v1alpha2", Kind: "ResourceClaimTemplateList"}: {}, + {Group: "resource.k8s.io", Version: "v1alpha3", Kind: "ResourceClaim"}: {}, + {Group: "resource.k8s.io", Version: "v1alpha3", Kind: "ResourceClaimList"}: {}, + {Group: "resource.k8s.io", Version: "v1alpha3", Kind: "ResourceClaimTemplate"}: {}, + {Group: "resource.k8s.io", Version: "v1alpha3", Kind: "ResourceClaimTemplateList"}: {}, {Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ValidatingAdmissionPolicy"}: {}, {Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ValidatingAdmissionPolicyList"}: {}, {Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ValidatingAdmissionPolicyBinding"}: {}, @@ -196,24 +196,6 @@ func TestDefaulting(t *testing.T) { {Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Kind: "PriorityLevelConfigurationList"}: {}, } - f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1)) - f.Funcs( - func(s *runtime.RawExtension, c fuzz.Continue) {}, - func(s *metav1.LabelSelector, c fuzz.Continue) { - c.FuzzNoCustom(s) - s.MatchExpressions = nil // need to fuzz this specially - }, - func(s *metav1.ListOptions, c fuzz.Continue) { - c.FuzzNoCustom(s) - s.LabelSelector = "" // need to fuzz requirement strings specially - s.FieldSelector = "" // need to fuzz requirement strings specially - }, - func(s *extensionsv1beta1.ScaleStatus, c fuzz.Continue) { - c.FuzzNoCustom(s) - s.TargetSelector = "" // need to fuzz requirement strings specially - }, - ) - scheme := legacyscheme.Scheme var testTypes orderedGroupVersionKinds for gvk := range scheme.AllKnownTypes() { @@ -225,45 +207,77 @@ func TestDefaulting(t *testing.T) { sort.Sort(testTypes) for _, gvk := range testTypes { - _, expectedChanged := typesWithDefaulting[gvk] - iter := 0 - changedOnce := false - for { - if iter > *roundtrip.FuzzIters { - if !expectedChanged || changedOnce { - break - } - if iter > 300 { - t.Errorf("expected %s to trigger defaulting due to fuzzing", gvk) - break + gvk := gvk + t.Run(gvk.String(), func(t *testing.T) { + // Each sub-tests gets its own fuzzer instance to make running it independent + // from what other tests ran before. + f := fuzz.New().NilChance(.5).NumElements(1, 1).RandSource(rand.NewSource(1)) + f.Funcs( + func(s *runtime.RawExtension, c fuzz.Continue) {}, + func(s *metav1.LabelSelector, c fuzz.Continue) { + c.FuzzNoCustom(s) + s.MatchExpressions = nil // need to fuzz this specially + }, + func(s *metav1.ListOptions, c fuzz.Continue) { + c.FuzzNoCustom(s) + s.LabelSelector = "" // need to fuzz requirement strings specially + s.FieldSelector = "" // need to fuzz requirement strings specially + }, + func(s *extensionsv1beta1.ScaleStatus, c fuzz.Continue) { + c.FuzzNoCustom(s) + s.TargetSelector = "" // need to fuzz requirement strings specially + }, + ) + + _, expectedChanged := typesWithDefaulting[gvk] + iter := 0 + changedOnce := false + for { + if iter > *roundtrip.FuzzIters { + if !expectedChanged || changedOnce { + break + } + // This uses to be 300, but for ResourceClaimList that was not high enough + // because depending on the starting conditions, the fuzzer never created the + // one combination where defaulting kicked in (empty string in non-empty slice + // in another non-empty slice). + if iter > 3000 { + t.Errorf("expected %s to trigger defaulting due to fuzzing", gvk) + break + } + // if we expected defaulting, continue looping until the fuzzer gives us one + // at worst, we will timeout } - // if we expected defaulting, continue looping until the fuzzer gives us one - // at worst, we will timeout - } - iter++ + iter++ - src, err := scheme.New(gvk) - if err != nil { - t.Fatal(err) - } - f.Fuzz(src) + src, err := scheme.New(gvk) + if err != nil { + t.Fatal(err) + } + f.Fuzz(src) - src.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) + src.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) - original := src.DeepCopyObject() + original := src.DeepCopyObject() - // get internal - withDefaults := src.DeepCopyObject() - scheme.Default(withDefaults.(runtime.Object)) + // get internal + withDefaults := src.DeepCopyObject() + scheme.Default(withDefaults) - if !reflect.DeepEqual(original, withDefaults) { - changedOnce = true - if !expectedChanged { - t.Errorf("{Group: \"%s\", Version: \"%s\", Kind: \"%s\"} did not expect defaults to be set - update expected or check defaulter registering: %s", gvk.Group, gvk.Version, gvk.Kind, cmp.Diff(original, withDefaults)) + if !reflect.DeepEqual(original, withDefaults) { + diff := cmp.Diff(original, withDefaults) + if !changedOnce { + t.Logf("got diff (-fuzzed, +with defaults):\n%s", diff) + changedOnce = true + } + if !expectedChanged { + t.Errorf("{Group: \"%s\", Version: \"%s\", Kind: \"%s\"} did not expect defaults to be set - update expected or check defaulter registering: %s", gvk.Group, gvk.Version, gvk.Kind, diff) + } } } - } + }) } + } func BenchmarkPodDefaulting(b *testing.B) { diff --git a/pkg/apis/core/types.go b/pkg/apis/core/types.go index 05ddfe643f7a7..1889997c32aae 100644 --- a/pkg/apis/core/types.go +++ b/pkg/apis/core/types.go @@ -2439,6 +2439,13 @@ type ResourceClaim struct { // the Pod where this field is used. It makes that resource available // inside a container. Name string + + // Request is the name chosen for a request in the referenced claim. + // If empty, everything from the claim is made available, otherwise + // only the result of this request. + // + // +optional + Request string } // Container represents a single container that is expected to be run on the host. diff --git a/pkg/apis/core/v1/zz_generated.conversion.go b/pkg/apis/core/v1/zz_generated.conversion.go index c8aa5b0b9a2a8..bf87334939816 100644 --- a/pkg/apis/core/v1/zz_generated.conversion.go +++ b/pkg/apis/core/v1/zz_generated.conversion.go @@ -7373,6 +7373,7 @@ func Convert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus( func autoConvert_v1_ResourceClaim_To_core_ResourceClaim(in *v1.ResourceClaim, out *core.ResourceClaim, s conversion.Scope) error { out.Name = in.Name + out.Request = in.Request return nil } @@ -7383,6 +7384,7 @@ func Convert_v1_ResourceClaim_To_core_ResourceClaim(in *v1.ResourceClaim, out *c func autoConvert_core_ResourceClaim_To_v1_ResourceClaim(in *core.ResourceClaim, out *v1.ResourceClaim, s conversion.Scope) error { out.Name = in.Name + out.Request = in.Request return nil } diff --git a/pkg/apis/core/validation/validation.go b/pkg/apis/core/validation/validation.go index e0841d0c21bb2..5f7cb09a9da8c 100644 --- a/pkg/apis/core/validation/validation.go +++ b/pkg/apis/core/validation/validation.go @@ -6735,9 +6735,20 @@ func validateResourceClaimNames(claims []core.ResourceClaim, podClaimNames sets. allErrs = append(allErrs, field.Required(fldPath.Index(i), "")) } else { if names.Has(name) { + // All requests of that claim already referenced. allErrs = append(allErrs, field.Duplicate(fldPath.Index(i), name)) } else { - names.Insert(name) + key := name + if claim.Request != "" { + allErrs = append(allErrs, ValidateDNS1123Label(claim.Request, fldPath.Index(i).Child("request"))...) + key += "/" + claim.Request + } + if names.Has(key) { + // The specific request was already referenced. + allErrs = append(allErrs, field.Duplicate(fldPath.Index(i), key)) + } else { + names.Insert(key) + } } if !podClaimNames.Has(name) { // field.NotFound doesn't accept an diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index 65d5a2236e395..5b8041acb192d 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -23720,6 +23720,8 @@ func TestValidateDynamicResourceAllocation(t *testing.T) { shortPodName := &metav1.ObjectMeta{ Name: "some-pod", } + requestName := "req-0" + anotherRequestName := "req-1" goodClaimTemplate := podtest.MakePod("", podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim-template"}}}))), podtest.SetRestartPolicy(core.RestartPolicyAlways), @@ -23752,6 +23754,26 @@ func TestValidateDynamicResourceAllocation(t *testing.T) { ResourceClaimName: &externalClaimName, }), ), + "multiple claim with requests": podtest.MakePod("", + podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim", Request: requestName}, {Name: "another-claim", Request: requestName}}}))), + podtest.SetResourceClaims( + core.PodResourceClaim{ + Name: "my-claim", + ResourceClaimName: &externalClaimName, + }, + core.PodResourceClaim{ + Name: "another-claim", + ResourceClaimName: &externalClaimName, + }), + ), + "single claim with requests": podtest.MakePod("", + podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim", Request: requestName}, {Name: "my-claim", Request: anotherRequestName}}}))), + podtest.SetResourceClaims( + core.PodResourceClaim{ + Name: "my-claim", + ResourceClaimName: &externalClaimName, + }), + ), "init container": podtest.MakePod("", podtest.SetInitContainers(podtest.MakeContainer("ctr-init", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim"}}}))), podtest.SetResourceClaims(core.PodResourceClaim{ @@ -23832,6 +23854,27 @@ func TestValidateDynamicResourceAllocation(t *testing.T) { ResourceClaimName: &externalClaimName, }), ), + "pod claim name duplicates without and with request": podtest.MakePod("", + podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim"}, {Name: "my-claim", Request: "req-0"}}}))), + podtest.SetResourceClaims(core.PodResourceClaim{ + Name: "my-claim", + ResourceClaimName: &externalClaimName, + }), + ), + "pod claim name duplicates with requests": podtest.MakePod("", + podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim", Request: "req-0"}, {Name: "my-claim", Request: "req-0"}}}))), + podtest.SetResourceClaims(core.PodResourceClaim{ + Name: "my-claim", + ResourceClaimName: &externalClaimName, + }), + ), + "bad request name": podtest.MakePod("", + podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim", Request: "*$@%^"}}}))), + podtest.SetResourceClaims(core.PodResourceClaim{ + Name: "my-claim", + ResourceClaimName: &externalClaimName, + }), + ), "no claims defined": podtest.MakePod("", podtest.SetContainers(podtest.MakeContainer("ctr", podtest.SetContainerResources(core.ResourceRequirements{Claims: []core.ResourceClaim{{Name: "my-claim"}}}))), podtest.SetRestartPolicy(core.RestartPolicyAlways), diff --git a/pkg/apis/resource/fuzzer/fuzzer.go b/pkg/apis/resource/fuzzer/fuzzer.go index 5cf5b5e635bc2..36ad429fcd30a 100644 --- a/pkg/apis/resource/fuzzer/fuzzer.go +++ b/pkg/apis/resource/fuzzer/fuzzer.go @@ -18,7 +18,7 @@ package fuzzer import ( fuzz "github.com/google/gofuzz" - + "k8s.io/apimachinery/pkg/runtime" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/kubernetes/pkg/apis/resource" ) @@ -26,15 +26,21 @@ import ( // Funcs contains the fuzzer functions for the resource group. var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { return []interface{}{ - func(obj *resource.ResourceClaimSpec, c fuzz.Continue) { - c.FuzzNoCustom(obj) // fuzz self without calling this function again + func(r *resource.DeviceRequest, c fuzz.Continue) { + c.FuzzNoCustom(r) // fuzz self without calling this function again - // Custom fuzzing for allocation mode: pick one valid mode randomly. - modes := []resource.AllocationMode{ - resource.AllocationModeImmediate, - resource.AllocationModeWaitForFirstConsumer, + // Match defaulter. + if r.CountMode == "" { + r.CountMode = []resource.DeviceCountMode{resource.DeviceCountModeAll, resource.DeviceCountModeExact}[c.Int31n(2)] + } + if r.CountMode == resource.DeviceCountModeExact && r.Count == 0 { + r.Count = 1 } - obj.AllocationMode = modes[c.Rand.Intn(len(modes))] + }, + func(r *resource.OpaqueDeviceConfiguration, c fuzz.Continue) { + c.FuzzNoCustom(r) + // Match the fuzzer default content for runtime.Object. + r.Parameters = runtime.RawExtension{Raw: []byte(`{"apiVersion":"unknown.group/unknown","kind":"Something","someKey":"someValue"}`)} }, } } diff --git a/pkg/apis/resource/install/install.go b/pkg/apis/resource/install/install.go index 578797a1b5f37..eea8fe21e8510 100644 --- a/pkg/apis/resource/install/install.go +++ b/pkg/apis/resource/install/install.go @@ -23,7 +23,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/kubernetes/pkg/apis/resource/v1alpha2" + "k8s.io/kubernetes/pkg/apis/resource/v1alpha3" ) func init() { @@ -33,6 +33,6 @@ func init() { // Install registers the API group and adds types to a scheme func Install(scheme *runtime.Scheme) { utilruntime.Must(resource.AddToScheme(scheme)) - utilruntime.Must(v1alpha2.AddToScheme(scheme)) - utilruntime.Must(scheme.SetVersionPriority(v1alpha2.SchemeGroupVersion)) + utilruntime.Must(v1alpha3.AddToScheme(scheme)) + utilruntime.Must(scheme.SetVersionPriority(v1alpha3.SchemeGroupVersion)) } diff --git a/pkg/apis/resource/install/install_test.go b/pkg/apis/resource/install/install_test.go index ca726e9503848..7a8b9a2875cb5 100644 --- a/pkg/apis/resource/install/install_test.go +++ b/pkg/apis/resource/install/install_test.go @@ -51,7 +51,7 @@ func TestResourceVersioner(t *testing.T) { func TestCodec(t *testing.T) { claim := internal.ResourceClaim{} - data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(schema.GroupVersion{Group: "resource.k8s.io", Version: "v1alpha2"}), &claim) + data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(schema.GroupVersion{Group: "resource.k8s.io", Version: "v1alpha3"}), &claim) if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -59,7 +59,7 @@ func TestCodec(t *testing.T) { if err := json.Unmarshal(data, &other); err != nil { t.Fatalf("unexpected error: %v", err) } - if other.APIVersion != "resource.k8s.io/v1alpha2" || other.Kind != "ResourceClaim" { + if other.APIVersion != "resource.k8s.io/v1alpha3" || other.Kind != "ResourceClaim" { t.Errorf("unexpected unmarshalled object %#v", other) } } diff --git a/pkg/apis/resource/namedresources.go b/pkg/apis/resource/namedresources.go deleted file mode 100644 index 4e96d9b0a419e..0000000000000 --- a/pkg/apis/resource/namedresources.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2024 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. -*/ - -package resource - -import "k8s.io/apimachinery/pkg/api/resource" - -// NamedResourcesResources is used in ResourceModel. -type NamedResourcesResources struct { - // The list of all individual resources instances currently available. - Instances []NamedResourcesInstance -} - -// NamedResourcesInstance represents one individual hardware instance that can be selected based -// on its attributes. -type NamedResourcesInstance struct { - // Name is unique identifier among all resource instances managed by - // the driver on the node. It must be a DNS subdomain. - Name string - - // Attributes defines the attributes of this resource instance. - // The name of each attribute must be unique. - Attributes []NamedResourcesAttribute -} - -// NamedResourcesAttribute is a combination of an attribute name and its value. -type NamedResourcesAttribute struct { - // Name is unique identifier among all resource instances managed by - // the driver on the node. It must be a DNS subdomain. - Name string - - NamedResourcesAttributeValue -} - -// NamedResourcesAttributeValue must have one and only one field set. -type NamedResourcesAttributeValue struct { - // QuantityValue is a quantity. - QuantityValue *resource.Quantity - // BoolValue is a true/false value. - BoolValue *bool - // IntValue is a 64-bit integer. - IntValue *int64 - // IntSliceValue is an array of 64-bit integers. - IntSliceValue *NamedResourcesIntSlice - // StringValue is a string. - StringValue *string - // StringSliceValue is an array of strings. - StringSliceValue *NamedResourcesStringSlice - // VersionValue is a semantic version according to semver.org spec 2.0.0. - VersionValue *string -} - -// NamedResourcesIntSlice contains a slice of 64-bit integers. -type NamedResourcesIntSlice struct { - // Ints is the slice of 64-bit integers. - Ints []int64 -} - -// NamedResourcesStringSlice contains a slice of strings. -type NamedResourcesStringSlice struct { - // Strings is the slice of strings. - Strings []string -} - -// NamedResourcesRequest is used in ResourceRequestModel. -type NamedResourcesRequest struct { - // Selector is a CEL expression which must evaluate to true if a - // resource instance is suitable. The language is as defined in - // https://kubernetes.io/docs/reference/using-api/cel/ - // - // In addition, for each type NamedResourcesin AttributeValue there is a map that - // resolves to the corresponding value of the instance under evaluation. - // For example: - // - // attributes.quantity["a"].isGreaterThan(quantity("0")) && - // attributes.stringslice["b"].isSorted() - Selector string -} - -// NamedResourcesFilter is used in ResourceFilterModel. -type NamedResourcesFilter struct { - // Selector is a CEL expression which must evaluate to true if a - // resource instance is suitable. The language is as defined in - // https://kubernetes.io/docs/reference/using-api/cel/ - // - // In addition, for each type in NamedResourcesAttributeValue there is a map that - // resolves to the corresponding value of the instance under evaluation. - // For example: - // - // attributes.quantity["a"].isGreaterThan(quantity("0")) && - // attributes.stringslice["b"].isSorted() - Selector string -} - -// NamedResourcesAllocationResult is used in AllocationResultModel. -type NamedResourcesAllocationResult struct { - // Name is the name of the selected resource instance. - Name string -} diff --git a/pkg/apis/resource/register.go b/pkg/apis/resource/register.go index 1d7b718abeff1..37136ac1f9eec 100644 --- a/pkg/apis/resource/register.go +++ b/pkg/apis/resource/register.go @@ -52,8 +52,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { return err } scheme.AddKnownTypes(SchemeGroupVersion, - &ResourceClass{}, - &ResourceClassList{}, + &DeviceClass{}, + &DeviceClassList{}, &ResourceClaim{}, &ResourceClaimList{}, &ResourceClaimTemplate{}, @@ -62,10 +62,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &PodSchedulingContextList{}, &ResourceSlice{}, &ResourceSliceList{}, - &ResourceClaimParameters{}, - &ResourceClaimParametersList{}, - &ResourceClassParameters{}, - &ResourceClassParametersList{}, ) return nil diff --git a/pkg/apis/resource/structured/namedresources/validation/validation.go b/pkg/apis/resource/structured/namedresources/validation/validation.go deleted file mode 100644 index 755507c8e86c1..0000000000000 --- a/pkg/apis/resource/structured/namedresources/validation/validation.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package validation - -import ( - "fmt" - "regexp" - - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/cel" - "k8s.io/apiserver/pkg/cel/environment" - namedresourcescel "k8s.io/dynamic-resource-allocation/structured/namedresources/cel" - corevalidation "k8s.io/kubernetes/pkg/apis/core/validation" - "k8s.io/kubernetes/pkg/apis/resource" -) - -var ( - validateInstanceName = corevalidation.ValidateDNS1123Subdomain - validateAttributeName = corevalidation.ValidateDNS1123Subdomain -) - -type Options struct { - // StoredExpressions must be true if and only if validating CEL - // expressions that were already stored persistently. This makes - // validation more permissive by enabling CEL definitions that are not - // valid yet for new expressions. - StoredExpressions bool -} - -func ValidateResources(resources *resource.NamedResourcesResources, fldPath *field.Path) field.ErrorList { - allErrs := validateInstances(resources.Instances, fldPath.Child("instances")) - return allErrs -} - -func validateInstances(instances []resource.NamedResourcesInstance, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - instanceNames := sets.New[string]() - for i, instance := range instances { - idxPath := fldPath.Index(i) - instanceName := instance.Name - allErrs = append(allErrs, validateInstanceName(instanceName, idxPath.Child("name"))...) - if instanceNames.Has(instanceName) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("name"), instanceName)) - } else { - instanceNames.Insert(instanceName) - } - allErrs = append(allErrs, validateAttributes(instance.Attributes, idxPath.Child("attributes"))...) - } - return allErrs -} - -var ( - numericIdentifier = `(0|[1-9]\d*)` - - preReleaseIdentifier = `(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)` - - buildIdentifier = `[0-9a-zA-Z-]+` - - semverRe = regexp.MustCompile(`^` + - - // dot-separated version segments (e.g. 1.2.3) - numericIdentifier + `\.` + numericIdentifier + `\.` + numericIdentifier + - - // optional dot-separated prerelease segments (e.g. -alpha.PRERELEASE.1) - `(-` + preReleaseIdentifier + `(\.` + preReleaseIdentifier + `)*)?` + - - // optional dot-separated build identifier segments (e.g. +build.id.20240305) - `(\+` + buildIdentifier + `(\.` + buildIdentifier + `)*)?` + - - `$`) -) - -func validateAttributes(attributes []resource.NamedResourcesAttribute, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - attributeNames := sets.New[string]() - for i, attribute := range attributes { - idxPath := fldPath.Index(i) - attributeName := attribute.Name - allErrs = append(allErrs, validateAttributeName(attributeName, idxPath.Child("name"))...) - if attributeNames.Has(attributeName) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("name"), attributeName)) - } else { - attributeNames.Insert(attributeName) - } - - entries := sets.New[string]() - if attribute.QuantityValue != nil { - entries.Insert("quantity") - } - if attribute.BoolValue != nil { - entries.Insert("bool") - } - if attribute.IntValue != nil { - entries.Insert("int") - } - if attribute.IntSliceValue != nil { - entries.Insert("intSlice") - } - if attribute.StringValue != nil { - entries.Insert("string") - } - if attribute.StringSliceValue != nil { - entries.Insert("stringSlice") - } - if attribute.VersionValue != nil { - entries.Insert("version") - if !semverRe.MatchString(*attribute.VersionValue) { - allErrs = append(allErrs, field.Invalid(idxPath.Child("version"), *attribute.VersionValue, "must be a string compatible with semver.org spec 2.0.0")) - } - } - - switch len(entries) { - case 0: - allErrs = append(allErrs, field.Required(idxPath, "exactly one value must be set")) - case 1: - // Okay. - default: - allErrs = append(allErrs, field.Invalid(idxPath, sets.List(entries), "exactly one field must be set, not several")) - } - } - return allErrs -} - -func ValidateRequest(opts Options, request *resource.NamedResourcesRequest, fldPath *field.Path) field.ErrorList { - return validateSelector(opts, request.Selector, fldPath.Child("selector")) -} - -func ValidateFilter(opts Options, filter *resource.NamedResourcesFilter, fldPath *field.Path) field.ErrorList { - return validateSelector(opts, filter.Selector, fldPath.Child("selector")) -} - -func validateSelector(opts Options, selector string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if selector == "" { - allErrs = append(allErrs, field.Required(fldPath, "")) - } else { - envType := environment.NewExpressions - if opts.StoredExpressions { - envType = environment.StoredExpressions - } - result := namedresourcescel.Compiler.CompileCELExpression(selector, envType) - if result.Error != nil { - allErrs = append(allErrs, convertCELErrorToValidationError(fldPath, selector, result.Error)) - } - } - return allErrs -} - -func convertCELErrorToValidationError(fldPath *field.Path, expression string, err *cel.Error) *field.Error { - switch err.Type { - case cel.ErrorTypeRequired: - return field.Required(fldPath, err.Detail) - case cel.ErrorTypeInvalid: - return field.Invalid(fldPath, expression, err.Detail) - case cel.ErrorTypeInternal: - return field.InternalError(fldPath, err) - } - return field.InternalError(fldPath, fmt.Errorf("unsupported error type: %w", err)) -} - -func ValidateAllocationResult(result *resource.NamedResourcesAllocationResult, fldPath *field.Path) field.ErrorList { - return validateInstanceName(result.Name, fldPath.Child("name")) -} diff --git a/pkg/apis/resource/structured/namedresources/validation/validation_test.go b/pkg/apis/resource/structured/namedresources/validation/validation_test.go deleted file mode 100644 index 7fedfcae55673..0000000000000 --- a/pkg/apis/resource/structured/namedresources/validation/validation_test.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package validation - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/validation/field" - resourceapi "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/utils/ptr" -) - -func testResources(instances []resourceapi.NamedResourcesInstance) *resourceapi.NamedResourcesResources { - resources := &resourceapi.NamedResourcesResources{ - Instances: instances, - } - return resources -} - -func TestValidateResources(t *testing.T) { - goodName := "foo" - badName := "!@#$%^" - quantity := resource.MustParse("1") - - scenarios := map[string]struct { - resources *resourceapi.NamedResourcesResources - wantFailures field.ErrorList - }{ - "empty": { - resources: testResources(nil), - }, - "good": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName}}), - }, - "bad-name": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: badName}}), - }, - "duplicate-name": { - wantFailures: field.ErrorList{field.Duplicate(field.NewPath("instances").Index(1).Child("name"), goodName)}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName}, {Name: goodName}}), - }, - "quantity": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{QuantityValue: &quantity}}}}}), - }, - "bool": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true)}}}}}), - }, - "int": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntValue: ptr.To(int64(1))}}}}}), - }, - "int-slice": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntSliceValue: &resourceapi.NamedResourcesIntSlice{Ints: []int64{1, 2, 3}}}}}}}), - }, - "string": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringValue: ptr.To("hello")}}}}}), - }, - "string-slice": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringSliceValue: &resourceapi.NamedResourcesStringSlice{Strings: []string{"hello"}}}}}}}), - }, - "version-okay": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.0")}}}}}), - }, - "version-beta": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.0-beta")}}}}}), - }, - "version-beta-1": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.0-beta.1")}}}}}), - }, - "version-build": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.0+build")}}}}}), - }, - "version-build-1": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.0+build.1")}}}}}), - }, - "version-beta-1-build-1": { - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.0-beta.1+build.1")}}}}}), - }, - "version-bad": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("attributes").Index(0).Child("version"), "1.0", "must be a string compatible with semver.org spec 2.0.0")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0")}}}}}), - }, - "version-bad-leading-zeros": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("attributes").Index(0).Child("version"), "01.0.0", "must be a string compatible with semver.org spec 2.0.0")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("01.0.0")}}}}}), - }, - "version-bad-leading-zeros-middle": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("attributes").Index(0).Child("version"), "1.00.0", "must be a string compatible with semver.org spec 2.0.0")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.00.0")}}}}}), - }, - "version-bad-leading-zeros-end": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("attributes").Index(0).Child("version"), "1.0.00", "must be a string compatible with semver.org spec 2.0.0")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To("1.0.00")}}}}}), - }, - "version-bad-spaces": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("attributes").Index(0).Child("version"), " 1.0.0 ", "must be a string compatible with semver.org spec 2.0.0")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{VersionValue: ptr.To(" 1.0.0 ")}}}}}), - }, - "empty-attribute": { - wantFailures: field.ErrorList{field.Required(field.NewPath("instances").Index(0).Child("attributes").Index(0), "exactly one value must be set")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName}}}}), - }, - "duplicate-value": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("instances").Index(0).Child("attributes").Index(0), []string{"bool", "int"}, "exactly one field must be set, not several")}, - resources: testResources([]resourceapi.NamedResourcesInstance{{Name: goodName, Attributes: []resourceapi.NamedResourcesAttribute{{Name: goodName, NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true), IntValue: ptr.To(int64(1))}}}}}), - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - errs := ValidateResources(scenario.resources, nil) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} - -func TestValidateSelector(t *testing.T) { - scenarios := map[string]struct { - selector string - wantFailures field.ErrorList - }{ - "okay": { - selector: "true", - }, - "empty": { - selector: "", - wantFailures: field.ErrorList{field.Required(nil, "")}, - }, - "undefined": { - selector: "nosuchvar", - wantFailures: field.ErrorList{field.Invalid(nil, "nosuchvar", "compilation failed: ERROR: :1:1: undeclared reference to 'nosuchvar' (in container '')\n | nosuchvar\n | ^")}, - }, - "wrong-type": { - selector: "1", - wantFailures: field.ErrorList{field.Invalid(nil, "1", "must evaluate to bool")}, - }, - "quantity": { - selector: `attributes.quantity["name"].isGreaterThan(quantity("0"))`, - }, - "bool": { - selector: `attributes.bool["name"]`, - }, - "int": { - selector: `attributes.int["name"] > 0`, - }, - "intslice": { - selector: `attributes.intslice["name"].isSorted()`, - }, - "string": { - selector: `attributes.string["name"] == "fish"`, - }, - "stringslice": { - selector: `attributes.stringslice["name"].isSorted()`, - }, - "version": { - selector: `attributes.version["name"].isGreaterThan(semver("1.0.0"))`, - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - // At the moment, there's no difference between stored and new expressions. - // This uses the stricter validation. - opts := Options{ - StoredExpressions: false, - } - errs := validateSelector(opts, scenario.selector, nil) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} diff --git a/pkg/apis/resource/types.go b/pkg/apis/resource/types.go index fa3fba7f39ef4..9e3d5a8511c19 100644 --- a/pkg/apis/resource/types.go +++ b/pkg/apis/resource/types.go @@ -17,17 +17,284 @@ limitations under the License. package resource import ( + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/validation" "k8s.io/kubernetes/pkg/apis/core" ) +const ( + // Finalizer is the finalizer that gets set for claims + // which were allocated through a builtin controller. + // Reserved for use by Kubernetes, DRA driver controllers must + // use their own finalizer. + Finalizer = "resource.kubernetes.io/delete-protection" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ResourceSlice represents one or more resources in a pool of similar resources, +// managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many +// ResourceSlices comprise a pool is determined by the driver. +// +// At the moment, the only supported resources are devices with attributes and capacities. +// Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. +// The ResourceSlice in which a device gets published may change over time. The unique identifier +// for a device is the tuple , , . +// +// Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number +// and updates all ResourceSlices with that new number and new resource definitions. A consumer +// must only use ResourceSlices with the highest generation number and ignore all others. +// +// When allocating all resources in a pool matching certain criteria or when +// looking for the best solution among several different alternatives, a +// consumer should check the number of ResourceSlices in a pool (included in +// each ResourceSlice) to determine whether its view of a pool is complete and +// if not, should wait until the driver has completed updating the pool. +// +// For resources that are not local to a node, the node name is not set. Instead, +// the driver may use a node selector to specify where the devices are available. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +type ResourceSlice struct { + metav1.TypeMeta + // Standard object metadata + // +optional + metav1.ObjectMeta + + // Contains the information published by the driver. + // + // Changing the spec automatically increments the metadata.generation number. + Spec ResourceSliceSpec +} + +const ( + // ResourceSliceSelectorNodeName can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.NodeName]. + ResourceSliceSelectorNodeName = "spec.nodeName" + // ResourceSliceSelectorDriver can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.Driver]. + ResourceSliceSelectorDriver = "spec.driver" +) + +// ResourceSliceSpec contains the information published by the driver in one ResourceSlice. +type ResourceSliceSpec struct { + // 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. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. This field is immutable. + // + // +required + Driver string + + // Pool describes the pool that this ResourceSlice belongs to. + // This field is immutable. + // + // +required + Pool ResourcePool + + // 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. + // + // This 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. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // This field is immutable. + // + // +optional + // +oneOf=NodeSelection + NodeName string + + // NodeSelector defines which nodes have access to the resources in the pool. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // + // +optional + // +oneOf=NodeSelection + NodeSelector *core.NodeSelector + + // AllNodes indicates that all nodes have access to the resources in the pool. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // + // +optional + // +oneOf=NodeSelection + AllNodes bool + + // Devices lists some or all of the devices in this pool. + // + // Must not have more than 128 entries. + // + // +optional + // +listType=atomic + Devices []Device +} + +// ResourcePool describes the pool that ResourceSlices belong to. +type ResourcePool struct { + // Name is used to identify the pool. For node-local devices, this + // is often the node name, but this is not required. + // + // It must not be longer than 253 characters and must consist of one or more DNS sub-domains + // separated by slashes. + // + // +required + Name string + + // Generation tracks the change in a pool over time. Whenever a driver + // changes something about one or more of the resources in a pool, it + // must change the generation in all ResourceSlices which are part of + // that pool. Consumers of ResourceSlices should only consider + // resources from the pool with the highest generation number. The + // generation may be reset by drivers, which should be fine for + // consumers, assuming that all ResourceSlices in a pool are updated to + // match or deleted. + // + // Combined with ResourceSliceCount, this mechanism enables consumers to + // detect pools which are comprised of multiple ResourceSlices and are + // in an incomplete state. + // + // +required + Generation int64 + + // ResourceSliceCount is the total number of ResourceSlices in the pool at this + // generation number. Must be higher than zero. + // + // Consumers can use this to check whether they have seen all ResourceSlices + // belonging to the same pool. + // + // +required + ResourceSliceCount int64 +} + +const ResourceSliceMaxSharedCapacity = 128 +const ResourceSliceMaxDevices = 128 +const PoolNameMaxLength = validation.DNS1123SubdomainMaxLength // Same as for a single node name. + +// Device represents one individual hardware instance that can be selected based +// on its attributes. Besides the name, exactly one field must be set. +type Device struct { + // Name is unique identifier among all devices managed by + // the driver in the pool. It must be a DNS label. + // + // +required + Name string + + // Basic defines one device instance using fields that are supported + // by all clients which support DRA. + // + // +optional + // +oneOf=deviceType + Basic *BasicDevice +} + +// BasicDevice defines one device instance using fields that are supported +// by all clients which support DRA. +type BasicDevice struct { + // Attributes defines the set of attributes for this device. + // The name of each attribute must be unique in that set. + // + // The maximum number of attributes and capacities combined is 32. + // + // +optional + Attributes map[QualifiedName]DeviceAttribute + + // Capacity defines the set of capacities for this device. + // The name of each capacity must be unique in that set. + // + // The maximum number of attributes and capacities combined is 32. + // + // +optional + Capacity map[QualifiedName]resource.Quantity +} + +// Limit for the sum of the number of entries in both ResourceSlices. +const ResourceSliceMaxAttributesAndCapacitiesPerDevice = 32 + +// QualifiedName is the name of a device attribute or capacity. +// +// Attributes and capacities are defined either by the owner of the specific +// driver (usually the vendor) or by some 3rd party (e.g. the Kubernetes +// project). Because they are sometimes compared across devices, a given name +// is expected to mean the same thing and have the same type on all devices. +// +// Names must be either a C identifier (e.g. "theName") or a DNS subdomain +// followed by a slash ("/") followed by a C identifier +// (e.g. "dra.example.com/theName"). Names which do not include the +// domain prefix are assumed to be part of the driver's domain. Attributes +// or capacities defined by 3rd parties must include the domain prefix. +// +// The maximum length for the DNS subdomain is 63 characters (same as +// for driver names) and the maximum length of the C identifier +// is 32. +type QualifiedName string + +// FullyQualifiedName is a QualifiedName where the domain is set. +type FullyQualifiedName string + +// DeviceMaxIDLength is the maximum length of the identifier in a device attribute or capacity name (`/`). +const DeviceMaxIDLength = 32 + +// DeviceAttribute must have exactly one field set. +type DeviceAttribute struct { + // The Go field names below have a Value suffix to avoid a conflict between the + // field "String" and the corresponding method. That method is required. + // The Kubernetes API is defined without that suffix to keep it more natural. + + // IntValue is a number. + // + // +optional + IntValue *int64 + + // BoolValue is a true/false value. + // + // +optional + BoolValue *bool + + // StringValue is a string. Must not be longer than 64 characters. + // + // +optional + StringValue *string + + // VersionValue is a semantic version according to semver.org spec 2.0.0. + // Must not be longer than 64 characters. + // + // +optional + VersionValue *string +} + +// DeviceAttributeMaxValueLength is the maximum length of a string or version attribute value. +const DeviceAttributeMaxValueLength = 64 + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ResourceSliceList is a collection of ResourceSlices. +type ResourceSliceList struct { + metav1.TypeMeta + // Standard list metadata + // +optional + metav1.ListMeta + + // Items is the list of resource ResourceSlices. + Items []ResourceSlice +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ResourceClaim describes which resources are needed by a resource consumer. -// Its status tracks whether the resource has been allocated and what the -// resulting attributes are. +// ResourceClaim describes a request for access to resources in the cluster, +// for use by workloads. For example, if a workload needs an accelerator device +// with specific properties, this is how that request is expressed. The status +// stanza tracks whether this claim has been satisfied and what specific +// resources have been allocated. // // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. @@ -37,90 +304,339 @@ type ResourceClaim struct { // +optional metav1.ObjectMeta - // Spec describes the desired attributes of a resource that then needs - // to be allocated. It can only be set once when creating the - // ResourceClaim. + // Spec describes what is being requested and how to configure it. + // The spec is immutable. Spec ResourceClaimSpec - // Status describes whether the resource is available and with which - // attributes. + // Status describes whether the claim is ready to use and what has been allocated. // +optional Status ResourceClaimStatus } -// ResourceClaimSpec defines how a resource is to be allocated. +// ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it. type ResourceClaimSpec struct { - // ResourceClassName references the driver and additional parameters - // via the name of a ResourceClass that was created as part of the - // driver deployment. - ResourceClassName string + // Devices defines how to request devices. + // + // +optional + Devices DeviceClaim - // ParametersRef references a separate object with arbitrary parameters - // that will be used by the driver when allocating a resource for the - // claim. + // Controller is the name of the DRA driver that is meant + // to handle allocation of this claim. If empty, allocation is handled + // by the scheduler while scheduling a pod. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. // - // The object must be in the same namespace as the ResourceClaim. // +optional - ParametersRef *ResourceClaimParametersReference + Controller string +} - // Allocation can start immediately or when a Pod wants to use the - // resource. "WaitForFirstConsumer" is the default. +// DeviceClaim defines how to request devices with a ResourceClaim. +type DeviceClaim struct { + // Requests represent individual requests for distinct devices which + // must all be satisfied. If empty, nothing needs to be allocated. + // // +optional - AllocationMode AllocationMode + // +listType=atomic + Requests []DeviceRequest + + // These constraints must be satisfied by the set of devices that get + // allocated for the claim. + // + // +optional + // +listType=atomic + Constraints []DeviceConstraint + + // This field holds configuration for multiple potential drivers which + // could satisfy requests in this claim. It is ignored while allocating + // the claim. + // + // +optional + // +listType=atomic + Config []DeviceClaimConfiguration } -// AllocationMode describes whether a ResourceClaim gets allocated immediately -// when it gets created (AllocationModeImmediate) or whether allocation is -// delayed until it is needed for a Pod -// (AllocationModeWaitForFirstConsumer). Other modes might get added in the -// future. -type AllocationMode string +const ( + DeviceRequestsMaxSize = AllocationResultsMaxSize + DeviceConstraintsMaxSize = 32 + DeviceConfigMaxSize = 32 +) + +// 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. +// +// A DeviceClassName is currently required. Clients must check that it is +// indeed set. It's absence indicates that something changed in a way that +// is not supported by the client yet, in which case it must refuse to +// handle the request. +type DeviceRequest struct { + // Name can be used to reference this request in a pod.spec.containers[].resources.claims + // entry and in a constraint of the claim. + // + // Must be a DNS label. + // + // +required + Name string + + // DeviceClassName references a specific DeviceClass, which can define + // additional configuration and selectors to be inherited by this + // request. + // + // A class is required. Which classes are available depends on the cluster. + // + // Administrators may use this to restrict which devices may get + // requested by only installing classes with selectors for permitted + // devices. If users are free to request anything without restrictions, + // then administrators can create an empty DeviceClass for users + // to reference. + // + // +required + DeviceClassName string + + // Selectors define criteria which must be satisfied by a specific + // device in order for that device to be considered for this + // request. All selectors must be satisfied for a device to be + // considered. + // + // +optional + // +listType=atomic + Selectors []DeviceSelector + + // CountMode and its related fields define how many devices are needed + // to satisfy this request. Supported values are: + // + // - Exact: This request is for a specific number of devices. + // This is the default. The exact number is provided in the + // count field. + // + // - All: This request is for all of the matching devices in a pool. + // Allocation will fail if some devices are already allocated, + // unless adminAccess is requested. + // + // If countMode is not specified, the default countMode is Exact. If + // countMode is Exact and count is not specified, the default count is + // one. Any other requests must specify this field. + // + // More modes may get added in the future. Clients must refuse to handle + // requests with unknown modes. + // + // +optional + CountMode DeviceCountMode + + // Count is used only when the count mode is "Exact". Must be greater than zero. + // If CountMode is Exact and this field is not specified, the default is one. + // + // +optional + Count int64 + + // AdminAccess indicates that this is a claim for administrative access + // to the device(s). Claims with AdminAccess are expected to be used for + // monitoring or other management services for a device. They ignore + // all ordinary claims to the device with respect to access modes and + // any resource allocations. + // + // +optional + // +default=false + AdminAccess bool +} const ( - // When a ResourceClaim has AllocationModeWaitForFirstConsumer, allocation is - // delayed until a Pod gets scheduled that needs the ResourceClaim. The - // scheduler will consider all resource requirements of that Pod and - // trigger allocation for a node that fits the Pod. - AllocationModeWaitForFirstConsumer AllocationMode = "WaitForFirstConsumer" - - // When a ResourceClaim has AllocationModeImmediate, allocation starts - // as soon as the ResourceClaim gets created. This is done without - // considering the needs of Pods that will use the ResourceClaim - // because those Pods are not known yet. - AllocationModeImmediate AllocationMode = "Immediate" + DeviceSelectorsMaxSize = 32 ) -// ResourceClaimStatus tracks whether the resource has been allocated and what -// the resulting attributes are. -type ResourceClaimStatus struct { - // DriverName is a copy of the driver name from the ResourceClass at - // the time when allocation started. +type DeviceCountMode string + +// Valid [DeviceRequest.CountMode] values. +const ( + DeviceCountModeExact = DeviceCountMode("Exact") + DeviceCountModeAll = DeviceCountMode("All") +) + +// DeviceSelector must have exactly one field set. +type DeviceSelector struct { + // CEL contains a CEL expression for selecting a device. + // + // +required + CEL *CELDeviceSelector +} + +// CELDeviceSelector contains a CEL expression for selecting a device. +type CELDeviceSelector struct { + // Expression is a CEL expression which evaluates a single device. It + // must evaluate to true when the device under consideration satisfies + // the desired criteria, and false when it does not. Any other result + // is an error and causes allocation of devices to abort. + // + // The expression's input is an object named "device", which carries + // the following properties: + // - driver (string): the name of the driver which defines this device. + // - attributes (map[string]object): the device's attributes, grouped by prefix + // (e.g. device.attributes["dra.example.com"] evaluates to an object with all + // of the attributes which were prefixed by "dra.example.com". + // - capacity (map[string]object): the device's capacities, grouped by prefix. + // + // Example: Consider a device with driver="dra.example.com", which exposes + // two attributes named "model" and "ext.example.com/family" and which + // exposes one capacity named "modules". This input to this expression + // would have the following fields: + // + // device.driver + // device.attributes["dra.example.com"].model + // device.attributes["ext.example.com"].family + // device.capacity["dra.example.com"].modules + // + // The device.driver field can be used to check for a specific driver, + // either as a high-level precondition (i.e. you only want to consider + // devices from this driver) or as part of a multi-clause expression + // that is meant to consider devices from different drivers. + // + // The value type of each attribute is defined by the device + // definition, and users who write these expressions must consult the + // documentation for their specific drivers. The value type of each + // capacity is Quantity. + // + // If an unknown prefix is used as a lookup in either device.attributes + // or device.capacity, an empty map will be returned. Any reference to + // an unknown field will cause an evaluation error and allocation to + // abort. + // + // A robust expression should check for the existence of attributes + // before referencing them. + // + // For ease of use, the cel.bind() function is enabled, and can be used + // to simplify expressions that access multiple attributes with the + // same domain. For example: + // + // cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool) + // + // +required + Expression string +} + +// DeviceConstraint must have exactly one field set besides Requests. +type DeviceConstraint struct { + // Requests is a list of the one or more requests in this claim which + // must co-satisfy this constraint. If a request is fulfilled by + // multiple devices, then all of the devices must satisfy the + // constraint. If this is not specified, this constraint applies to all + // requests in this claim. + // + // +optional + // +listType=atomic + Requests []string + + // MatchAttribute requires that all devices in question have this + // attribute and that its type and value are the same across those + // devices. + // + // For example, if you specified "dra.example.com/numa" (a hypothetical example!), + // then only devices in the same NUMA node will be chosen. A device which + // does not have that attribute will not be chosen. All devices should + // use a value of the same type for this attribute because that is part of + // its specification, but if one device doesn't, then it also will not be + // chosen. + // + // Must include the domain qualifier. + // + // +optional + MatchAttribute *FullyQualifiedName +} + +// DeviceClaimConfiguration is used for configuration parameters in DeviceClaim. +type DeviceClaimConfiguration struct { + // Requests lists the names of requests where the configuration applies. + // If empty, it applies to all requests. + // // +optional - DriverName string + // +listType=atomic + Requests []string + + DeviceConfiguration // inline +} + +// DeviceConfiguration must have exactly one field set. It gets embedded +// inline in some other structs which have other fields, so field names must +// not conflict with those. +type DeviceConfiguration struct { + // Opaque provides driver-specific configuration parameters. + // + // +optional + Opaque *OpaqueDeviceConfiguration +} + +// OpaqueDeviceConfiguration contains configuration parameters for a driver +// in a format defined by the driver vendor. +type OpaqueDeviceConfiguration struct { + // Driver is used to determine which kubelet plugin needs + // to be passed these configuration parameters. + // + // An admission policy provided by the driver developer could use this + // to decide whether it needs to validate them. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // +required + Driver string + + // Parameters can contain arbitrary data. It is the responsibility of + // the driver developer to handle validation and versioning. Typically this + // includes self-identification and a version ("kind" + "apiVersion" for + // Kubernetes types), with conversion between different versions. + // + // +required + Parameters runtime.RawExtension +} - // Allocation is set by the resource driver once a resource or set of - // resources has been allocated successfully. If this is not specified, the - // resources have not been allocated yet. +// ResourceClaimStatus tracks whether the resource has been allocated and what +// the result of that was. +type ResourceClaimStatus struct { + // Allocation is set once the claim has been allocated successfully. + // // +optional Allocation *AllocationResult // ReservedFor indicates which entities are currently allowed to use // the claim. A Pod which references a ResourceClaim which is not - // reserved for that Pod will not be started. + // reserved for that Pod will not be started. A claim that is in + // use or might be in use because it has been reserved must not get + // deallocated. + // + // In a cluster with multiple scheduler instances, two pods might get + // scheduled concurrently by different schedulers. When they reference + // the same ResourceClaim which already has reached its maximum number + // of consumers, only one pod can be scheduled. + // + // Both schedulers try to add their pod to the claim.status.reservedFor + // field, but only the update that reaches the API server first gets + // stored. The other one fails with an error and the scheduler + // which issued it knows that it must put the pod back into the queue, + // waiting for the ResourceClaim to become usable again. // // There can be at most 32 such reservations. This may get increased in // the future, but not reduced. + // // +optional + // +listType=map + // +listMapKey=uid + // +patchStrategy=merge + // +patchMergeKey=uid ReservedFor []ResourceClaimConsumerReference - // DeallocationRequested indicates that a ResourceClaim is to be - // deallocated. + // Indicates that a claim is to be deallocated. While this is set, + // no new consumers may be added to ReservedFor. // - // The driver then must deallocate this claim and reset the field + // This is only used if the claim needs to be deallocated by a DRA driver. + // That driver then must deallocate this claim and reset the field // together with clearing the Allocation field. // - // While DeallocationRequested is set, no new consumers may be added to - // ReservedFor. + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // // +optional DeallocationRequested bool } @@ -129,106 +645,142 @@ type ResourceClaimStatus struct { // claim.status.reservedFor. const ResourceClaimReservedForMaxSize = 32 +// ResourceClaimConsumerReference contains enough information to let you +// locate the consumer of a ResourceClaim. The user must be a resource in the same +// namespace as the ResourceClaim. +type ResourceClaimConsumerReference struct { + // APIGroup is the group for the resource being referenced. It is + // empty for the core API. This matches the group in the APIVersion + // that is used when creating the resources. + // +optional + APIGroup string + // Resource is the type of resource being referenced, for example "pods". + // +required + Resource string + // Name is the name of resource being referenced. + // +required + Name string + // UID identifies exactly one incarnation of the resource. + // +required + UID types.UID +} + // AllocationResult contains attributes of an allocated resource. type AllocationResult struct { - // ResourceHandles contain the state associated with an allocation that - // should be maintained throughout the lifetime of a claim. Each - // ResourceHandle contains data that should be passed to a specific kubelet - // plugin once it lands on a node. This data is returned by the driver - // after a successful allocation and is opaque to Kubernetes. Driver - // documentation may explain to users how to interpret this data if needed. - // - // Setting this field is optional. It has a maximum size of 32 entries. - // If null (or empty), it is assumed this allocation will be processed by a - // single kubelet plugin with no ResourceHandle data attached. The name of - // the kubelet plugin invoked will match the DriverName set in the - // ResourceClaimStatus this AllocationResult is embedded in. + // Devices is the result of allocating devices. // - // +listType=atomic // +optional - ResourceHandles []ResourceHandle + Devices DeviceAllocationResult - // This field will get set by the resource driver after it has allocated - // the resource to inform the scheduler where it can schedule Pods using - // the ResourceClaim. + // NodeSelector defines where the allocated resources are available. If + // unset, they are available everywhere. // - // Setting this field is optional. If null, the resource is available - // everywhere. // +optional - AvailableOnNodes *core.NodeSelector + NodeSelector *core.NodeSelector - // Shareable determines whether the resource supports more - // than one consumer at a time. + // Controller is the name of the DRA driver which handled the + // allocation. That driver is also responsible for deallocating the + // claim. It is empty when the claim can be deallocated without + // involving a driver. + // + // A driver may allocate devices provided by other drivers, so this + // driver name here can be different from the driver names listed for + // the results. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // // +optional - Shareable bool + Controller string } -// AllocationResultResourceHandlesMaxSize represents the maximum number of -// entries in allocation.resourceHandles. -const AllocationResultResourceHandlesMaxSize = 32 - -// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin. -type ResourceHandle struct { - // DriverName specifies the name of the resource driver whose kubelet - // plugin should be invoked to process this ResourceHandle's data once it - // lands on a node. This may differ from the DriverName set in - // ResourceClaimStatus this ResourceHandle is embedded in. - DriverName string - - // Data contains the opaque data associated with this ResourceHandle. It is - // set by the controller component of the resource driver whose name - // matches the DriverName set in the ResourceClaimStatus this - // ResourceHandle is embedded in. It is set at allocation time and is - // intended for processing by the kubelet plugin whose name matches - // the DriverName set in this ResourceHandle. +// DeviceAllocationResult is the result of allocating devices. +type DeviceAllocationResult struct { + // Results lists all allocated devices. // - // The maximum size of this field is 16KiB. This may get increased in the - // future, but not reduced. // +optional - Data string + // +listType=atomic + Results []DeviceRequestAllocationResult - // If StructuredData is set, then it needs to be used instead of Data. - StructuredData *StructuredResourceHandle + // This field is a combination of all the claim and class configuration parameters. + // Drivers can distinguish between those based on a flag. + // + // This includes configuration parameters for drivers which have no allocated + // devices in the result because it is up to the drivers which configuration + // parameters they support. They can silently ignore unknown configuration + // parameters. + // + // +optional + // +listType=atomic + Config []DeviceAllocationConfiguration } -// ResourceHandleDataMaxSize represents the maximum size of resourceHandle.data. -const ResourceHandleDataMaxSize = 16 * 1024 +// AllocationResultsMaxSize represents the maximum number of +// entries in allocation.devices.results. +const AllocationResultsMaxSize = 32 -// StructuredResourceHandle is the in-tree representation of the allocation result. -type StructuredResourceHandle struct { - // VendorClassParameters are the per-claim configuration parameters - // from the resource class at the time that the claim was allocated. - VendorClassParameters runtime.Object +// DeviceRequestAllocationResult contains the allocation result for one request. +type DeviceRequestAllocationResult struct { + // Request is the name of the request in the claim which caused this + // device to be allocated. Multiple devices may have been allocated + // per request. + // + // +required + Request string - // VendorClaimParameters are the per-claim configuration parameters - // from the resource claim parameters at the time that the claim was - // allocated. - VendorClaimParameters runtime.Object + // Driver specifies the name of the DRA driver whose kubelet + // plugin should be invoked to process the allocation once the claim is + // needed on a node. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // +required + Driver string - // NodeName is the name of the node providing the necessary resources - // if the resources are local to a node. - NodeName string + // This name together with the driver name and the device name field + // identify which device was allocated (`//`). + // + // Must not be longer than 253 characters and may contain one or more + // DNS sub-domains separated by slashes. + // + // +required + Pool string - // Results lists all allocated driver resources. - Results []DriverAllocationResult + // Device references one device instance via its name in the driver's + // resource pool. It must be a DNS label. + // + // +required + Device string } -// DriverAllocationResult contains vendor parameters and the allocation result for -// one request. -type DriverAllocationResult struct { - // VendorRequestParameters are the per-request configuration parameters - // from the time that the claim was allocated. - VendorRequestParameters runtime.Object +// DeviceAllocationConfiguration gets embedded in an AllocationResult. +type DeviceAllocationConfiguration struct { + // Source records whether the configuration comes from a class and thus + // is not something that a normal user would have been able to set + // or from a claim. + // + // +required + Source AllocationConfigSource - AllocationResultModel -} + // Requests lists the names of requests where the configuration applies. + // If empty, its applies to all requests. + // + // +optional + // +listType=atomic + Requests []string -// AllocationResultModel must have one and only one field set. -type AllocationResultModel struct { - // NamedResources describes the allocation result when using the named resources model. - NamedResources *NamedResourcesAllocationResult + DeviceConfiguration // inline } +type AllocationConfigSource string + +// Valid [DeviceAllocationConfiguration.Source] values. +const ( + AllocationConfigSourceClass = "FromClass" + AllocationConfigSourceClaim = "FromClaim" +) + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ResourceClaimList is a collection of claims. @@ -248,7 +800,7 @@ type ResourceClaimList struct { // a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation // mode. // -// This is an alpha type and requires enabling the DynamicResourceAllocation +// This is an alpha type and requires enabling the DRAControlPlaneController // feature gate. type PodSchedulingContext struct { metav1.TypeMeta @@ -260,6 +812,8 @@ type PodSchedulingContext struct { Spec PodSchedulingContextSpec // Status describes where resources for the Pod can be allocated. + // + // +optional Status PodSchedulingContextStatus } @@ -268,6 +822,8 @@ type PodSchedulingContextSpec struct { // SelectedNode is the node for which allocation of ResourceClaims that // are referenced by the Pod and that use "WaitForFirstConsumer" // allocation is to be attempted. + // + // +optional SelectedNode string // PotentialNodes lists nodes where the Pod might be able to run. @@ -276,7 +832,9 @@ type PodSchedulingContextSpec struct { // many clusters. Larger clusters may need more attempts to find a node // that suits all pending resources. This may get increased in the // future, but not reduced. + // // +optional + // +listType=atomic PotentialNodes []string } @@ -285,6 +843,9 @@ type PodSchedulingContextStatus struct { // ResourceClaims describes resource availability for each // pod.spec.resourceClaim entry where the corresponding ResourceClaim // uses "WaitForFirstConsumer" allocation mode. + // + // +listType=map + // +listMapKey=name // +optional ResourceClaims []ResourceClaimSchedulingStatus @@ -297,6 +858,8 @@ type PodSchedulingContextStatus struct { // ResourceClaim with "WaitForFirstConsumer" allocation mode. type ResourceClaimSchedulingStatus struct { // Name matches the pod.spec.resourceClaims[*].Name field. + // + // +required Name string // UnsuitableNodes lists nodes that the ResourceClaim cannot be @@ -305,7 +868,9 @@ type ResourceClaimSchedulingStatus struct { // The size of this field is limited to 128, the same as for // PodSchedulingSpec.PotentialNodes. This may get increased in the // future, but not reduced. + // // +optional + // +listType=atomic UnsuitableNodes []string } @@ -329,114 +894,89 @@ type PodSchedulingContextList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ResourceClass is used by administrators to influence how resources -// are allocated. +// DeviceClass is a vendor or admin-provided resource that contains +// device configuration and selectors. It can be referenced in +// the device requests of a claim to apply these presets. +// Cluster scoped. // // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. -type ResourceClass struct { +type DeviceClass struct { metav1.TypeMeta // Standard object metadata // +optional metav1.ObjectMeta - // DriverName defines the name of the dynamic resource driver that is - // used for allocation of a ResourceClaim that uses this class. + // Spec defines what can be allocated and how to configure it. + // + // This is mutable. Consumers have to be prepared for classes changing + // at any time, either because they get updated or replaced. Claim + // allocations are done once based on whatever was set in classes at + // the time of allocation. + // + // Changing the spec automatically increments the metadata.generation number. + Spec DeviceClassSpec +} + +// DeviceClassSpec is used in a [DeviceClass] to define what can be allocated +// and how to configure it. +type DeviceClassSpec struct { + // Each selector must be satisfied by a device which is claimed via this class. // - // Resource drivers have a unique name in forward domain order - // (acme.example.com). - DriverName string + // +optional + // +listType=atomic + Selectors []DeviceSelector - // ParametersRef references an arbitrary separate object that may hold - // parameters that will be used by the driver when allocating a - // resource that uses this class. A dynamic resource driver can - // distinguish between parameters stored here and and those stored in - // ResourceClaimSpec. + // Config defines configuration parameters that apply to each device that is claimed via this class. + // Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor + // configuration applies to exactly one driver. + // + // They are passed to the driver, but are not considered while allocating the claim. + // // +optional - ParametersRef *ResourceClassParametersReference + // +listType=atomic + Config []DeviceClassConfiguration // Only nodes matching the selector will be considered by the scheduler // when trying to find a Node that fits a Pod when that Pod uses - // a ResourceClaim that has not been allocated yet. + // a claim that has not been allocated yet *and* that claim + // gets allocated through a control plane controller. It is ignored + // when the claim does not use a control plane controller + // for allocation. + // + // Setting this field is optional. If unset, all Nodes are candidates. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. // - // Setting this field is optional. If null, all nodes are candidates. // +optional SuitableNodes *core.NodeSelector +} - // If and only if allocation of claims using this class is handled - // via structured parameters, then StructuredParameters must be set to true. - StructuredParameters *bool +// DeviceClassConfiguration is used in DeviceClass. +type DeviceClassConfiguration struct { + DeviceConfiguration // inline } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ResourceClassList is a collection of classes. -type ResourceClassList struct { +// DeviceClassList is a collection of classes. +type DeviceClassList struct { metav1.TypeMeta // Standard list metadata // +optional metav1.ListMeta // Items is the list of resource classes. - Items []ResourceClass -} - -// ResourceClassParametersReference contains enough information to let you -// locate the parameters for a ResourceClass. -type ResourceClassParametersReference struct { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - APIGroup string - // Kind is the type of resource being referenced. This is the same - // value as in the parameter object's metadata. - Kind string - // Name is the name of resource being referenced. - Name string - // Namespace that contains the referenced resource. Must be empty - // for cluster-scoped resources and non-empty for namespaced - // resources. - // +optional - Namespace string -} - -// ResourceClaimParametersReference contains enough information to let you -// locate the parameters for a ResourceClaim. The object must be in the same -// namespace as the ResourceClaim. -type ResourceClaimParametersReference struct { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - APIGroup string - // Kind is the type of resource being referenced. This is the same - // value as in the parameter object's metadata, for example "ConfigMap". - Kind string - // Name is the name of resource being referenced. - Name string -} - -// ResourceClaimConsumerReference contains enough information to let you -// locate the consumer of a ResourceClaim. The user must be a resource in the same -// namespace as the ResourceClaim. -type ResourceClaimConsumerReference struct { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - APIGroup string - // Resource is the type of resource being referenced, for example "pods". - Resource string - // Name is the name of resource being referenced. - Name string - // UID identifies exactly one incarnation of the resource. - UID types.UID + Items []DeviceClass } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ResourceClaimTemplate is used to produce ResourceClaim objects. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. type ResourceClaimTemplate struct { metav1.TypeMeta // Standard object metadata @@ -477,173 +1017,3 @@ type ResourceClaimTemplateList struct { // Items is the list of resource claim templates. Items []ResourceClaimTemplate } - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ResourceSlice provides information about available -// resources on individual nodes. -type ResourceSlice struct { - metav1.TypeMeta - // Standard object metadata - metav1.ObjectMeta - - // NodeName identifies the node which provides the resources - // if they are local to a node. - // - // A field selector can be used to list only ResourceSlice - // objects with a certain node name. - NodeName string - - // DriverName identifies the DRA driver providing the capacity information. - // A field selector can be used to list only ResourceSlice - // objects with a certain driver name. - DriverName string - - ResourceModel -} - -// ResourceModel must have one and only one field set. -type ResourceModel struct { - // NamedResources describes available resources using the named resources model. - NamedResources *NamedResourcesResources -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ResourceSliceList is a collection of ResourceSlices. -type ResourceSliceList struct { - metav1.TypeMeta - // Standard list metadata - metav1.ListMeta - - // Items is the list of node resource capacity objects. - Items []ResourceSlice -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ResourceClaimParameters defines resource requests for a ResourceClaim in an -// in-tree format understood by Kubernetes. -type ResourceClaimParameters struct { - metav1.TypeMeta - // Standard object metadata - metav1.ObjectMeta - - // If this object was created from some other resource, then this links - // back to that resource. This field is used to find the in-tree representation - // of the claim parameters when the parameter reference of the claim refers - // to some unknown type. - GeneratedFrom *ResourceClaimParametersReference - - // Shareable indicates whether the allocated claim is meant to be shareable - // by multiple consumers at the same time. - Shareable bool - - // DriverRequests describes all resources that are needed for the - // allocated claim. A single claim may use resources coming from - // different drivers. For each driver, this array has at most one - // entry which then may have one or more per-driver requests. - // - // May be empty, in which case the claim can always be allocated. - DriverRequests []DriverRequests -} - -// DriverRequests describes all resources that are needed from one particular driver. -type DriverRequests struct { - // DriverName is the name used by the DRA driver kubelet plugin. - DriverName string - - // VendorParameters are arbitrary setup parameters for all requests of the - // claim. They are ignored while allocating the claim. - VendorParameters runtime.Object - - // Requests describes all resources that are needed from the driver. - Requests []ResourceRequest -} - -// ResourceRequest is a request for resources from one particular driver. -type ResourceRequest struct { - // VendorParameters are arbitrary setup parameters for the requested - // resource. They are ignored while allocating a claim. - VendorParameters runtime.Object - - ResourceRequestModel -} - -// ResourceRequestModel must have one and only one field set. -type ResourceRequestModel struct { - // NamedResources describes a request for resources with the named resources model. - NamedResources *NamedResourcesRequest -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ResourceClaimParametersList is a collection of ResourceClaimParameters. -type ResourceClaimParametersList struct { - metav1.TypeMeta - // Standard list metadata - metav1.ListMeta - - // Items is the list of node resource capacity objects. - Items []ResourceClaimParameters -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ResourceClassParameters defines resource requests for a ResourceClass in an -// in-tree format understood by Kubernetes. -type ResourceClassParameters struct { - metav1.TypeMeta - // Standard object metadata - metav1.ObjectMeta - - // If this object was created from some other resource, then this links - // back to that resource. This field is used to find the in-tree representation - // of the class parameters when the parameter reference of the class refers - // to some unknown type. - GeneratedFrom *ResourceClassParametersReference - - // VendorParameters are arbitrary setup parameters for all claims using - // this class. They are ignored while allocating the claim. There must - // not be more than one entry per driver. - VendorParameters []VendorParameters - - // Filters describes additional contraints that must be met when using the class. - Filters []ResourceFilter -} - -// ResourceFilter is a filter for resources from one particular driver. -type ResourceFilter struct { - // DriverName is the name used by the DRA driver kubelet plugin. - DriverName string - - ResourceFilterModel -} - -// ResourceFilterModel must have one and only one field set. -type ResourceFilterModel struct { - // NamedResources describes a resource filter using the named resources model. - NamedResources *NamedResourcesFilter -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ResourceClassParametersList is a collection of ResourceClassParameters. -type ResourceClassParametersList struct { - metav1.TypeMeta - // Standard list metadata - metav1.ListMeta - - // Items is the list of node resource capacity objects. - Items []ResourceClassParameters -} - -// VendorParameters are opaque parameters for one particular driver. -type VendorParameters struct { - // DriverName is the name used by the DRA driver kubelet plugin. - DriverName string - - // Parameters can be arbitrary setup parameters. They are ignored while - // allocating a claim. - Parameters runtime.Object -} diff --git a/pkg/apis/resource/v1alpha2/defaults_test.go b/pkg/apis/resource/v1alpha2/defaults_test.go deleted file mode 100644 index 7f5b0d01046ef..0000000000000 --- a/pkg/apis/resource/v1alpha2/defaults_test.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package v1alpha2_test - -import ( - "reflect" - "testing" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/runtime" - - // ensure types are installed - "k8s.io/kubernetes/pkg/api/legacyscheme" - _ "k8s.io/kubernetes/pkg/apis/resource/install" -) - -func TestSetDefaultAllocationMode(t *testing.T) { - claim := &v1alpha2.ResourceClaim{} - - // field should be defaulted - defaultMode := v1alpha2.AllocationModeWaitForFirstConsumer - output := roundTrip(t, runtime.Object(claim)).(*v1alpha2.ResourceClaim) - outMode := output.Spec.AllocationMode - if outMode != defaultMode { - t.Errorf("Expected AllocationMode to be defaulted to: %+v, got: %+v", defaultMode, outMode) - } - - // field should not change - nonDefaultMode := v1alpha2.AllocationModeImmediate - claim = &v1alpha2.ResourceClaim{ - Spec: v1alpha2.ResourceClaimSpec{ - AllocationMode: nonDefaultMode, - }, - } - output = roundTrip(t, runtime.Object(claim)).(*v1alpha2.ResourceClaim) - outMode = output.Spec.AllocationMode - if outMode != v1alpha2.AllocationModeImmediate { - t.Errorf("Expected AllocationMode to remain %+v, got: %+v", nonDefaultMode, outMode) - } -} - -func roundTrip(t *testing.T, obj runtime.Object) runtime.Object { - codec := legacyscheme.Codecs.LegacyCodec(v1alpha2.SchemeGroupVersion) - data, err := runtime.Encode(codec, obj) - if err != nil { - t.Errorf("%v\n %#v", err, obj) - return nil - } - obj2, err := runtime.Decode(codec, data) - if err != nil { - t.Errorf("%v\nData: %s\nSource: %#v", err, string(data), obj) - return nil - } - obj3 := reflect.New(reflect.TypeOf(obj).Elem()).Interface().(runtime.Object) - err = legacyscheme.Scheme.Convert(obj2, obj3, nil) - if err != nil { - t.Errorf("%v\nSource: %#v", err, obj2) - return nil - } - return obj3 -} diff --git a/pkg/apis/resource/v1alpha2/zz_generated.conversion.go b/pkg/apis/resource/v1alpha2/zz_generated.conversion.go deleted file mode 100644 index c49d690c705c2..0000000000000 --- a/pkg/apis/resource/v1alpha2/zz_generated.conversion.go +++ /dev/null @@ -1,1749 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -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 conversion-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - v1alpha2 "k8s.io/api/resource/v1alpha2" - apiresource "k8s.io/apimachinery/pkg/api/resource" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - types "k8s.io/apimachinery/pkg/types" - core "k8s.io/kubernetes/pkg/apis/core" - resource "k8s.io/kubernetes/pkg/apis/resource" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*v1alpha2.AllocationResult)(nil), (*resource.AllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_AllocationResult_To_resource_AllocationResult(a.(*v1alpha2.AllocationResult), b.(*resource.AllocationResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.AllocationResult)(nil), (*v1alpha2.AllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_AllocationResult_To_v1alpha2_AllocationResult(a.(*resource.AllocationResult), b.(*v1alpha2.AllocationResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.AllocationResultModel)(nil), (*resource.AllocationResultModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_AllocationResultModel_To_resource_AllocationResultModel(a.(*v1alpha2.AllocationResultModel), b.(*resource.AllocationResultModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.AllocationResultModel)(nil), (*v1alpha2.AllocationResultModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_AllocationResultModel_To_v1alpha2_AllocationResultModel(a.(*resource.AllocationResultModel), b.(*v1alpha2.AllocationResultModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.DriverAllocationResult)(nil), (*resource.DriverAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_DriverAllocationResult_To_resource_DriverAllocationResult(a.(*v1alpha2.DriverAllocationResult), b.(*resource.DriverAllocationResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.DriverAllocationResult)(nil), (*v1alpha2.DriverAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_DriverAllocationResult_To_v1alpha2_DriverAllocationResult(a.(*resource.DriverAllocationResult), b.(*v1alpha2.DriverAllocationResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.DriverRequests)(nil), (*resource.DriverRequests)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_DriverRequests_To_resource_DriverRequests(a.(*v1alpha2.DriverRequests), b.(*resource.DriverRequests), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.DriverRequests)(nil), (*v1alpha2.DriverRequests)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_DriverRequests_To_v1alpha2_DriverRequests(a.(*resource.DriverRequests), b.(*v1alpha2.DriverRequests), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesAllocationResult)(nil), (*resource.NamedResourcesAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesAllocationResult_To_resource_NamedResourcesAllocationResult(a.(*v1alpha2.NamedResourcesAllocationResult), b.(*resource.NamedResourcesAllocationResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesAllocationResult)(nil), (*v1alpha2.NamedResourcesAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesAllocationResult_To_v1alpha2_NamedResourcesAllocationResult(a.(*resource.NamedResourcesAllocationResult), b.(*v1alpha2.NamedResourcesAllocationResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesAttribute)(nil), (*resource.NamedResourcesAttribute)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesAttribute_To_resource_NamedResourcesAttribute(a.(*v1alpha2.NamedResourcesAttribute), b.(*resource.NamedResourcesAttribute), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesAttribute)(nil), (*v1alpha2.NamedResourcesAttribute)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesAttribute_To_v1alpha2_NamedResourcesAttribute(a.(*resource.NamedResourcesAttribute), b.(*v1alpha2.NamedResourcesAttribute), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesAttributeValue)(nil), (*resource.NamedResourcesAttributeValue)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesAttributeValue_To_resource_NamedResourcesAttributeValue(a.(*v1alpha2.NamedResourcesAttributeValue), b.(*resource.NamedResourcesAttributeValue), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesAttributeValue)(nil), (*v1alpha2.NamedResourcesAttributeValue)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesAttributeValue_To_v1alpha2_NamedResourcesAttributeValue(a.(*resource.NamedResourcesAttributeValue), b.(*v1alpha2.NamedResourcesAttributeValue), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesFilter)(nil), (*resource.NamedResourcesFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesFilter_To_resource_NamedResourcesFilter(a.(*v1alpha2.NamedResourcesFilter), b.(*resource.NamedResourcesFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesFilter)(nil), (*v1alpha2.NamedResourcesFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesFilter_To_v1alpha2_NamedResourcesFilter(a.(*resource.NamedResourcesFilter), b.(*v1alpha2.NamedResourcesFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesInstance)(nil), (*resource.NamedResourcesInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesInstance_To_resource_NamedResourcesInstance(a.(*v1alpha2.NamedResourcesInstance), b.(*resource.NamedResourcesInstance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesInstance)(nil), (*v1alpha2.NamedResourcesInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesInstance_To_v1alpha2_NamedResourcesInstance(a.(*resource.NamedResourcesInstance), b.(*v1alpha2.NamedResourcesInstance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesIntSlice)(nil), (*resource.NamedResourcesIntSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesIntSlice_To_resource_NamedResourcesIntSlice(a.(*v1alpha2.NamedResourcesIntSlice), b.(*resource.NamedResourcesIntSlice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesIntSlice)(nil), (*v1alpha2.NamedResourcesIntSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesIntSlice_To_v1alpha2_NamedResourcesIntSlice(a.(*resource.NamedResourcesIntSlice), b.(*v1alpha2.NamedResourcesIntSlice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesRequest)(nil), (*resource.NamedResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesRequest_To_resource_NamedResourcesRequest(a.(*v1alpha2.NamedResourcesRequest), b.(*resource.NamedResourcesRequest), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesRequest)(nil), (*v1alpha2.NamedResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesRequest_To_v1alpha2_NamedResourcesRequest(a.(*resource.NamedResourcesRequest), b.(*v1alpha2.NamedResourcesRequest), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesResources)(nil), (*resource.NamedResourcesResources)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesResources_To_resource_NamedResourcesResources(a.(*v1alpha2.NamedResourcesResources), b.(*resource.NamedResourcesResources), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesResources)(nil), (*v1alpha2.NamedResourcesResources)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesResources_To_v1alpha2_NamedResourcesResources(a.(*resource.NamedResourcesResources), b.(*v1alpha2.NamedResourcesResources), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.NamedResourcesStringSlice)(nil), (*resource.NamedResourcesStringSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_NamedResourcesStringSlice_To_resource_NamedResourcesStringSlice(a.(*v1alpha2.NamedResourcesStringSlice), b.(*resource.NamedResourcesStringSlice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.NamedResourcesStringSlice)(nil), (*v1alpha2.NamedResourcesStringSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_NamedResourcesStringSlice_To_v1alpha2_NamedResourcesStringSlice(a.(*resource.NamedResourcesStringSlice), b.(*v1alpha2.NamedResourcesStringSlice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.PodSchedulingContext)(nil), (*resource.PodSchedulingContext)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_PodSchedulingContext_To_resource_PodSchedulingContext(a.(*v1alpha2.PodSchedulingContext), b.(*resource.PodSchedulingContext), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContext)(nil), (*v1alpha2.PodSchedulingContext)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_PodSchedulingContext_To_v1alpha2_PodSchedulingContext(a.(*resource.PodSchedulingContext), b.(*v1alpha2.PodSchedulingContext), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.PodSchedulingContextList)(nil), (*resource.PodSchedulingContextList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_PodSchedulingContextList_To_resource_PodSchedulingContextList(a.(*v1alpha2.PodSchedulingContextList), b.(*resource.PodSchedulingContextList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContextList)(nil), (*v1alpha2.PodSchedulingContextList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_PodSchedulingContextList_To_v1alpha2_PodSchedulingContextList(a.(*resource.PodSchedulingContextList), b.(*v1alpha2.PodSchedulingContextList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.PodSchedulingContextSpec)(nil), (*resource.PodSchedulingContextSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(a.(*v1alpha2.PodSchedulingContextSpec), b.(*resource.PodSchedulingContextSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContextSpec)(nil), (*v1alpha2.PodSchedulingContextSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_PodSchedulingContextSpec_To_v1alpha2_PodSchedulingContextSpec(a.(*resource.PodSchedulingContextSpec), b.(*v1alpha2.PodSchedulingContextSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.PodSchedulingContextStatus)(nil), (*resource.PodSchedulingContextStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(a.(*v1alpha2.PodSchedulingContextStatus), b.(*resource.PodSchedulingContextStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContextStatus)(nil), (*v1alpha2.PodSchedulingContextStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_PodSchedulingContextStatus_To_v1alpha2_PodSchedulingContextStatus(a.(*resource.PodSchedulingContextStatus), b.(*v1alpha2.PodSchedulingContextStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaim)(nil), (*resource.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaim_To_resource_ResourceClaim(a.(*v1alpha2.ResourceClaim), b.(*resource.ResourceClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaim)(nil), (*v1alpha2.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaim_To_v1alpha2_ResourceClaim(a.(*resource.ResourceClaim), b.(*v1alpha2.ResourceClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimConsumerReference)(nil), (*resource.ResourceClaimConsumerReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(a.(*v1alpha2.ResourceClaimConsumerReference), b.(*resource.ResourceClaimConsumerReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimConsumerReference)(nil), (*v1alpha2.ResourceClaimConsumerReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimConsumerReference_To_v1alpha2_ResourceClaimConsumerReference(a.(*resource.ResourceClaimConsumerReference), b.(*v1alpha2.ResourceClaimConsumerReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimList)(nil), (*resource.ResourceClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimList_To_resource_ResourceClaimList(a.(*v1alpha2.ResourceClaimList), b.(*resource.ResourceClaimList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimList)(nil), (*v1alpha2.ResourceClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimList_To_v1alpha2_ResourceClaimList(a.(*resource.ResourceClaimList), b.(*v1alpha2.ResourceClaimList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimParameters)(nil), (*resource.ResourceClaimParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimParameters_To_resource_ResourceClaimParameters(a.(*v1alpha2.ResourceClaimParameters), b.(*resource.ResourceClaimParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimParameters)(nil), (*v1alpha2.ResourceClaimParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimParameters_To_v1alpha2_ResourceClaimParameters(a.(*resource.ResourceClaimParameters), b.(*v1alpha2.ResourceClaimParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimParametersList)(nil), (*resource.ResourceClaimParametersList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimParametersList_To_resource_ResourceClaimParametersList(a.(*v1alpha2.ResourceClaimParametersList), b.(*resource.ResourceClaimParametersList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimParametersList)(nil), (*v1alpha2.ResourceClaimParametersList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimParametersList_To_v1alpha2_ResourceClaimParametersList(a.(*resource.ResourceClaimParametersList), b.(*v1alpha2.ResourceClaimParametersList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimParametersReference)(nil), (*resource.ResourceClaimParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimParametersReference_To_resource_ResourceClaimParametersReference(a.(*v1alpha2.ResourceClaimParametersReference), b.(*resource.ResourceClaimParametersReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimParametersReference)(nil), (*v1alpha2.ResourceClaimParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimParametersReference_To_v1alpha2_ResourceClaimParametersReference(a.(*resource.ResourceClaimParametersReference), b.(*v1alpha2.ResourceClaimParametersReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimSchedulingStatus)(nil), (*resource.ResourceClaimSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(a.(*v1alpha2.ResourceClaimSchedulingStatus), b.(*resource.ResourceClaimSchedulingStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimSchedulingStatus)(nil), (*v1alpha2.ResourceClaimSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha2_ResourceClaimSchedulingStatus(a.(*resource.ResourceClaimSchedulingStatus), b.(*v1alpha2.ResourceClaimSchedulingStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimSpec)(nil), (*resource.ResourceClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec(a.(*v1alpha2.ResourceClaimSpec), b.(*resource.ResourceClaimSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimSpec)(nil), (*v1alpha2.ResourceClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec(a.(*resource.ResourceClaimSpec), b.(*v1alpha2.ResourceClaimSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimStatus)(nil), (*resource.ResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimStatus_To_resource_ResourceClaimStatus(a.(*v1alpha2.ResourceClaimStatus), b.(*resource.ResourceClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimStatus)(nil), (*v1alpha2.ResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimStatus_To_v1alpha2_ResourceClaimStatus(a.(*resource.ResourceClaimStatus), b.(*v1alpha2.ResourceClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimTemplate)(nil), (*resource.ResourceClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(a.(*v1alpha2.ResourceClaimTemplate), b.(*resource.ResourceClaimTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplate)(nil), (*v1alpha2.ResourceClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimTemplate_To_v1alpha2_ResourceClaimTemplate(a.(*resource.ResourceClaimTemplate), b.(*v1alpha2.ResourceClaimTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimTemplateList)(nil), (*resource.ResourceClaimTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(a.(*v1alpha2.ResourceClaimTemplateList), b.(*resource.ResourceClaimTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplateList)(nil), (*v1alpha2.ResourceClaimTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimTemplateList_To_v1alpha2_ResourceClaimTemplateList(a.(*resource.ResourceClaimTemplateList), b.(*v1alpha2.ResourceClaimTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClaimTemplateSpec)(nil), (*resource.ResourceClaimTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(a.(*v1alpha2.ResourceClaimTemplateSpec), b.(*resource.ResourceClaimTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplateSpec)(nil), (*v1alpha2.ResourceClaimTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClaimTemplateSpec_To_v1alpha2_ResourceClaimTemplateSpec(a.(*resource.ResourceClaimTemplateSpec), b.(*v1alpha2.ResourceClaimTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClass)(nil), (*resource.ResourceClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClass_To_resource_ResourceClass(a.(*v1alpha2.ResourceClass), b.(*resource.ResourceClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClass)(nil), (*v1alpha2.ResourceClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClass_To_v1alpha2_ResourceClass(a.(*resource.ResourceClass), b.(*v1alpha2.ResourceClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClassList)(nil), (*resource.ResourceClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClassList_To_resource_ResourceClassList(a.(*v1alpha2.ResourceClassList), b.(*resource.ResourceClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClassList)(nil), (*v1alpha2.ResourceClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClassList_To_v1alpha2_ResourceClassList(a.(*resource.ResourceClassList), b.(*v1alpha2.ResourceClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClassParameters)(nil), (*resource.ResourceClassParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClassParameters_To_resource_ResourceClassParameters(a.(*v1alpha2.ResourceClassParameters), b.(*resource.ResourceClassParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClassParameters)(nil), (*v1alpha2.ResourceClassParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClassParameters_To_v1alpha2_ResourceClassParameters(a.(*resource.ResourceClassParameters), b.(*v1alpha2.ResourceClassParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClassParametersList)(nil), (*resource.ResourceClassParametersList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClassParametersList_To_resource_ResourceClassParametersList(a.(*v1alpha2.ResourceClassParametersList), b.(*resource.ResourceClassParametersList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClassParametersList)(nil), (*v1alpha2.ResourceClassParametersList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClassParametersList_To_v1alpha2_ResourceClassParametersList(a.(*resource.ResourceClassParametersList), b.(*v1alpha2.ResourceClassParametersList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceClassParametersReference)(nil), (*resource.ResourceClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceClassParametersReference_To_resource_ResourceClassParametersReference(a.(*v1alpha2.ResourceClassParametersReference), b.(*resource.ResourceClassParametersReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceClassParametersReference)(nil), (*v1alpha2.ResourceClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceClassParametersReference_To_v1alpha2_ResourceClassParametersReference(a.(*resource.ResourceClassParametersReference), b.(*v1alpha2.ResourceClassParametersReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceFilter)(nil), (*resource.ResourceFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceFilter_To_resource_ResourceFilter(a.(*v1alpha2.ResourceFilter), b.(*resource.ResourceFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceFilter)(nil), (*v1alpha2.ResourceFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceFilter_To_v1alpha2_ResourceFilter(a.(*resource.ResourceFilter), b.(*v1alpha2.ResourceFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceFilterModel)(nil), (*resource.ResourceFilterModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceFilterModel_To_resource_ResourceFilterModel(a.(*v1alpha2.ResourceFilterModel), b.(*resource.ResourceFilterModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceFilterModel)(nil), (*v1alpha2.ResourceFilterModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceFilterModel_To_v1alpha2_ResourceFilterModel(a.(*resource.ResourceFilterModel), b.(*v1alpha2.ResourceFilterModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceHandle)(nil), (*resource.ResourceHandle)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceHandle_To_resource_ResourceHandle(a.(*v1alpha2.ResourceHandle), b.(*resource.ResourceHandle), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceHandle)(nil), (*v1alpha2.ResourceHandle)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceHandle_To_v1alpha2_ResourceHandle(a.(*resource.ResourceHandle), b.(*v1alpha2.ResourceHandle), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceModel)(nil), (*resource.ResourceModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceModel_To_resource_ResourceModel(a.(*v1alpha2.ResourceModel), b.(*resource.ResourceModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceModel)(nil), (*v1alpha2.ResourceModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceModel_To_v1alpha2_ResourceModel(a.(*resource.ResourceModel), b.(*v1alpha2.ResourceModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceRequest)(nil), (*resource.ResourceRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceRequest_To_resource_ResourceRequest(a.(*v1alpha2.ResourceRequest), b.(*resource.ResourceRequest), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceRequest)(nil), (*v1alpha2.ResourceRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceRequest_To_v1alpha2_ResourceRequest(a.(*resource.ResourceRequest), b.(*v1alpha2.ResourceRequest), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceRequestModel)(nil), (*resource.ResourceRequestModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceRequestModel_To_resource_ResourceRequestModel(a.(*v1alpha2.ResourceRequestModel), b.(*resource.ResourceRequestModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceRequestModel)(nil), (*v1alpha2.ResourceRequestModel)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceRequestModel_To_v1alpha2_ResourceRequestModel(a.(*resource.ResourceRequestModel), b.(*v1alpha2.ResourceRequestModel), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceSlice)(nil), (*resource.ResourceSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceSlice_To_resource_ResourceSlice(a.(*v1alpha2.ResourceSlice), b.(*resource.ResourceSlice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceSlice)(nil), (*v1alpha2.ResourceSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceSlice_To_v1alpha2_ResourceSlice(a.(*resource.ResourceSlice), b.(*v1alpha2.ResourceSlice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.ResourceSliceList)(nil), (*resource.ResourceSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_ResourceSliceList_To_resource_ResourceSliceList(a.(*v1alpha2.ResourceSliceList), b.(*resource.ResourceSliceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.ResourceSliceList)(nil), (*v1alpha2.ResourceSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_ResourceSliceList_To_v1alpha2_ResourceSliceList(a.(*resource.ResourceSliceList), b.(*v1alpha2.ResourceSliceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.StructuredResourceHandle)(nil), (*resource.StructuredResourceHandle)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_StructuredResourceHandle_To_resource_StructuredResourceHandle(a.(*v1alpha2.StructuredResourceHandle), b.(*resource.StructuredResourceHandle), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.StructuredResourceHandle)(nil), (*v1alpha2.StructuredResourceHandle)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_StructuredResourceHandle_To_v1alpha2_StructuredResourceHandle(a.(*resource.StructuredResourceHandle), b.(*v1alpha2.StructuredResourceHandle), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1alpha2.VendorParameters)(nil), (*resource.VendorParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_VendorParameters_To_resource_VendorParameters(a.(*v1alpha2.VendorParameters), b.(*resource.VendorParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*resource.VendorParameters)(nil), (*v1alpha2.VendorParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_resource_VendorParameters_To_v1alpha2_VendorParameters(a.(*resource.VendorParameters), b.(*v1alpha2.VendorParameters), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha2_AllocationResult_To_resource_AllocationResult(in *v1alpha2.AllocationResult, out *resource.AllocationResult, s conversion.Scope) error { - if in.ResourceHandles != nil { - in, out := &in.ResourceHandles, &out.ResourceHandles - *out = make([]resource.ResourceHandle, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_ResourceHandle_To_resource_ResourceHandle(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ResourceHandles = nil - } - out.AvailableOnNodes = (*core.NodeSelector)(unsafe.Pointer(in.AvailableOnNodes)) - out.Shareable = in.Shareable - return nil -} - -// Convert_v1alpha2_AllocationResult_To_resource_AllocationResult is an autogenerated conversion function. -func Convert_v1alpha2_AllocationResult_To_resource_AllocationResult(in *v1alpha2.AllocationResult, out *resource.AllocationResult, s conversion.Scope) error { - return autoConvert_v1alpha2_AllocationResult_To_resource_AllocationResult(in, out, s) -} - -func autoConvert_resource_AllocationResult_To_v1alpha2_AllocationResult(in *resource.AllocationResult, out *v1alpha2.AllocationResult, s conversion.Scope) error { - if in.ResourceHandles != nil { - in, out := &in.ResourceHandles, &out.ResourceHandles - *out = make([]v1alpha2.ResourceHandle, len(*in)) - for i := range *in { - if err := Convert_resource_ResourceHandle_To_v1alpha2_ResourceHandle(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ResourceHandles = nil - } - out.AvailableOnNodes = (*v1.NodeSelector)(unsafe.Pointer(in.AvailableOnNodes)) - out.Shareable = in.Shareable - return nil -} - -// Convert_resource_AllocationResult_To_v1alpha2_AllocationResult is an autogenerated conversion function. -func Convert_resource_AllocationResult_To_v1alpha2_AllocationResult(in *resource.AllocationResult, out *v1alpha2.AllocationResult, s conversion.Scope) error { - return autoConvert_resource_AllocationResult_To_v1alpha2_AllocationResult(in, out, s) -} - -func autoConvert_v1alpha2_AllocationResultModel_To_resource_AllocationResultModel(in *v1alpha2.AllocationResultModel, out *resource.AllocationResultModel, s conversion.Scope) error { - out.NamedResources = (*resource.NamedResourcesAllocationResult)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_v1alpha2_AllocationResultModel_To_resource_AllocationResultModel is an autogenerated conversion function. -func Convert_v1alpha2_AllocationResultModel_To_resource_AllocationResultModel(in *v1alpha2.AllocationResultModel, out *resource.AllocationResultModel, s conversion.Scope) error { - return autoConvert_v1alpha2_AllocationResultModel_To_resource_AllocationResultModel(in, out, s) -} - -func autoConvert_resource_AllocationResultModel_To_v1alpha2_AllocationResultModel(in *resource.AllocationResultModel, out *v1alpha2.AllocationResultModel, s conversion.Scope) error { - out.NamedResources = (*v1alpha2.NamedResourcesAllocationResult)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_resource_AllocationResultModel_To_v1alpha2_AllocationResultModel is an autogenerated conversion function. -func Convert_resource_AllocationResultModel_To_v1alpha2_AllocationResultModel(in *resource.AllocationResultModel, out *v1alpha2.AllocationResultModel, s conversion.Scope) error { - return autoConvert_resource_AllocationResultModel_To_v1alpha2_AllocationResultModel(in, out, s) -} - -func autoConvert_v1alpha2_DriverAllocationResult_To_resource_DriverAllocationResult(in *v1alpha2.DriverAllocationResult, out *resource.DriverAllocationResult, s conversion.Scope) error { - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.VendorRequestParameters, &out.VendorRequestParameters, s); err != nil { - return err - } - if err := Convert_v1alpha2_AllocationResultModel_To_resource_AllocationResultModel(&in.AllocationResultModel, &out.AllocationResultModel, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_DriverAllocationResult_To_resource_DriverAllocationResult is an autogenerated conversion function. -func Convert_v1alpha2_DriverAllocationResult_To_resource_DriverAllocationResult(in *v1alpha2.DriverAllocationResult, out *resource.DriverAllocationResult, s conversion.Scope) error { - return autoConvert_v1alpha2_DriverAllocationResult_To_resource_DriverAllocationResult(in, out, s) -} - -func autoConvert_resource_DriverAllocationResult_To_v1alpha2_DriverAllocationResult(in *resource.DriverAllocationResult, out *v1alpha2.DriverAllocationResult, s conversion.Scope) error { - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.VendorRequestParameters, &out.VendorRequestParameters, s); err != nil { - return err - } - if err := Convert_resource_AllocationResultModel_To_v1alpha2_AllocationResultModel(&in.AllocationResultModel, &out.AllocationResultModel, s); err != nil { - return err - } - return nil -} - -// Convert_resource_DriverAllocationResult_To_v1alpha2_DriverAllocationResult is an autogenerated conversion function. -func Convert_resource_DriverAllocationResult_To_v1alpha2_DriverAllocationResult(in *resource.DriverAllocationResult, out *v1alpha2.DriverAllocationResult, s conversion.Scope) error { - return autoConvert_resource_DriverAllocationResult_To_v1alpha2_DriverAllocationResult(in, out, s) -} - -func autoConvert_v1alpha2_DriverRequests_To_resource_DriverRequests(in *v1alpha2.DriverRequests, out *resource.DriverRequests, s conversion.Scope) error { - out.DriverName = in.DriverName - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.VendorParameters, &out.VendorParameters, s); err != nil { - return err - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make([]resource.ResourceRequest, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_ResourceRequest_To_resource_ResourceRequest(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Requests = nil - } - return nil -} - -// Convert_v1alpha2_DriverRequests_To_resource_DriverRequests is an autogenerated conversion function. -func Convert_v1alpha2_DriverRequests_To_resource_DriverRequests(in *v1alpha2.DriverRequests, out *resource.DriverRequests, s conversion.Scope) error { - return autoConvert_v1alpha2_DriverRequests_To_resource_DriverRequests(in, out, s) -} - -func autoConvert_resource_DriverRequests_To_v1alpha2_DriverRequests(in *resource.DriverRequests, out *v1alpha2.DriverRequests, s conversion.Scope) error { - out.DriverName = in.DriverName - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.VendorParameters, &out.VendorParameters, s); err != nil { - return err - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make([]v1alpha2.ResourceRequest, len(*in)) - for i := range *in { - if err := Convert_resource_ResourceRequest_To_v1alpha2_ResourceRequest(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Requests = nil - } - return nil -} - -// Convert_resource_DriverRequests_To_v1alpha2_DriverRequests is an autogenerated conversion function. -func Convert_resource_DriverRequests_To_v1alpha2_DriverRequests(in *resource.DriverRequests, out *v1alpha2.DriverRequests, s conversion.Scope) error { - return autoConvert_resource_DriverRequests_To_v1alpha2_DriverRequests(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesAllocationResult_To_resource_NamedResourcesAllocationResult(in *v1alpha2.NamedResourcesAllocationResult, out *resource.NamedResourcesAllocationResult, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_v1alpha2_NamedResourcesAllocationResult_To_resource_NamedResourcesAllocationResult is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesAllocationResult_To_resource_NamedResourcesAllocationResult(in *v1alpha2.NamedResourcesAllocationResult, out *resource.NamedResourcesAllocationResult, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesAllocationResult_To_resource_NamedResourcesAllocationResult(in, out, s) -} - -func autoConvert_resource_NamedResourcesAllocationResult_To_v1alpha2_NamedResourcesAllocationResult(in *resource.NamedResourcesAllocationResult, out *v1alpha2.NamedResourcesAllocationResult, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_resource_NamedResourcesAllocationResult_To_v1alpha2_NamedResourcesAllocationResult is an autogenerated conversion function. -func Convert_resource_NamedResourcesAllocationResult_To_v1alpha2_NamedResourcesAllocationResult(in *resource.NamedResourcesAllocationResult, out *v1alpha2.NamedResourcesAllocationResult, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesAllocationResult_To_v1alpha2_NamedResourcesAllocationResult(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesAttribute_To_resource_NamedResourcesAttribute(in *v1alpha2.NamedResourcesAttribute, out *resource.NamedResourcesAttribute, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1alpha2_NamedResourcesAttributeValue_To_resource_NamedResourcesAttributeValue(&in.NamedResourcesAttributeValue, &out.NamedResourcesAttributeValue, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_NamedResourcesAttribute_To_resource_NamedResourcesAttribute is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesAttribute_To_resource_NamedResourcesAttribute(in *v1alpha2.NamedResourcesAttribute, out *resource.NamedResourcesAttribute, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesAttribute_To_resource_NamedResourcesAttribute(in, out, s) -} - -func autoConvert_resource_NamedResourcesAttribute_To_v1alpha2_NamedResourcesAttribute(in *resource.NamedResourcesAttribute, out *v1alpha2.NamedResourcesAttribute, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_resource_NamedResourcesAttributeValue_To_v1alpha2_NamedResourcesAttributeValue(&in.NamedResourcesAttributeValue, &out.NamedResourcesAttributeValue, s); err != nil { - return err - } - return nil -} - -// Convert_resource_NamedResourcesAttribute_To_v1alpha2_NamedResourcesAttribute is an autogenerated conversion function. -func Convert_resource_NamedResourcesAttribute_To_v1alpha2_NamedResourcesAttribute(in *resource.NamedResourcesAttribute, out *v1alpha2.NamedResourcesAttribute, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesAttribute_To_v1alpha2_NamedResourcesAttribute(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesAttributeValue_To_resource_NamedResourcesAttributeValue(in *v1alpha2.NamedResourcesAttributeValue, out *resource.NamedResourcesAttributeValue, s conversion.Scope) error { - out.QuantityValue = (*apiresource.Quantity)(unsafe.Pointer(in.QuantityValue)) - out.BoolValue = (*bool)(unsafe.Pointer(in.BoolValue)) - out.IntValue = (*int64)(unsafe.Pointer(in.IntValue)) - out.IntSliceValue = (*resource.NamedResourcesIntSlice)(unsafe.Pointer(in.IntSliceValue)) - out.StringValue = (*string)(unsafe.Pointer(in.StringValue)) - out.StringSliceValue = (*resource.NamedResourcesStringSlice)(unsafe.Pointer(in.StringSliceValue)) - out.VersionValue = (*string)(unsafe.Pointer(in.VersionValue)) - return nil -} - -// Convert_v1alpha2_NamedResourcesAttributeValue_To_resource_NamedResourcesAttributeValue is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesAttributeValue_To_resource_NamedResourcesAttributeValue(in *v1alpha2.NamedResourcesAttributeValue, out *resource.NamedResourcesAttributeValue, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesAttributeValue_To_resource_NamedResourcesAttributeValue(in, out, s) -} - -func autoConvert_resource_NamedResourcesAttributeValue_To_v1alpha2_NamedResourcesAttributeValue(in *resource.NamedResourcesAttributeValue, out *v1alpha2.NamedResourcesAttributeValue, s conversion.Scope) error { - out.QuantityValue = (*apiresource.Quantity)(unsafe.Pointer(in.QuantityValue)) - out.BoolValue = (*bool)(unsafe.Pointer(in.BoolValue)) - out.IntValue = (*int64)(unsafe.Pointer(in.IntValue)) - out.IntSliceValue = (*v1alpha2.NamedResourcesIntSlice)(unsafe.Pointer(in.IntSliceValue)) - out.StringValue = (*string)(unsafe.Pointer(in.StringValue)) - out.StringSliceValue = (*v1alpha2.NamedResourcesStringSlice)(unsafe.Pointer(in.StringSliceValue)) - out.VersionValue = (*string)(unsafe.Pointer(in.VersionValue)) - return nil -} - -// Convert_resource_NamedResourcesAttributeValue_To_v1alpha2_NamedResourcesAttributeValue is an autogenerated conversion function. -func Convert_resource_NamedResourcesAttributeValue_To_v1alpha2_NamedResourcesAttributeValue(in *resource.NamedResourcesAttributeValue, out *v1alpha2.NamedResourcesAttributeValue, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesAttributeValue_To_v1alpha2_NamedResourcesAttributeValue(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesFilter_To_resource_NamedResourcesFilter(in *v1alpha2.NamedResourcesFilter, out *resource.NamedResourcesFilter, s conversion.Scope) error { - out.Selector = in.Selector - return nil -} - -// Convert_v1alpha2_NamedResourcesFilter_To_resource_NamedResourcesFilter is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesFilter_To_resource_NamedResourcesFilter(in *v1alpha2.NamedResourcesFilter, out *resource.NamedResourcesFilter, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesFilter_To_resource_NamedResourcesFilter(in, out, s) -} - -func autoConvert_resource_NamedResourcesFilter_To_v1alpha2_NamedResourcesFilter(in *resource.NamedResourcesFilter, out *v1alpha2.NamedResourcesFilter, s conversion.Scope) error { - out.Selector = in.Selector - return nil -} - -// Convert_resource_NamedResourcesFilter_To_v1alpha2_NamedResourcesFilter is an autogenerated conversion function. -func Convert_resource_NamedResourcesFilter_To_v1alpha2_NamedResourcesFilter(in *resource.NamedResourcesFilter, out *v1alpha2.NamedResourcesFilter, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesFilter_To_v1alpha2_NamedResourcesFilter(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesInstance_To_resource_NamedResourcesInstance(in *v1alpha2.NamedResourcesInstance, out *resource.NamedResourcesInstance, s conversion.Scope) error { - out.Name = in.Name - out.Attributes = *(*[]resource.NamedResourcesAttribute)(unsafe.Pointer(&in.Attributes)) - return nil -} - -// Convert_v1alpha2_NamedResourcesInstance_To_resource_NamedResourcesInstance is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesInstance_To_resource_NamedResourcesInstance(in *v1alpha2.NamedResourcesInstance, out *resource.NamedResourcesInstance, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesInstance_To_resource_NamedResourcesInstance(in, out, s) -} - -func autoConvert_resource_NamedResourcesInstance_To_v1alpha2_NamedResourcesInstance(in *resource.NamedResourcesInstance, out *v1alpha2.NamedResourcesInstance, s conversion.Scope) error { - out.Name = in.Name - out.Attributes = *(*[]v1alpha2.NamedResourcesAttribute)(unsafe.Pointer(&in.Attributes)) - return nil -} - -// Convert_resource_NamedResourcesInstance_To_v1alpha2_NamedResourcesInstance is an autogenerated conversion function. -func Convert_resource_NamedResourcesInstance_To_v1alpha2_NamedResourcesInstance(in *resource.NamedResourcesInstance, out *v1alpha2.NamedResourcesInstance, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesInstance_To_v1alpha2_NamedResourcesInstance(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesIntSlice_To_resource_NamedResourcesIntSlice(in *v1alpha2.NamedResourcesIntSlice, out *resource.NamedResourcesIntSlice, s conversion.Scope) error { - out.Ints = *(*[]int64)(unsafe.Pointer(&in.Ints)) - return nil -} - -// Convert_v1alpha2_NamedResourcesIntSlice_To_resource_NamedResourcesIntSlice is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesIntSlice_To_resource_NamedResourcesIntSlice(in *v1alpha2.NamedResourcesIntSlice, out *resource.NamedResourcesIntSlice, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesIntSlice_To_resource_NamedResourcesIntSlice(in, out, s) -} - -func autoConvert_resource_NamedResourcesIntSlice_To_v1alpha2_NamedResourcesIntSlice(in *resource.NamedResourcesIntSlice, out *v1alpha2.NamedResourcesIntSlice, s conversion.Scope) error { - out.Ints = *(*[]int64)(unsafe.Pointer(&in.Ints)) - return nil -} - -// Convert_resource_NamedResourcesIntSlice_To_v1alpha2_NamedResourcesIntSlice is an autogenerated conversion function. -func Convert_resource_NamedResourcesIntSlice_To_v1alpha2_NamedResourcesIntSlice(in *resource.NamedResourcesIntSlice, out *v1alpha2.NamedResourcesIntSlice, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesIntSlice_To_v1alpha2_NamedResourcesIntSlice(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesRequest_To_resource_NamedResourcesRequest(in *v1alpha2.NamedResourcesRequest, out *resource.NamedResourcesRequest, s conversion.Scope) error { - out.Selector = in.Selector - return nil -} - -// Convert_v1alpha2_NamedResourcesRequest_To_resource_NamedResourcesRequest is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesRequest_To_resource_NamedResourcesRequest(in *v1alpha2.NamedResourcesRequest, out *resource.NamedResourcesRequest, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesRequest_To_resource_NamedResourcesRequest(in, out, s) -} - -func autoConvert_resource_NamedResourcesRequest_To_v1alpha2_NamedResourcesRequest(in *resource.NamedResourcesRequest, out *v1alpha2.NamedResourcesRequest, s conversion.Scope) error { - out.Selector = in.Selector - return nil -} - -// Convert_resource_NamedResourcesRequest_To_v1alpha2_NamedResourcesRequest is an autogenerated conversion function. -func Convert_resource_NamedResourcesRequest_To_v1alpha2_NamedResourcesRequest(in *resource.NamedResourcesRequest, out *v1alpha2.NamedResourcesRequest, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesRequest_To_v1alpha2_NamedResourcesRequest(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesResources_To_resource_NamedResourcesResources(in *v1alpha2.NamedResourcesResources, out *resource.NamedResourcesResources, s conversion.Scope) error { - out.Instances = *(*[]resource.NamedResourcesInstance)(unsafe.Pointer(&in.Instances)) - return nil -} - -// Convert_v1alpha2_NamedResourcesResources_To_resource_NamedResourcesResources is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesResources_To_resource_NamedResourcesResources(in *v1alpha2.NamedResourcesResources, out *resource.NamedResourcesResources, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesResources_To_resource_NamedResourcesResources(in, out, s) -} - -func autoConvert_resource_NamedResourcesResources_To_v1alpha2_NamedResourcesResources(in *resource.NamedResourcesResources, out *v1alpha2.NamedResourcesResources, s conversion.Scope) error { - out.Instances = *(*[]v1alpha2.NamedResourcesInstance)(unsafe.Pointer(&in.Instances)) - return nil -} - -// Convert_resource_NamedResourcesResources_To_v1alpha2_NamedResourcesResources is an autogenerated conversion function. -func Convert_resource_NamedResourcesResources_To_v1alpha2_NamedResourcesResources(in *resource.NamedResourcesResources, out *v1alpha2.NamedResourcesResources, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesResources_To_v1alpha2_NamedResourcesResources(in, out, s) -} - -func autoConvert_v1alpha2_NamedResourcesStringSlice_To_resource_NamedResourcesStringSlice(in *v1alpha2.NamedResourcesStringSlice, out *resource.NamedResourcesStringSlice, s conversion.Scope) error { - out.Strings = *(*[]string)(unsafe.Pointer(&in.Strings)) - return nil -} - -// Convert_v1alpha2_NamedResourcesStringSlice_To_resource_NamedResourcesStringSlice is an autogenerated conversion function. -func Convert_v1alpha2_NamedResourcesStringSlice_To_resource_NamedResourcesStringSlice(in *v1alpha2.NamedResourcesStringSlice, out *resource.NamedResourcesStringSlice, s conversion.Scope) error { - return autoConvert_v1alpha2_NamedResourcesStringSlice_To_resource_NamedResourcesStringSlice(in, out, s) -} - -func autoConvert_resource_NamedResourcesStringSlice_To_v1alpha2_NamedResourcesStringSlice(in *resource.NamedResourcesStringSlice, out *v1alpha2.NamedResourcesStringSlice, s conversion.Scope) error { - out.Strings = *(*[]string)(unsafe.Pointer(&in.Strings)) - return nil -} - -// Convert_resource_NamedResourcesStringSlice_To_v1alpha2_NamedResourcesStringSlice is an autogenerated conversion function. -func Convert_resource_NamedResourcesStringSlice_To_v1alpha2_NamedResourcesStringSlice(in *resource.NamedResourcesStringSlice, out *v1alpha2.NamedResourcesStringSlice, s conversion.Scope) error { - return autoConvert_resource_NamedResourcesStringSlice_To_v1alpha2_NamedResourcesStringSlice(in, out, s) -} - -func autoConvert_v1alpha2_PodSchedulingContext_To_resource_PodSchedulingContext(in *v1alpha2.PodSchedulingContext, out *resource.PodSchedulingContext, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha2_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_PodSchedulingContext_To_resource_PodSchedulingContext is an autogenerated conversion function. -func Convert_v1alpha2_PodSchedulingContext_To_resource_PodSchedulingContext(in *v1alpha2.PodSchedulingContext, out *resource.PodSchedulingContext, s conversion.Scope) error { - return autoConvert_v1alpha2_PodSchedulingContext_To_resource_PodSchedulingContext(in, out, s) -} - -func autoConvert_resource_PodSchedulingContext_To_v1alpha2_PodSchedulingContext(in *resource.PodSchedulingContext, out *v1alpha2.PodSchedulingContext, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_resource_PodSchedulingContextSpec_To_v1alpha2_PodSchedulingContextSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_resource_PodSchedulingContextStatus_To_v1alpha2_PodSchedulingContextStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_resource_PodSchedulingContext_To_v1alpha2_PodSchedulingContext is an autogenerated conversion function. -func Convert_resource_PodSchedulingContext_To_v1alpha2_PodSchedulingContext(in *resource.PodSchedulingContext, out *v1alpha2.PodSchedulingContext, s conversion.Scope) error { - return autoConvert_resource_PodSchedulingContext_To_v1alpha2_PodSchedulingContext(in, out, s) -} - -func autoConvert_v1alpha2_PodSchedulingContextList_To_resource_PodSchedulingContextList(in *v1alpha2.PodSchedulingContextList, out *resource.PodSchedulingContextList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]resource.PodSchedulingContext)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha2_PodSchedulingContextList_To_resource_PodSchedulingContextList is an autogenerated conversion function. -func Convert_v1alpha2_PodSchedulingContextList_To_resource_PodSchedulingContextList(in *v1alpha2.PodSchedulingContextList, out *resource.PodSchedulingContextList, s conversion.Scope) error { - return autoConvert_v1alpha2_PodSchedulingContextList_To_resource_PodSchedulingContextList(in, out, s) -} - -func autoConvert_resource_PodSchedulingContextList_To_v1alpha2_PodSchedulingContextList(in *resource.PodSchedulingContextList, out *v1alpha2.PodSchedulingContextList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha2.PodSchedulingContext)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_resource_PodSchedulingContextList_To_v1alpha2_PodSchedulingContextList is an autogenerated conversion function. -func Convert_resource_PodSchedulingContextList_To_v1alpha2_PodSchedulingContextList(in *resource.PodSchedulingContextList, out *v1alpha2.PodSchedulingContextList, s conversion.Scope) error { - return autoConvert_resource_PodSchedulingContextList_To_v1alpha2_PodSchedulingContextList(in, out, s) -} - -func autoConvert_v1alpha2_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(in *v1alpha2.PodSchedulingContextSpec, out *resource.PodSchedulingContextSpec, s conversion.Scope) error { - out.SelectedNode = in.SelectedNode - out.PotentialNodes = *(*[]string)(unsafe.Pointer(&in.PotentialNodes)) - return nil -} - -// Convert_v1alpha2_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec is an autogenerated conversion function. -func Convert_v1alpha2_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(in *v1alpha2.PodSchedulingContextSpec, out *resource.PodSchedulingContextSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(in, out, s) -} - -func autoConvert_resource_PodSchedulingContextSpec_To_v1alpha2_PodSchedulingContextSpec(in *resource.PodSchedulingContextSpec, out *v1alpha2.PodSchedulingContextSpec, s conversion.Scope) error { - out.SelectedNode = in.SelectedNode - out.PotentialNodes = *(*[]string)(unsafe.Pointer(&in.PotentialNodes)) - return nil -} - -// Convert_resource_PodSchedulingContextSpec_To_v1alpha2_PodSchedulingContextSpec is an autogenerated conversion function. -func Convert_resource_PodSchedulingContextSpec_To_v1alpha2_PodSchedulingContextSpec(in *resource.PodSchedulingContextSpec, out *v1alpha2.PodSchedulingContextSpec, s conversion.Scope) error { - return autoConvert_resource_PodSchedulingContextSpec_To_v1alpha2_PodSchedulingContextSpec(in, out, s) -} - -func autoConvert_v1alpha2_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(in *v1alpha2.PodSchedulingContextStatus, out *resource.PodSchedulingContextStatus, s conversion.Scope) error { - out.ResourceClaims = *(*[]resource.ResourceClaimSchedulingStatus)(unsafe.Pointer(&in.ResourceClaims)) - return nil -} - -// Convert_v1alpha2_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus is an autogenerated conversion function. -func Convert_v1alpha2_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(in *v1alpha2.PodSchedulingContextStatus, out *resource.PodSchedulingContextStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(in, out, s) -} - -func autoConvert_resource_PodSchedulingContextStatus_To_v1alpha2_PodSchedulingContextStatus(in *resource.PodSchedulingContextStatus, out *v1alpha2.PodSchedulingContextStatus, s conversion.Scope) error { - out.ResourceClaims = *(*[]v1alpha2.ResourceClaimSchedulingStatus)(unsafe.Pointer(&in.ResourceClaims)) - return nil -} - -// Convert_resource_PodSchedulingContextStatus_To_v1alpha2_PodSchedulingContextStatus is an autogenerated conversion function. -func Convert_resource_PodSchedulingContextStatus_To_v1alpha2_PodSchedulingContextStatus(in *resource.PodSchedulingContextStatus, out *v1alpha2.PodSchedulingContextStatus, s conversion.Scope) error { - return autoConvert_resource_PodSchedulingContextStatus_To_v1alpha2_PodSchedulingContextStatus(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaim_To_resource_ResourceClaim(in *v1alpha2.ResourceClaim, out *resource.ResourceClaim, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha2_ResourceClaimStatus_To_resource_ResourceClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ResourceClaim_To_resource_ResourceClaim is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaim_To_resource_ResourceClaim(in *v1alpha2.ResourceClaim, out *resource.ResourceClaim, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaim_To_resource_ResourceClaim(in, out, s) -} - -func autoConvert_resource_ResourceClaim_To_v1alpha2_ResourceClaim(in *resource.ResourceClaim, out *v1alpha2.ResourceClaim, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_resource_ResourceClaimStatus_To_v1alpha2_ResourceClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_resource_ResourceClaim_To_v1alpha2_ResourceClaim is an autogenerated conversion function. -func Convert_resource_ResourceClaim_To_v1alpha2_ResourceClaim(in *resource.ResourceClaim, out *v1alpha2.ResourceClaim, s conversion.Scope) error { - return autoConvert_resource_ResourceClaim_To_v1alpha2_ResourceClaim(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(in *v1alpha2.ResourceClaimConsumerReference, out *resource.ResourceClaimConsumerReference, s conversion.Scope) error { - out.APIGroup = in.APIGroup - out.Resource = in.Resource - out.Name = in.Name - out.UID = types.UID(in.UID) - return nil -} - -// Convert_v1alpha2_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(in *v1alpha2.ResourceClaimConsumerReference, out *resource.ResourceClaimConsumerReference, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(in, out, s) -} - -func autoConvert_resource_ResourceClaimConsumerReference_To_v1alpha2_ResourceClaimConsumerReference(in *resource.ResourceClaimConsumerReference, out *v1alpha2.ResourceClaimConsumerReference, s conversion.Scope) error { - out.APIGroup = in.APIGroup - out.Resource = in.Resource - out.Name = in.Name - out.UID = types.UID(in.UID) - return nil -} - -// Convert_resource_ResourceClaimConsumerReference_To_v1alpha2_ResourceClaimConsumerReference is an autogenerated conversion function. -func Convert_resource_ResourceClaimConsumerReference_To_v1alpha2_ResourceClaimConsumerReference(in *resource.ResourceClaimConsumerReference, out *v1alpha2.ResourceClaimConsumerReference, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimConsumerReference_To_v1alpha2_ResourceClaimConsumerReference(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimList_To_resource_ResourceClaimList(in *v1alpha2.ResourceClaimList, out *resource.ResourceClaimList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]resource.ResourceClaim, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_ResourceClaim_To_resource_ResourceClaim(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha2_ResourceClaimList_To_resource_ResourceClaimList is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimList_To_resource_ResourceClaimList(in *v1alpha2.ResourceClaimList, out *resource.ResourceClaimList, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimList_To_resource_ResourceClaimList(in, out, s) -} - -func autoConvert_resource_ResourceClaimList_To_v1alpha2_ResourceClaimList(in *resource.ResourceClaimList, out *v1alpha2.ResourceClaimList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1alpha2.ResourceClaim, len(*in)) - for i := range *in { - if err := Convert_resource_ResourceClaim_To_v1alpha2_ResourceClaim(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_resource_ResourceClaimList_To_v1alpha2_ResourceClaimList is an autogenerated conversion function. -func Convert_resource_ResourceClaimList_To_v1alpha2_ResourceClaimList(in *resource.ResourceClaimList, out *v1alpha2.ResourceClaimList, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimList_To_v1alpha2_ResourceClaimList(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimParameters_To_resource_ResourceClaimParameters(in *v1alpha2.ResourceClaimParameters, out *resource.ResourceClaimParameters, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.GeneratedFrom = (*resource.ResourceClaimParametersReference)(unsafe.Pointer(in.GeneratedFrom)) - out.Shareable = in.Shareable - if in.DriverRequests != nil { - in, out := &in.DriverRequests, &out.DriverRequests - *out = make([]resource.DriverRequests, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_DriverRequests_To_resource_DriverRequests(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.DriverRequests = nil - } - return nil -} - -// Convert_v1alpha2_ResourceClaimParameters_To_resource_ResourceClaimParameters is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimParameters_To_resource_ResourceClaimParameters(in *v1alpha2.ResourceClaimParameters, out *resource.ResourceClaimParameters, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimParameters_To_resource_ResourceClaimParameters(in, out, s) -} - -func autoConvert_resource_ResourceClaimParameters_To_v1alpha2_ResourceClaimParameters(in *resource.ResourceClaimParameters, out *v1alpha2.ResourceClaimParameters, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.GeneratedFrom = (*v1alpha2.ResourceClaimParametersReference)(unsafe.Pointer(in.GeneratedFrom)) - out.Shareable = in.Shareable - if in.DriverRequests != nil { - in, out := &in.DriverRequests, &out.DriverRequests - *out = make([]v1alpha2.DriverRequests, len(*in)) - for i := range *in { - if err := Convert_resource_DriverRequests_To_v1alpha2_DriverRequests(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.DriverRequests = nil - } - return nil -} - -// Convert_resource_ResourceClaimParameters_To_v1alpha2_ResourceClaimParameters is an autogenerated conversion function. -func Convert_resource_ResourceClaimParameters_To_v1alpha2_ResourceClaimParameters(in *resource.ResourceClaimParameters, out *v1alpha2.ResourceClaimParameters, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimParameters_To_v1alpha2_ResourceClaimParameters(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimParametersList_To_resource_ResourceClaimParametersList(in *v1alpha2.ResourceClaimParametersList, out *resource.ResourceClaimParametersList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]resource.ResourceClaimParameters, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_ResourceClaimParameters_To_resource_ResourceClaimParameters(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha2_ResourceClaimParametersList_To_resource_ResourceClaimParametersList is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimParametersList_To_resource_ResourceClaimParametersList(in *v1alpha2.ResourceClaimParametersList, out *resource.ResourceClaimParametersList, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimParametersList_To_resource_ResourceClaimParametersList(in, out, s) -} - -func autoConvert_resource_ResourceClaimParametersList_To_v1alpha2_ResourceClaimParametersList(in *resource.ResourceClaimParametersList, out *v1alpha2.ResourceClaimParametersList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1alpha2.ResourceClaimParameters, len(*in)) - for i := range *in { - if err := Convert_resource_ResourceClaimParameters_To_v1alpha2_ResourceClaimParameters(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_resource_ResourceClaimParametersList_To_v1alpha2_ResourceClaimParametersList is an autogenerated conversion function. -func Convert_resource_ResourceClaimParametersList_To_v1alpha2_ResourceClaimParametersList(in *resource.ResourceClaimParametersList, out *v1alpha2.ResourceClaimParametersList, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimParametersList_To_v1alpha2_ResourceClaimParametersList(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimParametersReference_To_resource_ResourceClaimParametersReference(in *v1alpha2.ResourceClaimParametersReference, out *resource.ResourceClaimParametersReference, s conversion.Scope) error { - out.APIGroup = in.APIGroup - out.Kind = in.Kind - out.Name = in.Name - return nil -} - -// Convert_v1alpha2_ResourceClaimParametersReference_To_resource_ResourceClaimParametersReference is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimParametersReference_To_resource_ResourceClaimParametersReference(in *v1alpha2.ResourceClaimParametersReference, out *resource.ResourceClaimParametersReference, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimParametersReference_To_resource_ResourceClaimParametersReference(in, out, s) -} - -func autoConvert_resource_ResourceClaimParametersReference_To_v1alpha2_ResourceClaimParametersReference(in *resource.ResourceClaimParametersReference, out *v1alpha2.ResourceClaimParametersReference, s conversion.Scope) error { - out.APIGroup = in.APIGroup - out.Kind = in.Kind - out.Name = in.Name - return nil -} - -// Convert_resource_ResourceClaimParametersReference_To_v1alpha2_ResourceClaimParametersReference is an autogenerated conversion function. -func Convert_resource_ResourceClaimParametersReference_To_v1alpha2_ResourceClaimParametersReference(in *resource.ResourceClaimParametersReference, out *v1alpha2.ResourceClaimParametersReference, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimParametersReference_To_v1alpha2_ResourceClaimParametersReference(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(in *v1alpha2.ResourceClaimSchedulingStatus, out *resource.ResourceClaimSchedulingStatus, s conversion.Scope) error { - out.Name = in.Name - out.UnsuitableNodes = *(*[]string)(unsafe.Pointer(&in.UnsuitableNodes)) - return nil -} - -// Convert_v1alpha2_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(in *v1alpha2.ResourceClaimSchedulingStatus, out *resource.ResourceClaimSchedulingStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(in, out, s) -} - -func autoConvert_resource_ResourceClaimSchedulingStatus_To_v1alpha2_ResourceClaimSchedulingStatus(in *resource.ResourceClaimSchedulingStatus, out *v1alpha2.ResourceClaimSchedulingStatus, s conversion.Scope) error { - out.Name = in.Name - out.UnsuitableNodes = *(*[]string)(unsafe.Pointer(&in.UnsuitableNodes)) - return nil -} - -// Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha2_ResourceClaimSchedulingStatus is an autogenerated conversion function. -func Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha2_ResourceClaimSchedulingStatus(in *resource.ResourceClaimSchedulingStatus, out *v1alpha2.ResourceClaimSchedulingStatus, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimSchedulingStatus_To_v1alpha2_ResourceClaimSchedulingStatus(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec(in *v1alpha2.ResourceClaimSpec, out *resource.ResourceClaimSpec, s conversion.Scope) error { - out.ResourceClassName = in.ResourceClassName - out.ParametersRef = (*resource.ResourceClaimParametersReference)(unsafe.Pointer(in.ParametersRef)) - out.AllocationMode = resource.AllocationMode(in.AllocationMode) - return nil -} - -// Convert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec(in *v1alpha2.ResourceClaimSpec, out *resource.ResourceClaimSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec(in, out, s) -} - -func autoConvert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec(in *resource.ResourceClaimSpec, out *v1alpha2.ResourceClaimSpec, s conversion.Scope) error { - out.ResourceClassName = in.ResourceClassName - out.ParametersRef = (*v1alpha2.ResourceClaimParametersReference)(unsafe.Pointer(in.ParametersRef)) - out.AllocationMode = v1alpha2.AllocationMode(in.AllocationMode) - return nil -} - -// Convert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec is an autogenerated conversion function. -func Convert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec(in *resource.ResourceClaimSpec, out *v1alpha2.ResourceClaimSpec, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimStatus_To_resource_ResourceClaimStatus(in *v1alpha2.ResourceClaimStatus, out *resource.ResourceClaimStatus, s conversion.Scope) error { - out.DriverName = in.DriverName - if in.Allocation != nil { - in, out := &in.Allocation, &out.Allocation - *out = new(resource.AllocationResult) - if err := Convert_v1alpha2_AllocationResult_To_resource_AllocationResult(*in, *out, s); err != nil { - return err - } - } else { - out.Allocation = nil - } - out.ReservedFor = *(*[]resource.ResourceClaimConsumerReference)(unsafe.Pointer(&in.ReservedFor)) - out.DeallocationRequested = in.DeallocationRequested - return nil -} - -// Convert_v1alpha2_ResourceClaimStatus_To_resource_ResourceClaimStatus is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimStatus_To_resource_ResourceClaimStatus(in *v1alpha2.ResourceClaimStatus, out *resource.ResourceClaimStatus, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimStatus_To_resource_ResourceClaimStatus(in, out, s) -} - -func autoConvert_resource_ResourceClaimStatus_To_v1alpha2_ResourceClaimStatus(in *resource.ResourceClaimStatus, out *v1alpha2.ResourceClaimStatus, s conversion.Scope) error { - out.DriverName = in.DriverName - if in.Allocation != nil { - in, out := &in.Allocation, &out.Allocation - *out = new(v1alpha2.AllocationResult) - if err := Convert_resource_AllocationResult_To_v1alpha2_AllocationResult(*in, *out, s); err != nil { - return err - } - } else { - out.Allocation = nil - } - out.ReservedFor = *(*[]v1alpha2.ResourceClaimConsumerReference)(unsafe.Pointer(&in.ReservedFor)) - out.DeallocationRequested = in.DeallocationRequested - return nil -} - -// Convert_resource_ResourceClaimStatus_To_v1alpha2_ResourceClaimStatus is an autogenerated conversion function. -func Convert_resource_ResourceClaimStatus_To_v1alpha2_ResourceClaimStatus(in *resource.ResourceClaimStatus, out *v1alpha2.ResourceClaimStatus, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimStatus_To_v1alpha2_ResourceClaimStatus(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(in *v1alpha2.ResourceClaimTemplate, out *resource.ResourceClaimTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ResourceClaimTemplate_To_resource_ResourceClaimTemplate is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(in *v1alpha2.ResourceClaimTemplate, out *resource.ResourceClaimTemplate, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(in, out, s) -} - -func autoConvert_resource_ResourceClaimTemplate_To_v1alpha2_ResourceClaimTemplate(in *resource.ResourceClaimTemplate, out *v1alpha2.ResourceClaimTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_resource_ResourceClaimTemplateSpec_To_v1alpha2_ResourceClaimTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_resource_ResourceClaimTemplate_To_v1alpha2_ResourceClaimTemplate is an autogenerated conversion function. -func Convert_resource_ResourceClaimTemplate_To_v1alpha2_ResourceClaimTemplate(in *resource.ResourceClaimTemplate, out *v1alpha2.ResourceClaimTemplate, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimTemplate_To_v1alpha2_ResourceClaimTemplate(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(in *v1alpha2.ResourceClaimTemplateList, out *resource.ResourceClaimTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]resource.ResourceClaimTemplate)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha2_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(in *v1alpha2.ResourceClaimTemplateList, out *resource.ResourceClaimTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(in, out, s) -} - -func autoConvert_resource_ResourceClaimTemplateList_To_v1alpha2_ResourceClaimTemplateList(in *resource.ResourceClaimTemplateList, out *v1alpha2.ResourceClaimTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha2.ResourceClaimTemplate)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_resource_ResourceClaimTemplateList_To_v1alpha2_ResourceClaimTemplateList is an autogenerated conversion function. -func Convert_resource_ResourceClaimTemplateList_To_v1alpha2_ResourceClaimTemplateList(in *resource.ResourceClaimTemplateList, out *v1alpha2.ResourceClaimTemplateList, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimTemplateList_To_v1alpha2_ResourceClaimTemplateList(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(in *v1alpha2.ResourceClaimTemplateSpec, out *resource.ResourceClaimTemplateSpec, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_ResourceClaimSpec_To_resource_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(in *v1alpha2.ResourceClaimTemplateSpec, out *resource.ResourceClaimTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(in, out, s) -} - -func autoConvert_resource_ResourceClaimTemplateSpec_To_v1alpha2_ResourceClaimTemplateSpec(in *resource.ResourceClaimTemplateSpec, out *v1alpha2.ResourceClaimTemplateSpec, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_resource_ResourceClaimSpec_To_v1alpha2_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_resource_ResourceClaimTemplateSpec_To_v1alpha2_ResourceClaimTemplateSpec is an autogenerated conversion function. -func Convert_resource_ResourceClaimTemplateSpec_To_v1alpha2_ResourceClaimTemplateSpec(in *resource.ResourceClaimTemplateSpec, out *v1alpha2.ResourceClaimTemplateSpec, s conversion.Scope) error { - return autoConvert_resource_ResourceClaimTemplateSpec_To_v1alpha2_ResourceClaimTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClass_To_resource_ResourceClass(in *v1alpha2.ResourceClass, out *resource.ResourceClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.DriverName = in.DriverName - out.ParametersRef = (*resource.ResourceClassParametersReference)(unsafe.Pointer(in.ParametersRef)) - out.SuitableNodes = (*core.NodeSelector)(unsafe.Pointer(in.SuitableNodes)) - out.StructuredParameters = (*bool)(unsafe.Pointer(in.StructuredParameters)) - return nil -} - -// Convert_v1alpha2_ResourceClass_To_resource_ResourceClass is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClass_To_resource_ResourceClass(in *v1alpha2.ResourceClass, out *resource.ResourceClass, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClass_To_resource_ResourceClass(in, out, s) -} - -func autoConvert_resource_ResourceClass_To_v1alpha2_ResourceClass(in *resource.ResourceClass, out *v1alpha2.ResourceClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.DriverName = in.DriverName - out.ParametersRef = (*v1alpha2.ResourceClassParametersReference)(unsafe.Pointer(in.ParametersRef)) - out.SuitableNodes = (*v1.NodeSelector)(unsafe.Pointer(in.SuitableNodes)) - out.StructuredParameters = (*bool)(unsafe.Pointer(in.StructuredParameters)) - return nil -} - -// Convert_resource_ResourceClass_To_v1alpha2_ResourceClass is an autogenerated conversion function. -func Convert_resource_ResourceClass_To_v1alpha2_ResourceClass(in *resource.ResourceClass, out *v1alpha2.ResourceClass, s conversion.Scope) error { - return autoConvert_resource_ResourceClass_To_v1alpha2_ResourceClass(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClassList_To_resource_ResourceClassList(in *v1alpha2.ResourceClassList, out *resource.ResourceClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]resource.ResourceClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha2_ResourceClassList_To_resource_ResourceClassList is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClassList_To_resource_ResourceClassList(in *v1alpha2.ResourceClassList, out *resource.ResourceClassList, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClassList_To_resource_ResourceClassList(in, out, s) -} - -func autoConvert_resource_ResourceClassList_To_v1alpha2_ResourceClassList(in *resource.ResourceClassList, out *v1alpha2.ResourceClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha2.ResourceClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_resource_ResourceClassList_To_v1alpha2_ResourceClassList is an autogenerated conversion function. -func Convert_resource_ResourceClassList_To_v1alpha2_ResourceClassList(in *resource.ResourceClassList, out *v1alpha2.ResourceClassList, s conversion.Scope) error { - return autoConvert_resource_ResourceClassList_To_v1alpha2_ResourceClassList(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClassParameters_To_resource_ResourceClassParameters(in *v1alpha2.ResourceClassParameters, out *resource.ResourceClassParameters, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.GeneratedFrom = (*resource.ResourceClassParametersReference)(unsafe.Pointer(in.GeneratedFrom)) - if in.VendorParameters != nil { - in, out := &in.VendorParameters, &out.VendorParameters - *out = make([]resource.VendorParameters, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_VendorParameters_To_resource_VendorParameters(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VendorParameters = nil - } - out.Filters = *(*[]resource.ResourceFilter)(unsafe.Pointer(&in.Filters)) - return nil -} - -// Convert_v1alpha2_ResourceClassParameters_To_resource_ResourceClassParameters is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClassParameters_To_resource_ResourceClassParameters(in *v1alpha2.ResourceClassParameters, out *resource.ResourceClassParameters, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClassParameters_To_resource_ResourceClassParameters(in, out, s) -} - -func autoConvert_resource_ResourceClassParameters_To_v1alpha2_ResourceClassParameters(in *resource.ResourceClassParameters, out *v1alpha2.ResourceClassParameters, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.GeneratedFrom = (*v1alpha2.ResourceClassParametersReference)(unsafe.Pointer(in.GeneratedFrom)) - if in.VendorParameters != nil { - in, out := &in.VendorParameters, &out.VendorParameters - *out = make([]v1alpha2.VendorParameters, len(*in)) - for i := range *in { - if err := Convert_resource_VendorParameters_To_v1alpha2_VendorParameters(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VendorParameters = nil - } - out.Filters = *(*[]v1alpha2.ResourceFilter)(unsafe.Pointer(&in.Filters)) - return nil -} - -// Convert_resource_ResourceClassParameters_To_v1alpha2_ResourceClassParameters is an autogenerated conversion function. -func Convert_resource_ResourceClassParameters_To_v1alpha2_ResourceClassParameters(in *resource.ResourceClassParameters, out *v1alpha2.ResourceClassParameters, s conversion.Scope) error { - return autoConvert_resource_ResourceClassParameters_To_v1alpha2_ResourceClassParameters(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClassParametersList_To_resource_ResourceClassParametersList(in *v1alpha2.ResourceClassParametersList, out *resource.ResourceClassParametersList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]resource.ResourceClassParameters, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_ResourceClassParameters_To_resource_ResourceClassParameters(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha2_ResourceClassParametersList_To_resource_ResourceClassParametersList is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClassParametersList_To_resource_ResourceClassParametersList(in *v1alpha2.ResourceClassParametersList, out *resource.ResourceClassParametersList, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClassParametersList_To_resource_ResourceClassParametersList(in, out, s) -} - -func autoConvert_resource_ResourceClassParametersList_To_v1alpha2_ResourceClassParametersList(in *resource.ResourceClassParametersList, out *v1alpha2.ResourceClassParametersList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1alpha2.ResourceClassParameters, len(*in)) - for i := range *in { - if err := Convert_resource_ResourceClassParameters_To_v1alpha2_ResourceClassParameters(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_resource_ResourceClassParametersList_To_v1alpha2_ResourceClassParametersList is an autogenerated conversion function. -func Convert_resource_ResourceClassParametersList_To_v1alpha2_ResourceClassParametersList(in *resource.ResourceClassParametersList, out *v1alpha2.ResourceClassParametersList, s conversion.Scope) error { - return autoConvert_resource_ResourceClassParametersList_To_v1alpha2_ResourceClassParametersList(in, out, s) -} - -func autoConvert_v1alpha2_ResourceClassParametersReference_To_resource_ResourceClassParametersReference(in *v1alpha2.ResourceClassParametersReference, out *resource.ResourceClassParametersReference, s conversion.Scope) error { - out.APIGroup = in.APIGroup - out.Kind = in.Kind - out.Name = in.Name - out.Namespace = in.Namespace - return nil -} - -// Convert_v1alpha2_ResourceClassParametersReference_To_resource_ResourceClassParametersReference is an autogenerated conversion function. -func Convert_v1alpha2_ResourceClassParametersReference_To_resource_ResourceClassParametersReference(in *v1alpha2.ResourceClassParametersReference, out *resource.ResourceClassParametersReference, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceClassParametersReference_To_resource_ResourceClassParametersReference(in, out, s) -} - -func autoConvert_resource_ResourceClassParametersReference_To_v1alpha2_ResourceClassParametersReference(in *resource.ResourceClassParametersReference, out *v1alpha2.ResourceClassParametersReference, s conversion.Scope) error { - out.APIGroup = in.APIGroup - out.Kind = in.Kind - out.Name = in.Name - out.Namespace = in.Namespace - return nil -} - -// Convert_resource_ResourceClassParametersReference_To_v1alpha2_ResourceClassParametersReference is an autogenerated conversion function. -func Convert_resource_ResourceClassParametersReference_To_v1alpha2_ResourceClassParametersReference(in *resource.ResourceClassParametersReference, out *v1alpha2.ResourceClassParametersReference, s conversion.Scope) error { - return autoConvert_resource_ResourceClassParametersReference_To_v1alpha2_ResourceClassParametersReference(in, out, s) -} - -func autoConvert_v1alpha2_ResourceFilter_To_resource_ResourceFilter(in *v1alpha2.ResourceFilter, out *resource.ResourceFilter, s conversion.Scope) error { - out.DriverName = in.DriverName - if err := Convert_v1alpha2_ResourceFilterModel_To_resource_ResourceFilterModel(&in.ResourceFilterModel, &out.ResourceFilterModel, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ResourceFilter_To_resource_ResourceFilter is an autogenerated conversion function. -func Convert_v1alpha2_ResourceFilter_To_resource_ResourceFilter(in *v1alpha2.ResourceFilter, out *resource.ResourceFilter, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceFilter_To_resource_ResourceFilter(in, out, s) -} - -func autoConvert_resource_ResourceFilter_To_v1alpha2_ResourceFilter(in *resource.ResourceFilter, out *v1alpha2.ResourceFilter, s conversion.Scope) error { - out.DriverName = in.DriverName - if err := Convert_resource_ResourceFilterModel_To_v1alpha2_ResourceFilterModel(&in.ResourceFilterModel, &out.ResourceFilterModel, s); err != nil { - return err - } - return nil -} - -// Convert_resource_ResourceFilter_To_v1alpha2_ResourceFilter is an autogenerated conversion function. -func Convert_resource_ResourceFilter_To_v1alpha2_ResourceFilter(in *resource.ResourceFilter, out *v1alpha2.ResourceFilter, s conversion.Scope) error { - return autoConvert_resource_ResourceFilter_To_v1alpha2_ResourceFilter(in, out, s) -} - -func autoConvert_v1alpha2_ResourceFilterModel_To_resource_ResourceFilterModel(in *v1alpha2.ResourceFilterModel, out *resource.ResourceFilterModel, s conversion.Scope) error { - out.NamedResources = (*resource.NamedResourcesFilter)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_v1alpha2_ResourceFilterModel_To_resource_ResourceFilterModel is an autogenerated conversion function. -func Convert_v1alpha2_ResourceFilterModel_To_resource_ResourceFilterModel(in *v1alpha2.ResourceFilterModel, out *resource.ResourceFilterModel, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceFilterModel_To_resource_ResourceFilterModel(in, out, s) -} - -func autoConvert_resource_ResourceFilterModel_To_v1alpha2_ResourceFilterModel(in *resource.ResourceFilterModel, out *v1alpha2.ResourceFilterModel, s conversion.Scope) error { - out.NamedResources = (*v1alpha2.NamedResourcesFilter)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_resource_ResourceFilterModel_To_v1alpha2_ResourceFilterModel is an autogenerated conversion function. -func Convert_resource_ResourceFilterModel_To_v1alpha2_ResourceFilterModel(in *resource.ResourceFilterModel, out *v1alpha2.ResourceFilterModel, s conversion.Scope) error { - return autoConvert_resource_ResourceFilterModel_To_v1alpha2_ResourceFilterModel(in, out, s) -} - -func autoConvert_v1alpha2_ResourceHandle_To_resource_ResourceHandle(in *v1alpha2.ResourceHandle, out *resource.ResourceHandle, s conversion.Scope) error { - out.DriverName = in.DriverName - out.Data = in.Data - if in.StructuredData != nil { - in, out := &in.StructuredData, &out.StructuredData - *out = new(resource.StructuredResourceHandle) - if err := Convert_v1alpha2_StructuredResourceHandle_To_resource_StructuredResourceHandle(*in, *out, s); err != nil { - return err - } - } else { - out.StructuredData = nil - } - return nil -} - -// Convert_v1alpha2_ResourceHandle_To_resource_ResourceHandle is an autogenerated conversion function. -func Convert_v1alpha2_ResourceHandle_To_resource_ResourceHandle(in *v1alpha2.ResourceHandle, out *resource.ResourceHandle, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceHandle_To_resource_ResourceHandle(in, out, s) -} - -func autoConvert_resource_ResourceHandle_To_v1alpha2_ResourceHandle(in *resource.ResourceHandle, out *v1alpha2.ResourceHandle, s conversion.Scope) error { - out.DriverName = in.DriverName - out.Data = in.Data - if in.StructuredData != nil { - in, out := &in.StructuredData, &out.StructuredData - *out = new(v1alpha2.StructuredResourceHandle) - if err := Convert_resource_StructuredResourceHandle_To_v1alpha2_StructuredResourceHandle(*in, *out, s); err != nil { - return err - } - } else { - out.StructuredData = nil - } - return nil -} - -// Convert_resource_ResourceHandle_To_v1alpha2_ResourceHandle is an autogenerated conversion function. -func Convert_resource_ResourceHandle_To_v1alpha2_ResourceHandle(in *resource.ResourceHandle, out *v1alpha2.ResourceHandle, s conversion.Scope) error { - return autoConvert_resource_ResourceHandle_To_v1alpha2_ResourceHandle(in, out, s) -} - -func autoConvert_v1alpha2_ResourceModel_To_resource_ResourceModel(in *v1alpha2.ResourceModel, out *resource.ResourceModel, s conversion.Scope) error { - out.NamedResources = (*resource.NamedResourcesResources)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_v1alpha2_ResourceModel_To_resource_ResourceModel is an autogenerated conversion function. -func Convert_v1alpha2_ResourceModel_To_resource_ResourceModel(in *v1alpha2.ResourceModel, out *resource.ResourceModel, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceModel_To_resource_ResourceModel(in, out, s) -} - -func autoConvert_resource_ResourceModel_To_v1alpha2_ResourceModel(in *resource.ResourceModel, out *v1alpha2.ResourceModel, s conversion.Scope) error { - out.NamedResources = (*v1alpha2.NamedResourcesResources)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_resource_ResourceModel_To_v1alpha2_ResourceModel is an autogenerated conversion function. -func Convert_resource_ResourceModel_To_v1alpha2_ResourceModel(in *resource.ResourceModel, out *v1alpha2.ResourceModel, s conversion.Scope) error { - return autoConvert_resource_ResourceModel_To_v1alpha2_ResourceModel(in, out, s) -} - -func autoConvert_v1alpha2_ResourceRequest_To_resource_ResourceRequest(in *v1alpha2.ResourceRequest, out *resource.ResourceRequest, s conversion.Scope) error { - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.VendorParameters, &out.VendorParameters, s); err != nil { - return err - } - if err := Convert_v1alpha2_ResourceRequestModel_To_resource_ResourceRequestModel(&in.ResourceRequestModel, &out.ResourceRequestModel, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ResourceRequest_To_resource_ResourceRequest is an autogenerated conversion function. -func Convert_v1alpha2_ResourceRequest_To_resource_ResourceRequest(in *v1alpha2.ResourceRequest, out *resource.ResourceRequest, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceRequest_To_resource_ResourceRequest(in, out, s) -} - -func autoConvert_resource_ResourceRequest_To_v1alpha2_ResourceRequest(in *resource.ResourceRequest, out *v1alpha2.ResourceRequest, s conversion.Scope) error { - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.VendorParameters, &out.VendorParameters, s); err != nil { - return err - } - if err := Convert_resource_ResourceRequestModel_To_v1alpha2_ResourceRequestModel(&in.ResourceRequestModel, &out.ResourceRequestModel, s); err != nil { - return err - } - return nil -} - -// Convert_resource_ResourceRequest_To_v1alpha2_ResourceRequest is an autogenerated conversion function. -func Convert_resource_ResourceRequest_To_v1alpha2_ResourceRequest(in *resource.ResourceRequest, out *v1alpha2.ResourceRequest, s conversion.Scope) error { - return autoConvert_resource_ResourceRequest_To_v1alpha2_ResourceRequest(in, out, s) -} - -func autoConvert_v1alpha2_ResourceRequestModel_To_resource_ResourceRequestModel(in *v1alpha2.ResourceRequestModel, out *resource.ResourceRequestModel, s conversion.Scope) error { - out.NamedResources = (*resource.NamedResourcesRequest)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_v1alpha2_ResourceRequestModel_To_resource_ResourceRequestModel is an autogenerated conversion function. -func Convert_v1alpha2_ResourceRequestModel_To_resource_ResourceRequestModel(in *v1alpha2.ResourceRequestModel, out *resource.ResourceRequestModel, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceRequestModel_To_resource_ResourceRequestModel(in, out, s) -} - -func autoConvert_resource_ResourceRequestModel_To_v1alpha2_ResourceRequestModel(in *resource.ResourceRequestModel, out *v1alpha2.ResourceRequestModel, s conversion.Scope) error { - out.NamedResources = (*v1alpha2.NamedResourcesRequest)(unsafe.Pointer(in.NamedResources)) - return nil -} - -// Convert_resource_ResourceRequestModel_To_v1alpha2_ResourceRequestModel is an autogenerated conversion function. -func Convert_resource_ResourceRequestModel_To_v1alpha2_ResourceRequestModel(in *resource.ResourceRequestModel, out *v1alpha2.ResourceRequestModel, s conversion.Scope) error { - return autoConvert_resource_ResourceRequestModel_To_v1alpha2_ResourceRequestModel(in, out, s) -} - -func autoConvert_v1alpha2_ResourceSlice_To_resource_ResourceSlice(in *v1alpha2.ResourceSlice, out *resource.ResourceSlice, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.NodeName = in.NodeName - out.DriverName = in.DriverName - if err := Convert_v1alpha2_ResourceModel_To_resource_ResourceModel(&in.ResourceModel, &out.ResourceModel, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_ResourceSlice_To_resource_ResourceSlice is an autogenerated conversion function. -func Convert_v1alpha2_ResourceSlice_To_resource_ResourceSlice(in *v1alpha2.ResourceSlice, out *resource.ResourceSlice, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceSlice_To_resource_ResourceSlice(in, out, s) -} - -func autoConvert_resource_ResourceSlice_To_v1alpha2_ResourceSlice(in *resource.ResourceSlice, out *v1alpha2.ResourceSlice, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.NodeName = in.NodeName - out.DriverName = in.DriverName - if err := Convert_resource_ResourceModel_To_v1alpha2_ResourceModel(&in.ResourceModel, &out.ResourceModel, s); err != nil { - return err - } - return nil -} - -// Convert_resource_ResourceSlice_To_v1alpha2_ResourceSlice is an autogenerated conversion function. -func Convert_resource_ResourceSlice_To_v1alpha2_ResourceSlice(in *resource.ResourceSlice, out *v1alpha2.ResourceSlice, s conversion.Scope) error { - return autoConvert_resource_ResourceSlice_To_v1alpha2_ResourceSlice(in, out, s) -} - -func autoConvert_v1alpha2_ResourceSliceList_To_resource_ResourceSliceList(in *v1alpha2.ResourceSliceList, out *resource.ResourceSliceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]resource.ResourceSlice)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha2_ResourceSliceList_To_resource_ResourceSliceList is an autogenerated conversion function. -func Convert_v1alpha2_ResourceSliceList_To_resource_ResourceSliceList(in *v1alpha2.ResourceSliceList, out *resource.ResourceSliceList, s conversion.Scope) error { - return autoConvert_v1alpha2_ResourceSliceList_To_resource_ResourceSliceList(in, out, s) -} - -func autoConvert_resource_ResourceSliceList_To_v1alpha2_ResourceSliceList(in *resource.ResourceSliceList, out *v1alpha2.ResourceSliceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha2.ResourceSlice)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_resource_ResourceSliceList_To_v1alpha2_ResourceSliceList is an autogenerated conversion function. -func Convert_resource_ResourceSliceList_To_v1alpha2_ResourceSliceList(in *resource.ResourceSliceList, out *v1alpha2.ResourceSliceList, s conversion.Scope) error { - return autoConvert_resource_ResourceSliceList_To_v1alpha2_ResourceSliceList(in, out, s) -} - -func autoConvert_v1alpha2_StructuredResourceHandle_To_resource_StructuredResourceHandle(in *v1alpha2.StructuredResourceHandle, out *resource.StructuredResourceHandle, s conversion.Scope) error { - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.VendorClassParameters, &out.VendorClassParameters, s); err != nil { - return err - } - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.VendorClaimParameters, &out.VendorClaimParameters, s); err != nil { - return err - } - out.NodeName = in.NodeName - if in.Results != nil { - in, out := &in.Results, &out.Results - *out = make([]resource.DriverAllocationResult, len(*in)) - for i := range *in { - if err := Convert_v1alpha2_DriverAllocationResult_To_resource_DriverAllocationResult(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Results = nil - } - return nil -} - -// Convert_v1alpha2_StructuredResourceHandle_To_resource_StructuredResourceHandle is an autogenerated conversion function. -func Convert_v1alpha2_StructuredResourceHandle_To_resource_StructuredResourceHandle(in *v1alpha2.StructuredResourceHandle, out *resource.StructuredResourceHandle, s conversion.Scope) error { - return autoConvert_v1alpha2_StructuredResourceHandle_To_resource_StructuredResourceHandle(in, out, s) -} - -func autoConvert_resource_StructuredResourceHandle_To_v1alpha2_StructuredResourceHandle(in *resource.StructuredResourceHandle, out *v1alpha2.StructuredResourceHandle, s conversion.Scope) error { - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.VendorClassParameters, &out.VendorClassParameters, s); err != nil { - return err - } - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.VendorClaimParameters, &out.VendorClaimParameters, s); err != nil { - return err - } - out.NodeName = in.NodeName - if in.Results != nil { - in, out := &in.Results, &out.Results - *out = make([]v1alpha2.DriverAllocationResult, len(*in)) - for i := range *in { - if err := Convert_resource_DriverAllocationResult_To_v1alpha2_DriverAllocationResult(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Results = nil - } - return nil -} - -// Convert_resource_StructuredResourceHandle_To_v1alpha2_StructuredResourceHandle is an autogenerated conversion function. -func Convert_resource_StructuredResourceHandle_To_v1alpha2_StructuredResourceHandle(in *resource.StructuredResourceHandle, out *v1alpha2.StructuredResourceHandle, s conversion.Scope) error { - return autoConvert_resource_StructuredResourceHandle_To_v1alpha2_StructuredResourceHandle(in, out, s) -} - -func autoConvert_v1alpha2_VendorParameters_To_resource_VendorParameters(in *v1alpha2.VendorParameters, out *resource.VendorParameters, s conversion.Scope) error { - out.DriverName = in.DriverName - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Parameters, &out.Parameters, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha2_VendorParameters_To_resource_VendorParameters is an autogenerated conversion function. -func Convert_v1alpha2_VendorParameters_To_resource_VendorParameters(in *v1alpha2.VendorParameters, out *resource.VendorParameters, s conversion.Scope) error { - return autoConvert_v1alpha2_VendorParameters_To_resource_VendorParameters(in, out, s) -} - -func autoConvert_resource_VendorParameters_To_v1alpha2_VendorParameters(in *resource.VendorParameters, out *v1alpha2.VendorParameters, s conversion.Scope) error { - out.DriverName = in.DriverName - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Parameters, &out.Parameters, s); err != nil { - return err - } - return nil -} - -// Convert_resource_VendorParameters_To_v1alpha2_VendorParameters is an autogenerated conversion function. -func Convert_resource_VendorParameters_To_v1alpha2_VendorParameters(in *resource.VendorParameters, out *v1alpha2.VendorParameters, s conversion.Scope) error { - return autoConvert_resource_VendorParameters_To_v1alpha2_VendorParameters(in, out, s) -} diff --git a/pkg/apis/resource/v1alpha2/conversion.go b/pkg/apis/resource/v1alpha3/conversion.go similarity index 86% rename from pkg/apis/resource/v1alpha2/conversion.go rename to pkg/apis/resource/v1alpha3/conversion.go index 456a8b243e117..237ea36713005 100644 --- a/pkg/apis/resource/v1alpha2/conversion.go +++ b/pkg/apis/resource/v1alpha3/conversion.go @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha3 import ( "fmt" + resourceapi "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/runtime" ) @@ -26,7 +27,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error { if err := scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("ResourceSlice"), func(label, value string) (string, string, error) { switch label { - case "metadata.name", "nodeName", "driverName": + case "metadata.name", resourceapi.ResourceSliceSelectorNodeName, resourceapi.ResourceSliceSelectorDriver: return label, value, nil default: return "", "", fmt.Errorf("field label not supported for %s: %s", SchemeGroupVersion.WithKind("ResourceSlice"), label) diff --git a/pkg/apis/resource/v1alpha2/defaults.go b/pkg/apis/resource/v1alpha3/defaults.go similarity index 70% rename from pkg/apis/resource/v1alpha2/defaults.go rename to pkg/apis/resource/v1alpha3/defaults.go index a6c681f8bf54d..039f8f11ad37f 100644 --- a/pkg/apis/resource/v1alpha2/defaults.go +++ b/pkg/apis/resource/v1alpha3/defaults.go @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha3 import ( - "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/runtime" ) @@ -25,8 +25,12 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error { return RegisterDefaults(scheme) } -func SetDefaults_ResourceClaimSpec(obj *v1alpha2.ResourceClaimSpec) { - if obj.AllocationMode == "" { - obj.AllocationMode = v1alpha2.AllocationModeWaitForFirstConsumer +func SetDefaults_DeviceRequest(obj *resourceapi.DeviceRequest) { + if obj.CountMode == "" { + obj.CountMode = resourceapi.DeviceCountModeExact + } + + if obj.CountMode == resourceapi.DeviceCountModeExact && obj.Count == 0 { + obj.Count = 1 } } diff --git a/pkg/apis/resource/v1alpha2/doc.go b/pkg/apis/resource/v1alpha3/doc.go similarity index 78% rename from pkg/apis/resource/v1alpha2/doc.go rename to pkg/apis/resource/v1alpha3/doc.go index 442bddf8e0f48..9538510c7ba56 100644 --- a/pkg/apis/resource/v1alpha2/doc.go +++ b/pkg/apis/resource/v1alpha3/doc.go @@ -15,9 +15,9 @@ limitations under the License. */ // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/resource -// +k8s:conversion-gen-external-types=k8s.io/api/resource/v1alpha2 +// +k8s:conversion-gen-external-types=k8s.io/api/resource/v1alpha3 // +k8s:defaulter-gen=TypeMeta -// +k8s:defaulter-gen-input=k8s.io/api/resource/v1alpha2 +// +k8s:defaulter-gen-input=k8s.io/api/resource/v1alpha3 -// Package v1alpha2 is the v1alpha2 version of the resource API. -package v1alpha2 // import "k8s.io/kubernetes/pkg/apis/resource/v1alpha2" +// Package v1alpha3 is the v1alpha3 version of the resource API. +package v1alpha3 // import "k8s.io/kubernetes/pkg/apis/resource/v1alpha3" diff --git a/pkg/apis/resource/v1alpha2/register.go b/pkg/apis/resource/v1alpha3/register.go similarity index 92% rename from pkg/apis/resource/v1alpha2/register.go rename to pkg/apis/resource/v1alpha3/register.go index 403cb75aad7c2..0cf36e3af5afb 100644 --- a/pkg/apis/resource/v1alpha2/register.go +++ b/pkg/apis/resource/v1alpha3/register.go @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha3 import ( - "k8s.io/api/resource/v1alpha2" + "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/runtime/schema" ) var ( - localSchemeBuilder = &v1alpha2.SchemeBuilder + localSchemeBuilder = &v1alpha3.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) @@ -38,7 +38,7 @@ func init() { const GroupName = "resource.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { diff --git a/pkg/apis/resource/v1alpha3/zz_generated.conversion.go b/pkg/apis/resource/v1alpha3/zz_generated.conversion.go new file mode 100644 index 0000000000000..7c12e5e0617da --- /dev/null +++ b/pkg/apis/resource/v1alpha3/zz_generated.conversion.go @@ -0,0 +1,1287 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +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 conversion-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + unsafe "unsafe" + + v1 "k8s.io/api/core/v1" + v1alpha3 "k8s.io/api/resource/v1alpha3" + apiresource "k8s.io/apimachinery/pkg/api/resource" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + types "k8s.io/apimachinery/pkg/types" + core "k8s.io/kubernetes/pkg/apis/core" + resource "k8s.io/kubernetes/pkg/apis/resource" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*v1alpha3.AllocationResult)(nil), (*resource.AllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AllocationResult_To_resource_AllocationResult(a.(*v1alpha3.AllocationResult), b.(*resource.AllocationResult), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.AllocationResult)(nil), (*v1alpha3.AllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_AllocationResult_To_v1alpha3_AllocationResult(a.(*resource.AllocationResult), b.(*v1alpha3.AllocationResult), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.BasicDevice)(nil), (*resource.BasicDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_BasicDevice_To_resource_BasicDevice(a.(*v1alpha3.BasicDevice), b.(*resource.BasicDevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.BasicDevice)(nil), (*v1alpha3.BasicDevice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_BasicDevice_To_v1alpha3_BasicDevice(a.(*resource.BasicDevice), b.(*v1alpha3.BasicDevice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.CELDeviceSelector)(nil), (*resource.CELDeviceSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_CELDeviceSelector_To_resource_CELDeviceSelector(a.(*v1alpha3.CELDeviceSelector), b.(*resource.CELDeviceSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.CELDeviceSelector)(nil), (*v1alpha3.CELDeviceSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector(a.(*resource.CELDeviceSelector), b.(*v1alpha3.CELDeviceSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.Device)(nil), (*resource.Device)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Device_To_resource_Device(a.(*v1alpha3.Device), b.(*resource.Device), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.Device)(nil), (*v1alpha3.Device)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_Device_To_v1alpha3_Device(a.(*resource.Device), b.(*v1alpha3.Device), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceAllocationConfiguration)(nil), (*resource.DeviceAllocationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceAllocationConfiguration_To_resource_DeviceAllocationConfiguration(a.(*v1alpha3.DeviceAllocationConfiguration), b.(*resource.DeviceAllocationConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceAllocationConfiguration)(nil), (*v1alpha3.DeviceAllocationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceAllocationConfiguration_To_v1alpha3_DeviceAllocationConfiguration(a.(*resource.DeviceAllocationConfiguration), b.(*v1alpha3.DeviceAllocationConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceAllocationResult)(nil), (*resource.DeviceAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceAllocationResult_To_resource_DeviceAllocationResult(a.(*v1alpha3.DeviceAllocationResult), b.(*resource.DeviceAllocationResult), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceAllocationResult)(nil), (*v1alpha3.DeviceAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceAllocationResult_To_v1alpha3_DeviceAllocationResult(a.(*resource.DeviceAllocationResult), b.(*v1alpha3.DeviceAllocationResult), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceAttribute)(nil), (*resource.DeviceAttribute)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceAttribute_To_resource_DeviceAttribute(a.(*v1alpha3.DeviceAttribute), b.(*resource.DeviceAttribute), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceAttribute)(nil), (*v1alpha3.DeviceAttribute)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceAttribute_To_v1alpha3_DeviceAttribute(a.(*resource.DeviceAttribute), b.(*v1alpha3.DeviceAttribute), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceClaim)(nil), (*resource.DeviceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceClaim_To_resource_DeviceClaim(a.(*v1alpha3.DeviceClaim), b.(*resource.DeviceClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceClaim)(nil), (*v1alpha3.DeviceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceClaim_To_v1alpha3_DeviceClaim(a.(*resource.DeviceClaim), b.(*v1alpha3.DeviceClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceClaimConfiguration)(nil), (*resource.DeviceClaimConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceClaimConfiguration_To_resource_DeviceClaimConfiguration(a.(*v1alpha3.DeviceClaimConfiguration), b.(*resource.DeviceClaimConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceClaimConfiguration)(nil), (*v1alpha3.DeviceClaimConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceClaimConfiguration_To_v1alpha3_DeviceClaimConfiguration(a.(*resource.DeviceClaimConfiguration), b.(*v1alpha3.DeviceClaimConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceClass)(nil), (*resource.DeviceClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceClass_To_resource_DeviceClass(a.(*v1alpha3.DeviceClass), b.(*resource.DeviceClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceClass)(nil), (*v1alpha3.DeviceClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceClass_To_v1alpha3_DeviceClass(a.(*resource.DeviceClass), b.(*v1alpha3.DeviceClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceClassConfiguration)(nil), (*resource.DeviceClassConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceClassConfiguration_To_resource_DeviceClassConfiguration(a.(*v1alpha3.DeviceClassConfiguration), b.(*resource.DeviceClassConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceClassConfiguration)(nil), (*v1alpha3.DeviceClassConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceClassConfiguration_To_v1alpha3_DeviceClassConfiguration(a.(*resource.DeviceClassConfiguration), b.(*v1alpha3.DeviceClassConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceClassList)(nil), (*resource.DeviceClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceClassList_To_resource_DeviceClassList(a.(*v1alpha3.DeviceClassList), b.(*resource.DeviceClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceClassList)(nil), (*v1alpha3.DeviceClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceClassList_To_v1alpha3_DeviceClassList(a.(*resource.DeviceClassList), b.(*v1alpha3.DeviceClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceClassSpec)(nil), (*resource.DeviceClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceClassSpec_To_resource_DeviceClassSpec(a.(*v1alpha3.DeviceClassSpec), b.(*resource.DeviceClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceClassSpec)(nil), (*v1alpha3.DeviceClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceClassSpec_To_v1alpha3_DeviceClassSpec(a.(*resource.DeviceClassSpec), b.(*v1alpha3.DeviceClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceConfiguration)(nil), (*resource.DeviceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(a.(*v1alpha3.DeviceConfiguration), b.(*resource.DeviceConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceConfiguration)(nil), (*v1alpha3.DeviceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(a.(*resource.DeviceConfiguration), b.(*v1alpha3.DeviceConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceConstraint)(nil), (*resource.DeviceConstraint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceConstraint_To_resource_DeviceConstraint(a.(*v1alpha3.DeviceConstraint), b.(*resource.DeviceConstraint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceConstraint)(nil), (*v1alpha3.DeviceConstraint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint(a.(*resource.DeviceConstraint), b.(*v1alpha3.DeviceConstraint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceRequest)(nil), (*resource.DeviceRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceRequest_To_resource_DeviceRequest(a.(*v1alpha3.DeviceRequest), b.(*resource.DeviceRequest), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceRequest)(nil), (*v1alpha3.DeviceRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceRequest_To_v1alpha3_DeviceRequest(a.(*resource.DeviceRequest), b.(*v1alpha3.DeviceRequest), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceRequestAllocationResult)(nil), (*resource.DeviceRequestAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceRequestAllocationResult_To_resource_DeviceRequestAllocationResult(a.(*v1alpha3.DeviceRequestAllocationResult), b.(*resource.DeviceRequestAllocationResult), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceRequestAllocationResult)(nil), (*v1alpha3.DeviceRequestAllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceRequestAllocationResult_To_v1alpha3_DeviceRequestAllocationResult(a.(*resource.DeviceRequestAllocationResult), b.(*v1alpha3.DeviceRequestAllocationResult), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.DeviceSelector)(nil), (*resource.DeviceSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_DeviceSelector_To_resource_DeviceSelector(a.(*v1alpha3.DeviceSelector), b.(*resource.DeviceSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.DeviceSelector)(nil), (*v1alpha3.DeviceSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_DeviceSelector_To_v1alpha3_DeviceSelector(a.(*resource.DeviceSelector), b.(*v1alpha3.DeviceSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.OpaqueDeviceConfiguration)(nil), (*resource.OpaqueDeviceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpaqueDeviceConfiguration_To_resource_OpaqueDeviceConfiguration(a.(*v1alpha3.OpaqueDeviceConfiguration), b.(*resource.OpaqueDeviceConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.OpaqueDeviceConfiguration)(nil), (*v1alpha3.OpaqueDeviceConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_OpaqueDeviceConfiguration_To_v1alpha3_OpaqueDeviceConfiguration(a.(*resource.OpaqueDeviceConfiguration), b.(*v1alpha3.OpaqueDeviceConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.PodSchedulingContext)(nil), (*resource.PodSchedulingContext)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_PodSchedulingContext_To_resource_PodSchedulingContext(a.(*v1alpha3.PodSchedulingContext), b.(*resource.PodSchedulingContext), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContext)(nil), (*v1alpha3.PodSchedulingContext)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_PodSchedulingContext_To_v1alpha3_PodSchedulingContext(a.(*resource.PodSchedulingContext), b.(*v1alpha3.PodSchedulingContext), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.PodSchedulingContextList)(nil), (*resource.PodSchedulingContextList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_PodSchedulingContextList_To_resource_PodSchedulingContextList(a.(*v1alpha3.PodSchedulingContextList), b.(*resource.PodSchedulingContextList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContextList)(nil), (*v1alpha3.PodSchedulingContextList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_PodSchedulingContextList_To_v1alpha3_PodSchedulingContextList(a.(*resource.PodSchedulingContextList), b.(*v1alpha3.PodSchedulingContextList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.PodSchedulingContextSpec)(nil), (*resource.PodSchedulingContextSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(a.(*v1alpha3.PodSchedulingContextSpec), b.(*resource.PodSchedulingContextSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContextSpec)(nil), (*v1alpha3.PodSchedulingContextSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_PodSchedulingContextSpec_To_v1alpha3_PodSchedulingContextSpec(a.(*resource.PodSchedulingContextSpec), b.(*v1alpha3.PodSchedulingContextSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.PodSchedulingContextStatus)(nil), (*resource.PodSchedulingContextStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(a.(*v1alpha3.PodSchedulingContextStatus), b.(*resource.PodSchedulingContextStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.PodSchedulingContextStatus)(nil), (*v1alpha3.PodSchedulingContextStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_PodSchedulingContextStatus_To_v1alpha3_PodSchedulingContextStatus(a.(*resource.PodSchedulingContextStatus), b.(*v1alpha3.PodSchedulingContextStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaim)(nil), (*resource.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaim_To_resource_ResourceClaim(a.(*v1alpha3.ResourceClaim), b.(*resource.ResourceClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaim)(nil), (*v1alpha3.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaim_To_v1alpha3_ResourceClaim(a.(*resource.ResourceClaim), b.(*v1alpha3.ResourceClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimConsumerReference)(nil), (*resource.ResourceClaimConsumerReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(a.(*v1alpha3.ResourceClaimConsumerReference), b.(*resource.ResourceClaimConsumerReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimConsumerReference)(nil), (*v1alpha3.ResourceClaimConsumerReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimConsumerReference_To_v1alpha3_ResourceClaimConsumerReference(a.(*resource.ResourceClaimConsumerReference), b.(*v1alpha3.ResourceClaimConsumerReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimList)(nil), (*resource.ResourceClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimList_To_resource_ResourceClaimList(a.(*v1alpha3.ResourceClaimList), b.(*resource.ResourceClaimList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimList)(nil), (*v1alpha3.ResourceClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimList_To_v1alpha3_ResourceClaimList(a.(*resource.ResourceClaimList), b.(*v1alpha3.ResourceClaimList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimSchedulingStatus)(nil), (*resource.ResourceClaimSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(a.(*v1alpha3.ResourceClaimSchedulingStatus), b.(*resource.ResourceClaimSchedulingStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimSchedulingStatus)(nil), (*v1alpha3.ResourceClaimSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha3_ResourceClaimSchedulingStatus(a.(*resource.ResourceClaimSchedulingStatus), b.(*v1alpha3.ResourceClaimSchedulingStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimSpec)(nil), (*resource.ResourceClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec(a.(*v1alpha3.ResourceClaimSpec), b.(*resource.ResourceClaimSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimSpec)(nil), (*v1alpha3.ResourceClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec(a.(*resource.ResourceClaimSpec), b.(*v1alpha3.ResourceClaimSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimStatus)(nil), (*resource.ResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimStatus_To_resource_ResourceClaimStatus(a.(*v1alpha3.ResourceClaimStatus), b.(*resource.ResourceClaimStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimStatus)(nil), (*v1alpha3.ResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimStatus_To_v1alpha3_ResourceClaimStatus(a.(*resource.ResourceClaimStatus), b.(*v1alpha3.ResourceClaimStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimTemplate)(nil), (*resource.ResourceClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(a.(*v1alpha3.ResourceClaimTemplate), b.(*resource.ResourceClaimTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplate)(nil), (*v1alpha3.ResourceClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimTemplate_To_v1alpha3_ResourceClaimTemplate(a.(*resource.ResourceClaimTemplate), b.(*v1alpha3.ResourceClaimTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimTemplateList)(nil), (*resource.ResourceClaimTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(a.(*v1alpha3.ResourceClaimTemplateList), b.(*resource.ResourceClaimTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplateList)(nil), (*v1alpha3.ResourceClaimTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimTemplateList_To_v1alpha3_ResourceClaimTemplateList(a.(*resource.ResourceClaimTemplateList), b.(*v1alpha3.ResourceClaimTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceClaimTemplateSpec)(nil), (*resource.ResourceClaimTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(a.(*v1alpha3.ResourceClaimTemplateSpec), b.(*resource.ResourceClaimTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplateSpec)(nil), (*v1alpha3.ResourceClaimTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceClaimTemplateSpec_To_v1alpha3_ResourceClaimTemplateSpec(a.(*resource.ResourceClaimTemplateSpec), b.(*v1alpha3.ResourceClaimTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourcePool)(nil), (*resource.ResourcePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourcePool_To_resource_ResourcePool(a.(*v1alpha3.ResourcePool), b.(*resource.ResourcePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourcePool)(nil), (*v1alpha3.ResourcePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourcePool_To_v1alpha3_ResourcePool(a.(*resource.ResourcePool), b.(*v1alpha3.ResourcePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceSlice)(nil), (*resource.ResourceSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceSlice_To_resource_ResourceSlice(a.(*v1alpha3.ResourceSlice), b.(*resource.ResourceSlice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceSlice)(nil), (*v1alpha3.ResourceSlice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceSlice_To_v1alpha3_ResourceSlice(a.(*resource.ResourceSlice), b.(*v1alpha3.ResourceSlice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceSliceList)(nil), (*resource.ResourceSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceSliceList_To_resource_ResourceSliceList(a.(*v1alpha3.ResourceSliceList), b.(*resource.ResourceSliceList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceSliceList)(nil), (*v1alpha3.ResourceSliceList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceSliceList_To_v1alpha3_ResourceSliceList(a.(*resource.ResourceSliceList), b.(*v1alpha3.ResourceSliceList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha3.ResourceSliceSpec)(nil), (*resource.ResourceSliceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec(a.(*v1alpha3.ResourceSliceSpec), b.(*resource.ResourceSliceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*resource.ResourceSliceSpec)(nil), (*v1alpha3.ResourceSliceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec(a.(*resource.ResourceSliceSpec), b.(*v1alpha3.ResourceSliceSpec), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha3_AllocationResult_To_resource_AllocationResult(in *v1alpha3.AllocationResult, out *resource.AllocationResult, s conversion.Scope) error { + if err := Convert_v1alpha3_DeviceAllocationResult_To_resource_DeviceAllocationResult(&in.Devices, &out.Devices, s); err != nil { + return err + } + out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector)) + out.Controller = in.Controller + return nil +} + +// Convert_v1alpha3_AllocationResult_To_resource_AllocationResult is an autogenerated conversion function. +func Convert_v1alpha3_AllocationResult_To_resource_AllocationResult(in *v1alpha3.AllocationResult, out *resource.AllocationResult, s conversion.Scope) error { + return autoConvert_v1alpha3_AllocationResult_To_resource_AllocationResult(in, out, s) +} + +func autoConvert_resource_AllocationResult_To_v1alpha3_AllocationResult(in *resource.AllocationResult, out *v1alpha3.AllocationResult, s conversion.Scope) error { + if err := Convert_resource_DeviceAllocationResult_To_v1alpha3_DeviceAllocationResult(&in.Devices, &out.Devices, s); err != nil { + return err + } + out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector)) + out.Controller = in.Controller + return nil +} + +// Convert_resource_AllocationResult_To_v1alpha3_AllocationResult is an autogenerated conversion function. +func Convert_resource_AllocationResult_To_v1alpha3_AllocationResult(in *resource.AllocationResult, out *v1alpha3.AllocationResult, s conversion.Scope) error { + return autoConvert_resource_AllocationResult_To_v1alpha3_AllocationResult(in, out, s) +} + +func autoConvert_v1alpha3_BasicDevice_To_resource_BasicDevice(in *v1alpha3.BasicDevice, out *resource.BasicDevice, s conversion.Scope) error { + out.Attributes = *(*map[resource.QualifiedName]resource.DeviceAttribute)(unsafe.Pointer(&in.Attributes)) + out.Capacity = *(*map[resource.QualifiedName]apiresource.Quantity)(unsafe.Pointer(&in.Capacity)) + return nil +} + +// Convert_v1alpha3_BasicDevice_To_resource_BasicDevice is an autogenerated conversion function. +func Convert_v1alpha3_BasicDevice_To_resource_BasicDevice(in *v1alpha3.BasicDevice, out *resource.BasicDevice, s conversion.Scope) error { + return autoConvert_v1alpha3_BasicDevice_To_resource_BasicDevice(in, out, s) +} + +func autoConvert_resource_BasicDevice_To_v1alpha3_BasicDevice(in *resource.BasicDevice, out *v1alpha3.BasicDevice, s conversion.Scope) error { + out.Attributes = *(*map[v1alpha3.QualifiedName]v1alpha3.DeviceAttribute)(unsafe.Pointer(&in.Attributes)) + out.Capacity = *(*map[v1alpha3.QualifiedName]apiresource.Quantity)(unsafe.Pointer(&in.Capacity)) + return nil +} + +// Convert_resource_BasicDevice_To_v1alpha3_BasicDevice is an autogenerated conversion function. +func Convert_resource_BasicDevice_To_v1alpha3_BasicDevice(in *resource.BasicDevice, out *v1alpha3.BasicDevice, s conversion.Scope) error { + return autoConvert_resource_BasicDevice_To_v1alpha3_BasicDevice(in, out, s) +} + +func autoConvert_v1alpha3_CELDeviceSelector_To_resource_CELDeviceSelector(in *v1alpha3.CELDeviceSelector, out *resource.CELDeviceSelector, s conversion.Scope) error { + out.Expression = in.Expression + return nil +} + +// Convert_v1alpha3_CELDeviceSelector_To_resource_CELDeviceSelector is an autogenerated conversion function. +func Convert_v1alpha3_CELDeviceSelector_To_resource_CELDeviceSelector(in *v1alpha3.CELDeviceSelector, out *resource.CELDeviceSelector, s conversion.Scope) error { + return autoConvert_v1alpha3_CELDeviceSelector_To_resource_CELDeviceSelector(in, out, s) +} + +func autoConvert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector(in *resource.CELDeviceSelector, out *v1alpha3.CELDeviceSelector, s conversion.Scope) error { + out.Expression = in.Expression + return nil +} + +// Convert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector is an autogenerated conversion function. +func Convert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector(in *resource.CELDeviceSelector, out *v1alpha3.CELDeviceSelector, s conversion.Scope) error { + return autoConvert_resource_CELDeviceSelector_To_v1alpha3_CELDeviceSelector(in, out, s) +} + +func autoConvert_v1alpha3_Device_To_resource_Device(in *v1alpha3.Device, out *resource.Device, s conversion.Scope) error { + out.Name = in.Name + out.Basic = (*resource.BasicDevice)(unsafe.Pointer(in.Basic)) + return nil +} + +// Convert_v1alpha3_Device_To_resource_Device is an autogenerated conversion function. +func Convert_v1alpha3_Device_To_resource_Device(in *v1alpha3.Device, out *resource.Device, s conversion.Scope) error { + return autoConvert_v1alpha3_Device_To_resource_Device(in, out, s) +} + +func autoConvert_resource_Device_To_v1alpha3_Device(in *resource.Device, out *v1alpha3.Device, s conversion.Scope) error { + out.Name = in.Name + out.Basic = (*v1alpha3.BasicDevice)(unsafe.Pointer(in.Basic)) + return nil +} + +// Convert_resource_Device_To_v1alpha3_Device is an autogenerated conversion function. +func Convert_resource_Device_To_v1alpha3_Device(in *resource.Device, out *v1alpha3.Device, s conversion.Scope) error { + return autoConvert_resource_Device_To_v1alpha3_Device(in, out, s) +} + +func autoConvert_v1alpha3_DeviceAllocationConfiguration_To_resource_DeviceAllocationConfiguration(in *v1alpha3.DeviceAllocationConfiguration, out *resource.DeviceAllocationConfiguration, s conversion.Scope) error { + out.Source = resource.AllocationConfigSource(in.Source) + out.Requests = *(*[]string)(unsafe.Pointer(&in.Requests)) + if err := Convert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(&in.DeviceConfiguration, &out.DeviceConfiguration, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_DeviceAllocationConfiguration_To_resource_DeviceAllocationConfiguration is an autogenerated conversion function. +func Convert_v1alpha3_DeviceAllocationConfiguration_To_resource_DeviceAllocationConfiguration(in *v1alpha3.DeviceAllocationConfiguration, out *resource.DeviceAllocationConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceAllocationConfiguration_To_resource_DeviceAllocationConfiguration(in, out, s) +} + +func autoConvert_resource_DeviceAllocationConfiguration_To_v1alpha3_DeviceAllocationConfiguration(in *resource.DeviceAllocationConfiguration, out *v1alpha3.DeviceAllocationConfiguration, s conversion.Scope) error { + out.Source = v1alpha3.AllocationConfigSource(in.Source) + out.Requests = *(*[]string)(unsafe.Pointer(&in.Requests)) + if err := Convert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(&in.DeviceConfiguration, &out.DeviceConfiguration, s); err != nil { + return err + } + return nil +} + +// Convert_resource_DeviceAllocationConfiguration_To_v1alpha3_DeviceAllocationConfiguration is an autogenerated conversion function. +func Convert_resource_DeviceAllocationConfiguration_To_v1alpha3_DeviceAllocationConfiguration(in *resource.DeviceAllocationConfiguration, out *v1alpha3.DeviceAllocationConfiguration, s conversion.Scope) error { + return autoConvert_resource_DeviceAllocationConfiguration_To_v1alpha3_DeviceAllocationConfiguration(in, out, s) +} + +func autoConvert_v1alpha3_DeviceAllocationResult_To_resource_DeviceAllocationResult(in *v1alpha3.DeviceAllocationResult, out *resource.DeviceAllocationResult, s conversion.Scope) error { + out.Results = *(*[]resource.DeviceRequestAllocationResult)(unsafe.Pointer(&in.Results)) + out.Config = *(*[]resource.DeviceAllocationConfiguration)(unsafe.Pointer(&in.Config)) + return nil +} + +// Convert_v1alpha3_DeviceAllocationResult_To_resource_DeviceAllocationResult is an autogenerated conversion function. +func Convert_v1alpha3_DeviceAllocationResult_To_resource_DeviceAllocationResult(in *v1alpha3.DeviceAllocationResult, out *resource.DeviceAllocationResult, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceAllocationResult_To_resource_DeviceAllocationResult(in, out, s) +} + +func autoConvert_resource_DeviceAllocationResult_To_v1alpha3_DeviceAllocationResult(in *resource.DeviceAllocationResult, out *v1alpha3.DeviceAllocationResult, s conversion.Scope) error { + out.Results = *(*[]v1alpha3.DeviceRequestAllocationResult)(unsafe.Pointer(&in.Results)) + out.Config = *(*[]v1alpha3.DeviceAllocationConfiguration)(unsafe.Pointer(&in.Config)) + return nil +} + +// Convert_resource_DeviceAllocationResult_To_v1alpha3_DeviceAllocationResult is an autogenerated conversion function. +func Convert_resource_DeviceAllocationResult_To_v1alpha3_DeviceAllocationResult(in *resource.DeviceAllocationResult, out *v1alpha3.DeviceAllocationResult, s conversion.Scope) error { + return autoConvert_resource_DeviceAllocationResult_To_v1alpha3_DeviceAllocationResult(in, out, s) +} + +func autoConvert_v1alpha3_DeviceAttribute_To_resource_DeviceAttribute(in *v1alpha3.DeviceAttribute, out *resource.DeviceAttribute, s conversion.Scope) error { + out.IntValue = (*int64)(unsafe.Pointer(in.IntValue)) + out.BoolValue = (*bool)(unsafe.Pointer(in.BoolValue)) + out.StringValue = (*string)(unsafe.Pointer(in.StringValue)) + out.VersionValue = (*string)(unsafe.Pointer(in.VersionValue)) + return nil +} + +// Convert_v1alpha3_DeviceAttribute_To_resource_DeviceAttribute is an autogenerated conversion function. +func Convert_v1alpha3_DeviceAttribute_To_resource_DeviceAttribute(in *v1alpha3.DeviceAttribute, out *resource.DeviceAttribute, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceAttribute_To_resource_DeviceAttribute(in, out, s) +} + +func autoConvert_resource_DeviceAttribute_To_v1alpha3_DeviceAttribute(in *resource.DeviceAttribute, out *v1alpha3.DeviceAttribute, s conversion.Scope) error { + out.IntValue = (*int64)(unsafe.Pointer(in.IntValue)) + out.BoolValue = (*bool)(unsafe.Pointer(in.BoolValue)) + out.StringValue = (*string)(unsafe.Pointer(in.StringValue)) + out.VersionValue = (*string)(unsafe.Pointer(in.VersionValue)) + return nil +} + +// Convert_resource_DeviceAttribute_To_v1alpha3_DeviceAttribute is an autogenerated conversion function. +func Convert_resource_DeviceAttribute_To_v1alpha3_DeviceAttribute(in *resource.DeviceAttribute, out *v1alpha3.DeviceAttribute, s conversion.Scope) error { + return autoConvert_resource_DeviceAttribute_To_v1alpha3_DeviceAttribute(in, out, s) +} + +func autoConvert_v1alpha3_DeviceClaim_To_resource_DeviceClaim(in *v1alpha3.DeviceClaim, out *resource.DeviceClaim, s conversion.Scope) error { + out.Requests = *(*[]resource.DeviceRequest)(unsafe.Pointer(&in.Requests)) + out.Constraints = *(*[]resource.DeviceConstraint)(unsafe.Pointer(&in.Constraints)) + out.Config = *(*[]resource.DeviceClaimConfiguration)(unsafe.Pointer(&in.Config)) + return nil +} + +// Convert_v1alpha3_DeviceClaim_To_resource_DeviceClaim is an autogenerated conversion function. +func Convert_v1alpha3_DeviceClaim_To_resource_DeviceClaim(in *v1alpha3.DeviceClaim, out *resource.DeviceClaim, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceClaim_To_resource_DeviceClaim(in, out, s) +} + +func autoConvert_resource_DeviceClaim_To_v1alpha3_DeviceClaim(in *resource.DeviceClaim, out *v1alpha3.DeviceClaim, s conversion.Scope) error { + out.Requests = *(*[]v1alpha3.DeviceRequest)(unsafe.Pointer(&in.Requests)) + out.Constraints = *(*[]v1alpha3.DeviceConstraint)(unsafe.Pointer(&in.Constraints)) + out.Config = *(*[]v1alpha3.DeviceClaimConfiguration)(unsafe.Pointer(&in.Config)) + return nil +} + +// Convert_resource_DeviceClaim_To_v1alpha3_DeviceClaim is an autogenerated conversion function. +func Convert_resource_DeviceClaim_To_v1alpha3_DeviceClaim(in *resource.DeviceClaim, out *v1alpha3.DeviceClaim, s conversion.Scope) error { + return autoConvert_resource_DeviceClaim_To_v1alpha3_DeviceClaim(in, out, s) +} + +func autoConvert_v1alpha3_DeviceClaimConfiguration_To_resource_DeviceClaimConfiguration(in *v1alpha3.DeviceClaimConfiguration, out *resource.DeviceClaimConfiguration, s conversion.Scope) error { + out.Requests = *(*[]string)(unsafe.Pointer(&in.Requests)) + if err := Convert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(&in.DeviceConfiguration, &out.DeviceConfiguration, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_DeviceClaimConfiguration_To_resource_DeviceClaimConfiguration is an autogenerated conversion function. +func Convert_v1alpha3_DeviceClaimConfiguration_To_resource_DeviceClaimConfiguration(in *v1alpha3.DeviceClaimConfiguration, out *resource.DeviceClaimConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceClaimConfiguration_To_resource_DeviceClaimConfiguration(in, out, s) +} + +func autoConvert_resource_DeviceClaimConfiguration_To_v1alpha3_DeviceClaimConfiguration(in *resource.DeviceClaimConfiguration, out *v1alpha3.DeviceClaimConfiguration, s conversion.Scope) error { + out.Requests = *(*[]string)(unsafe.Pointer(&in.Requests)) + if err := Convert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(&in.DeviceConfiguration, &out.DeviceConfiguration, s); err != nil { + return err + } + return nil +} + +// Convert_resource_DeviceClaimConfiguration_To_v1alpha3_DeviceClaimConfiguration is an autogenerated conversion function. +func Convert_resource_DeviceClaimConfiguration_To_v1alpha3_DeviceClaimConfiguration(in *resource.DeviceClaimConfiguration, out *v1alpha3.DeviceClaimConfiguration, s conversion.Scope) error { + return autoConvert_resource_DeviceClaimConfiguration_To_v1alpha3_DeviceClaimConfiguration(in, out, s) +} + +func autoConvert_v1alpha3_DeviceClass_To_resource_DeviceClass(in *v1alpha3.DeviceClass, out *resource.DeviceClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_DeviceClassSpec_To_resource_DeviceClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_DeviceClass_To_resource_DeviceClass is an autogenerated conversion function. +func Convert_v1alpha3_DeviceClass_To_resource_DeviceClass(in *v1alpha3.DeviceClass, out *resource.DeviceClass, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceClass_To_resource_DeviceClass(in, out, s) +} + +func autoConvert_resource_DeviceClass_To_v1alpha3_DeviceClass(in *resource.DeviceClass, out *v1alpha3.DeviceClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_resource_DeviceClassSpec_To_v1alpha3_DeviceClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_resource_DeviceClass_To_v1alpha3_DeviceClass is an autogenerated conversion function. +func Convert_resource_DeviceClass_To_v1alpha3_DeviceClass(in *resource.DeviceClass, out *v1alpha3.DeviceClass, s conversion.Scope) error { + return autoConvert_resource_DeviceClass_To_v1alpha3_DeviceClass(in, out, s) +} + +func autoConvert_v1alpha3_DeviceClassConfiguration_To_resource_DeviceClassConfiguration(in *v1alpha3.DeviceClassConfiguration, out *resource.DeviceClassConfiguration, s conversion.Scope) error { + if err := Convert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(&in.DeviceConfiguration, &out.DeviceConfiguration, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_DeviceClassConfiguration_To_resource_DeviceClassConfiguration is an autogenerated conversion function. +func Convert_v1alpha3_DeviceClassConfiguration_To_resource_DeviceClassConfiguration(in *v1alpha3.DeviceClassConfiguration, out *resource.DeviceClassConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceClassConfiguration_To_resource_DeviceClassConfiguration(in, out, s) +} + +func autoConvert_resource_DeviceClassConfiguration_To_v1alpha3_DeviceClassConfiguration(in *resource.DeviceClassConfiguration, out *v1alpha3.DeviceClassConfiguration, s conversion.Scope) error { + if err := Convert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(&in.DeviceConfiguration, &out.DeviceConfiguration, s); err != nil { + return err + } + return nil +} + +// Convert_resource_DeviceClassConfiguration_To_v1alpha3_DeviceClassConfiguration is an autogenerated conversion function. +func Convert_resource_DeviceClassConfiguration_To_v1alpha3_DeviceClassConfiguration(in *resource.DeviceClassConfiguration, out *v1alpha3.DeviceClassConfiguration, s conversion.Scope) error { + return autoConvert_resource_DeviceClassConfiguration_To_v1alpha3_DeviceClassConfiguration(in, out, s) +} + +func autoConvert_v1alpha3_DeviceClassList_To_resource_DeviceClassList(in *v1alpha3.DeviceClassList, out *resource.DeviceClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]resource.DeviceClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_DeviceClassList_To_resource_DeviceClassList is an autogenerated conversion function. +func Convert_v1alpha3_DeviceClassList_To_resource_DeviceClassList(in *v1alpha3.DeviceClassList, out *resource.DeviceClassList, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceClassList_To_resource_DeviceClassList(in, out, s) +} + +func autoConvert_resource_DeviceClassList_To_v1alpha3_DeviceClassList(in *resource.DeviceClassList, out *v1alpha3.DeviceClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.DeviceClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_resource_DeviceClassList_To_v1alpha3_DeviceClassList is an autogenerated conversion function. +func Convert_resource_DeviceClassList_To_v1alpha3_DeviceClassList(in *resource.DeviceClassList, out *v1alpha3.DeviceClassList, s conversion.Scope) error { + return autoConvert_resource_DeviceClassList_To_v1alpha3_DeviceClassList(in, out, s) +} + +func autoConvert_v1alpha3_DeviceClassSpec_To_resource_DeviceClassSpec(in *v1alpha3.DeviceClassSpec, out *resource.DeviceClassSpec, s conversion.Scope) error { + out.Selectors = *(*[]resource.DeviceSelector)(unsafe.Pointer(&in.Selectors)) + out.Config = *(*[]resource.DeviceClassConfiguration)(unsafe.Pointer(&in.Config)) + out.SuitableNodes = (*core.NodeSelector)(unsafe.Pointer(in.SuitableNodes)) + return nil +} + +// Convert_v1alpha3_DeviceClassSpec_To_resource_DeviceClassSpec is an autogenerated conversion function. +func Convert_v1alpha3_DeviceClassSpec_To_resource_DeviceClassSpec(in *v1alpha3.DeviceClassSpec, out *resource.DeviceClassSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceClassSpec_To_resource_DeviceClassSpec(in, out, s) +} + +func autoConvert_resource_DeviceClassSpec_To_v1alpha3_DeviceClassSpec(in *resource.DeviceClassSpec, out *v1alpha3.DeviceClassSpec, s conversion.Scope) error { + out.Selectors = *(*[]v1alpha3.DeviceSelector)(unsafe.Pointer(&in.Selectors)) + out.Config = *(*[]v1alpha3.DeviceClassConfiguration)(unsafe.Pointer(&in.Config)) + out.SuitableNodes = (*v1.NodeSelector)(unsafe.Pointer(in.SuitableNodes)) + return nil +} + +// Convert_resource_DeviceClassSpec_To_v1alpha3_DeviceClassSpec is an autogenerated conversion function. +func Convert_resource_DeviceClassSpec_To_v1alpha3_DeviceClassSpec(in *resource.DeviceClassSpec, out *v1alpha3.DeviceClassSpec, s conversion.Scope) error { + return autoConvert_resource_DeviceClassSpec_To_v1alpha3_DeviceClassSpec(in, out, s) +} + +func autoConvert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(in *v1alpha3.DeviceConfiguration, out *resource.DeviceConfiguration, s conversion.Scope) error { + out.Opaque = (*resource.OpaqueDeviceConfiguration)(unsafe.Pointer(in.Opaque)) + return nil +} + +// Convert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration is an autogenerated conversion function. +func Convert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(in *v1alpha3.DeviceConfiguration, out *resource.DeviceConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceConfiguration_To_resource_DeviceConfiguration(in, out, s) +} + +func autoConvert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(in *resource.DeviceConfiguration, out *v1alpha3.DeviceConfiguration, s conversion.Scope) error { + out.Opaque = (*v1alpha3.OpaqueDeviceConfiguration)(unsafe.Pointer(in.Opaque)) + return nil +} + +// Convert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration is an autogenerated conversion function. +func Convert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(in *resource.DeviceConfiguration, out *v1alpha3.DeviceConfiguration, s conversion.Scope) error { + return autoConvert_resource_DeviceConfiguration_To_v1alpha3_DeviceConfiguration(in, out, s) +} + +func autoConvert_v1alpha3_DeviceConstraint_To_resource_DeviceConstraint(in *v1alpha3.DeviceConstraint, out *resource.DeviceConstraint, s conversion.Scope) error { + out.Requests = *(*[]string)(unsafe.Pointer(&in.Requests)) + out.MatchAttribute = (*resource.FullyQualifiedName)(unsafe.Pointer(in.MatchAttribute)) + return nil +} + +// Convert_v1alpha3_DeviceConstraint_To_resource_DeviceConstraint is an autogenerated conversion function. +func Convert_v1alpha3_DeviceConstraint_To_resource_DeviceConstraint(in *v1alpha3.DeviceConstraint, out *resource.DeviceConstraint, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceConstraint_To_resource_DeviceConstraint(in, out, s) +} + +func autoConvert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint(in *resource.DeviceConstraint, out *v1alpha3.DeviceConstraint, s conversion.Scope) error { + out.Requests = *(*[]string)(unsafe.Pointer(&in.Requests)) + out.MatchAttribute = (*v1alpha3.FullyQualifiedName)(unsafe.Pointer(in.MatchAttribute)) + return nil +} + +// Convert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint is an autogenerated conversion function. +func Convert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint(in *resource.DeviceConstraint, out *v1alpha3.DeviceConstraint, s conversion.Scope) error { + return autoConvert_resource_DeviceConstraint_To_v1alpha3_DeviceConstraint(in, out, s) +} + +func autoConvert_v1alpha3_DeviceRequest_To_resource_DeviceRequest(in *v1alpha3.DeviceRequest, out *resource.DeviceRequest, s conversion.Scope) error { + out.Name = in.Name + out.DeviceClassName = in.DeviceClassName + out.Selectors = *(*[]resource.DeviceSelector)(unsafe.Pointer(&in.Selectors)) + out.CountMode = resource.DeviceCountMode(in.CountMode) + out.Count = in.Count + out.AdminAccess = in.AdminAccess + return nil +} + +// Convert_v1alpha3_DeviceRequest_To_resource_DeviceRequest is an autogenerated conversion function. +func Convert_v1alpha3_DeviceRequest_To_resource_DeviceRequest(in *v1alpha3.DeviceRequest, out *resource.DeviceRequest, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceRequest_To_resource_DeviceRequest(in, out, s) +} + +func autoConvert_resource_DeviceRequest_To_v1alpha3_DeviceRequest(in *resource.DeviceRequest, out *v1alpha3.DeviceRequest, s conversion.Scope) error { + out.Name = in.Name + out.DeviceClassName = in.DeviceClassName + out.Selectors = *(*[]v1alpha3.DeviceSelector)(unsafe.Pointer(&in.Selectors)) + out.CountMode = v1alpha3.DeviceCountMode(in.CountMode) + out.Count = in.Count + out.AdminAccess = in.AdminAccess + return nil +} + +// Convert_resource_DeviceRequest_To_v1alpha3_DeviceRequest is an autogenerated conversion function. +func Convert_resource_DeviceRequest_To_v1alpha3_DeviceRequest(in *resource.DeviceRequest, out *v1alpha3.DeviceRequest, s conversion.Scope) error { + return autoConvert_resource_DeviceRequest_To_v1alpha3_DeviceRequest(in, out, s) +} + +func autoConvert_v1alpha3_DeviceRequestAllocationResult_To_resource_DeviceRequestAllocationResult(in *v1alpha3.DeviceRequestAllocationResult, out *resource.DeviceRequestAllocationResult, s conversion.Scope) error { + out.Request = in.Request + out.Driver = in.Driver + out.Pool = in.Pool + out.Device = in.Device + return nil +} + +// Convert_v1alpha3_DeviceRequestAllocationResult_To_resource_DeviceRequestAllocationResult is an autogenerated conversion function. +func Convert_v1alpha3_DeviceRequestAllocationResult_To_resource_DeviceRequestAllocationResult(in *v1alpha3.DeviceRequestAllocationResult, out *resource.DeviceRequestAllocationResult, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceRequestAllocationResult_To_resource_DeviceRequestAllocationResult(in, out, s) +} + +func autoConvert_resource_DeviceRequestAllocationResult_To_v1alpha3_DeviceRequestAllocationResult(in *resource.DeviceRequestAllocationResult, out *v1alpha3.DeviceRequestAllocationResult, s conversion.Scope) error { + out.Request = in.Request + out.Driver = in.Driver + out.Pool = in.Pool + out.Device = in.Device + return nil +} + +// Convert_resource_DeviceRequestAllocationResult_To_v1alpha3_DeviceRequestAllocationResult is an autogenerated conversion function. +func Convert_resource_DeviceRequestAllocationResult_To_v1alpha3_DeviceRequestAllocationResult(in *resource.DeviceRequestAllocationResult, out *v1alpha3.DeviceRequestAllocationResult, s conversion.Scope) error { + return autoConvert_resource_DeviceRequestAllocationResult_To_v1alpha3_DeviceRequestAllocationResult(in, out, s) +} + +func autoConvert_v1alpha3_DeviceSelector_To_resource_DeviceSelector(in *v1alpha3.DeviceSelector, out *resource.DeviceSelector, s conversion.Scope) error { + out.CEL = (*resource.CELDeviceSelector)(unsafe.Pointer(in.CEL)) + return nil +} + +// Convert_v1alpha3_DeviceSelector_To_resource_DeviceSelector is an autogenerated conversion function. +func Convert_v1alpha3_DeviceSelector_To_resource_DeviceSelector(in *v1alpha3.DeviceSelector, out *resource.DeviceSelector, s conversion.Scope) error { + return autoConvert_v1alpha3_DeviceSelector_To_resource_DeviceSelector(in, out, s) +} + +func autoConvert_resource_DeviceSelector_To_v1alpha3_DeviceSelector(in *resource.DeviceSelector, out *v1alpha3.DeviceSelector, s conversion.Scope) error { + out.CEL = (*v1alpha3.CELDeviceSelector)(unsafe.Pointer(in.CEL)) + return nil +} + +// Convert_resource_DeviceSelector_To_v1alpha3_DeviceSelector is an autogenerated conversion function. +func Convert_resource_DeviceSelector_To_v1alpha3_DeviceSelector(in *resource.DeviceSelector, out *v1alpha3.DeviceSelector, s conversion.Scope) error { + return autoConvert_resource_DeviceSelector_To_v1alpha3_DeviceSelector(in, out, s) +} + +func autoConvert_v1alpha3_OpaqueDeviceConfiguration_To_resource_OpaqueDeviceConfiguration(in *v1alpha3.OpaqueDeviceConfiguration, out *resource.OpaqueDeviceConfiguration, s conversion.Scope) error { + out.Driver = in.Driver + out.Parameters = in.Parameters + return nil +} + +// Convert_v1alpha3_OpaqueDeviceConfiguration_To_resource_OpaqueDeviceConfiguration is an autogenerated conversion function. +func Convert_v1alpha3_OpaqueDeviceConfiguration_To_resource_OpaqueDeviceConfiguration(in *v1alpha3.OpaqueDeviceConfiguration, out *resource.OpaqueDeviceConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha3_OpaqueDeviceConfiguration_To_resource_OpaqueDeviceConfiguration(in, out, s) +} + +func autoConvert_resource_OpaqueDeviceConfiguration_To_v1alpha3_OpaqueDeviceConfiguration(in *resource.OpaqueDeviceConfiguration, out *v1alpha3.OpaqueDeviceConfiguration, s conversion.Scope) error { + out.Driver = in.Driver + out.Parameters = in.Parameters + return nil +} + +// Convert_resource_OpaqueDeviceConfiguration_To_v1alpha3_OpaqueDeviceConfiguration is an autogenerated conversion function. +func Convert_resource_OpaqueDeviceConfiguration_To_v1alpha3_OpaqueDeviceConfiguration(in *resource.OpaqueDeviceConfiguration, out *v1alpha3.OpaqueDeviceConfiguration, s conversion.Scope) error { + return autoConvert_resource_OpaqueDeviceConfiguration_To_v1alpha3_OpaqueDeviceConfiguration(in, out, s) +} + +func autoConvert_v1alpha3_PodSchedulingContext_To_resource_PodSchedulingContext(in *v1alpha3.PodSchedulingContext, out *resource.PodSchedulingContext, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_PodSchedulingContext_To_resource_PodSchedulingContext is an autogenerated conversion function. +func Convert_v1alpha3_PodSchedulingContext_To_resource_PodSchedulingContext(in *v1alpha3.PodSchedulingContext, out *resource.PodSchedulingContext, s conversion.Scope) error { + return autoConvert_v1alpha3_PodSchedulingContext_To_resource_PodSchedulingContext(in, out, s) +} + +func autoConvert_resource_PodSchedulingContext_To_v1alpha3_PodSchedulingContext(in *resource.PodSchedulingContext, out *v1alpha3.PodSchedulingContext, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_resource_PodSchedulingContextSpec_To_v1alpha3_PodSchedulingContextSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_resource_PodSchedulingContextStatus_To_v1alpha3_PodSchedulingContextStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_resource_PodSchedulingContext_To_v1alpha3_PodSchedulingContext is an autogenerated conversion function. +func Convert_resource_PodSchedulingContext_To_v1alpha3_PodSchedulingContext(in *resource.PodSchedulingContext, out *v1alpha3.PodSchedulingContext, s conversion.Scope) error { + return autoConvert_resource_PodSchedulingContext_To_v1alpha3_PodSchedulingContext(in, out, s) +} + +func autoConvert_v1alpha3_PodSchedulingContextList_To_resource_PodSchedulingContextList(in *v1alpha3.PodSchedulingContextList, out *resource.PodSchedulingContextList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]resource.PodSchedulingContext)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_PodSchedulingContextList_To_resource_PodSchedulingContextList is an autogenerated conversion function. +func Convert_v1alpha3_PodSchedulingContextList_To_resource_PodSchedulingContextList(in *v1alpha3.PodSchedulingContextList, out *resource.PodSchedulingContextList, s conversion.Scope) error { + return autoConvert_v1alpha3_PodSchedulingContextList_To_resource_PodSchedulingContextList(in, out, s) +} + +func autoConvert_resource_PodSchedulingContextList_To_v1alpha3_PodSchedulingContextList(in *resource.PodSchedulingContextList, out *v1alpha3.PodSchedulingContextList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.PodSchedulingContext)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_resource_PodSchedulingContextList_To_v1alpha3_PodSchedulingContextList is an autogenerated conversion function. +func Convert_resource_PodSchedulingContextList_To_v1alpha3_PodSchedulingContextList(in *resource.PodSchedulingContextList, out *v1alpha3.PodSchedulingContextList, s conversion.Scope) error { + return autoConvert_resource_PodSchedulingContextList_To_v1alpha3_PodSchedulingContextList(in, out, s) +} + +func autoConvert_v1alpha3_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(in *v1alpha3.PodSchedulingContextSpec, out *resource.PodSchedulingContextSpec, s conversion.Scope) error { + out.SelectedNode = in.SelectedNode + out.PotentialNodes = *(*[]string)(unsafe.Pointer(&in.PotentialNodes)) + return nil +} + +// Convert_v1alpha3_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec is an autogenerated conversion function. +func Convert_v1alpha3_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(in *v1alpha3.PodSchedulingContextSpec, out *resource.PodSchedulingContextSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_PodSchedulingContextSpec_To_resource_PodSchedulingContextSpec(in, out, s) +} + +func autoConvert_resource_PodSchedulingContextSpec_To_v1alpha3_PodSchedulingContextSpec(in *resource.PodSchedulingContextSpec, out *v1alpha3.PodSchedulingContextSpec, s conversion.Scope) error { + out.SelectedNode = in.SelectedNode + out.PotentialNodes = *(*[]string)(unsafe.Pointer(&in.PotentialNodes)) + return nil +} + +// Convert_resource_PodSchedulingContextSpec_To_v1alpha3_PodSchedulingContextSpec is an autogenerated conversion function. +func Convert_resource_PodSchedulingContextSpec_To_v1alpha3_PodSchedulingContextSpec(in *resource.PodSchedulingContextSpec, out *v1alpha3.PodSchedulingContextSpec, s conversion.Scope) error { + return autoConvert_resource_PodSchedulingContextSpec_To_v1alpha3_PodSchedulingContextSpec(in, out, s) +} + +func autoConvert_v1alpha3_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(in *v1alpha3.PodSchedulingContextStatus, out *resource.PodSchedulingContextStatus, s conversion.Scope) error { + out.ResourceClaims = *(*[]resource.ResourceClaimSchedulingStatus)(unsafe.Pointer(&in.ResourceClaims)) + return nil +} + +// Convert_v1alpha3_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus is an autogenerated conversion function. +func Convert_v1alpha3_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(in *v1alpha3.PodSchedulingContextStatus, out *resource.PodSchedulingContextStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_PodSchedulingContextStatus_To_resource_PodSchedulingContextStatus(in, out, s) +} + +func autoConvert_resource_PodSchedulingContextStatus_To_v1alpha3_PodSchedulingContextStatus(in *resource.PodSchedulingContextStatus, out *v1alpha3.PodSchedulingContextStatus, s conversion.Scope) error { + out.ResourceClaims = *(*[]v1alpha3.ResourceClaimSchedulingStatus)(unsafe.Pointer(&in.ResourceClaims)) + return nil +} + +// Convert_resource_PodSchedulingContextStatus_To_v1alpha3_PodSchedulingContextStatus is an autogenerated conversion function. +func Convert_resource_PodSchedulingContextStatus_To_v1alpha3_PodSchedulingContextStatus(in *resource.PodSchedulingContextStatus, out *v1alpha3.PodSchedulingContextStatus, s conversion.Scope) error { + return autoConvert_resource_PodSchedulingContextStatus_To_v1alpha3_PodSchedulingContextStatus(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaim_To_resource_ResourceClaim(in *v1alpha3.ResourceClaim, out *resource.ResourceClaim, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_ResourceClaimStatus_To_resource_ResourceClaimStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ResourceClaim_To_resource_ResourceClaim is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaim_To_resource_ResourceClaim(in *v1alpha3.ResourceClaim, out *resource.ResourceClaim, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaim_To_resource_ResourceClaim(in, out, s) +} + +func autoConvert_resource_ResourceClaim_To_v1alpha3_ResourceClaim(in *resource.ResourceClaim, out *v1alpha3.ResourceClaim, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_resource_ResourceClaimStatus_To_v1alpha3_ResourceClaimStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_resource_ResourceClaim_To_v1alpha3_ResourceClaim is an autogenerated conversion function. +func Convert_resource_ResourceClaim_To_v1alpha3_ResourceClaim(in *resource.ResourceClaim, out *v1alpha3.ResourceClaim, s conversion.Scope) error { + return autoConvert_resource_ResourceClaim_To_v1alpha3_ResourceClaim(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(in *v1alpha3.ResourceClaimConsumerReference, out *resource.ResourceClaimConsumerReference, s conversion.Scope) error { + out.APIGroup = in.APIGroup + out.Resource = in.Resource + out.Name = in.Name + out.UID = types.UID(in.UID) + return nil +} + +// Convert_v1alpha3_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(in *v1alpha3.ResourceClaimConsumerReference, out *resource.ResourceClaimConsumerReference, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(in, out, s) +} + +func autoConvert_resource_ResourceClaimConsumerReference_To_v1alpha3_ResourceClaimConsumerReference(in *resource.ResourceClaimConsumerReference, out *v1alpha3.ResourceClaimConsumerReference, s conversion.Scope) error { + out.APIGroup = in.APIGroup + out.Resource = in.Resource + out.Name = in.Name + out.UID = types.UID(in.UID) + return nil +} + +// Convert_resource_ResourceClaimConsumerReference_To_v1alpha3_ResourceClaimConsumerReference is an autogenerated conversion function. +func Convert_resource_ResourceClaimConsumerReference_To_v1alpha3_ResourceClaimConsumerReference(in *resource.ResourceClaimConsumerReference, out *v1alpha3.ResourceClaimConsumerReference, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimConsumerReference_To_v1alpha3_ResourceClaimConsumerReference(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimList_To_resource_ResourceClaimList(in *v1alpha3.ResourceClaimList, out *resource.ResourceClaimList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]resource.ResourceClaim)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_ResourceClaimList_To_resource_ResourceClaimList is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimList_To_resource_ResourceClaimList(in *v1alpha3.ResourceClaimList, out *resource.ResourceClaimList, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimList_To_resource_ResourceClaimList(in, out, s) +} + +func autoConvert_resource_ResourceClaimList_To_v1alpha3_ResourceClaimList(in *resource.ResourceClaimList, out *v1alpha3.ResourceClaimList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.ResourceClaim)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_resource_ResourceClaimList_To_v1alpha3_ResourceClaimList is an autogenerated conversion function. +func Convert_resource_ResourceClaimList_To_v1alpha3_ResourceClaimList(in *resource.ResourceClaimList, out *v1alpha3.ResourceClaimList, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimList_To_v1alpha3_ResourceClaimList(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(in *v1alpha3.ResourceClaimSchedulingStatus, out *resource.ResourceClaimSchedulingStatus, s conversion.Scope) error { + out.Name = in.Name + out.UnsuitableNodes = *(*[]string)(unsafe.Pointer(&in.UnsuitableNodes)) + return nil +} + +// Convert_v1alpha3_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(in *v1alpha3.ResourceClaimSchedulingStatus, out *resource.ResourceClaimSchedulingStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(in, out, s) +} + +func autoConvert_resource_ResourceClaimSchedulingStatus_To_v1alpha3_ResourceClaimSchedulingStatus(in *resource.ResourceClaimSchedulingStatus, out *v1alpha3.ResourceClaimSchedulingStatus, s conversion.Scope) error { + out.Name = in.Name + out.UnsuitableNodes = *(*[]string)(unsafe.Pointer(&in.UnsuitableNodes)) + return nil +} + +// Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha3_ResourceClaimSchedulingStatus is an autogenerated conversion function. +func Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha3_ResourceClaimSchedulingStatus(in *resource.ResourceClaimSchedulingStatus, out *v1alpha3.ResourceClaimSchedulingStatus, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimSchedulingStatus_To_v1alpha3_ResourceClaimSchedulingStatus(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec(in *v1alpha3.ResourceClaimSpec, out *resource.ResourceClaimSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_DeviceClaim_To_resource_DeviceClaim(&in.Devices, &out.Devices, s); err != nil { + return err + } + out.Controller = in.Controller + return nil +} + +// Convert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec(in *v1alpha3.ResourceClaimSpec, out *resource.ResourceClaimSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec(in, out, s) +} + +func autoConvert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec(in *resource.ResourceClaimSpec, out *v1alpha3.ResourceClaimSpec, s conversion.Scope) error { + if err := Convert_resource_DeviceClaim_To_v1alpha3_DeviceClaim(&in.Devices, &out.Devices, s); err != nil { + return err + } + out.Controller = in.Controller + return nil +} + +// Convert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec is an autogenerated conversion function. +func Convert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec(in *resource.ResourceClaimSpec, out *v1alpha3.ResourceClaimSpec, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimStatus_To_resource_ResourceClaimStatus(in *v1alpha3.ResourceClaimStatus, out *resource.ResourceClaimStatus, s conversion.Scope) error { + out.Allocation = (*resource.AllocationResult)(unsafe.Pointer(in.Allocation)) + out.ReservedFor = *(*[]resource.ResourceClaimConsumerReference)(unsafe.Pointer(&in.ReservedFor)) + out.DeallocationRequested = in.DeallocationRequested + return nil +} + +// Convert_v1alpha3_ResourceClaimStatus_To_resource_ResourceClaimStatus is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimStatus_To_resource_ResourceClaimStatus(in *v1alpha3.ResourceClaimStatus, out *resource.ResourceClaimStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimStatus_To_resource_ResourceClaimStatus(in, out, s) +} + +func autoConvert_resource_ResourceClaimStatus_To_v1alpha3_ResourceClaimStatus(in *resource.ResourceClaimStatus, out *v1alpha3.ResourceClaimStatus, s conversion.Scope) error { + out.Allocation = (*v1alpha3.AllocationResult)(unsafe.Pointer(in.Allocation)) + out.ReservedFor = *(*[]v1alpha3.ResourceClaimConsumerReference)(unsafe.Pointer(&in.ReservedFor)) + out.DeallocationRequested = in.DeallocationRequested + return nil +} + +// Convert_resource_ResourceClaimStatus_To_v1alpha3_ResourceClaimStatus is an autogenerated conversion function. +func Convert_resource_ResourceClaimStatus_To_v1alpha3_ResourceClaimStatus(in *resource.ResourceClaimStatus, out *v1alpha3.ResourceClaimStatus, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimStatus_To_v1alpha3_ResourceClaimStatus(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(in *v1alpha3.ResourceClaimTemplate, out *resource.ResourceClaimTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ResourceClaimTemplate_To_resource_ResourceClaimTemplate is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(in *v1alpha3.ResourceClaimTemplate, out *resource.ResourceClaimTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(in, out, s) +} + +func autoConvert_resource_ResourceClaimTemplate_To_v1alpha3_ResourceClaimTemplate(in *resource.ResourceClaimTemplate, out *v1alpha3.ResourceClaimTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_resource_ResourceClaimTemplateSpec_To_v1alpha3_ResourceClaimTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_resource_ResourceClaimTemplate_To_v1alpha3_ResourceClaimTemplate is an autogenerated conversion function. +func Convert_resource_ResourceClaimTemplate_To_v1alpha3_ResourceClaimTemplate(in *resource.ResourceClaimTemplate, out *v1alpha3.ResourceClaimTemplate, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimTemplate_To_v1alpha3_ResourceClaimTemplate(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(in *v1alpha3.ResourceClaimTemplateList, out *resource.ResourceClaimTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]resource.ResourceClaimTemplate)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(in *v1alpha3.ResourceClaimTemplateList, out *resource.ResourceClaimTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(in, out, s) +} + +func autoConvert_resource_ResourceClaimTemplateList_To_v1alpha3_ResourceClaimTemplateList(in *resource.ResourceClaimTemplateList, out *v1alpha3.ResourceClaimTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.ResourceClaimTemplate)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_resource_ResourceClaimTemplateList_To_v1alpha3_ResourceClaimTemplateList is an autogenerated conversion function. +func Convert_resource_ResourceClaimTemplateList_To_v1alpha3_ResourceClaimTemplateList(in *resource.ResourceClaimTemplateList, out *v1alpha3.ResourceClaimTemplateList, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimTemplateList_To_v1alpha3_ResourceClaimTemplateList(in, out, s) +} + +func autoConvert_v1alpha3_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(in *v1alpha3.ResourceClaimTemplateSpec, out *resource.ResourceClaimTemplateSpec, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_ResourceClaimSpec_To_resource_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha3_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(in *v1alpha3.ResourceClaimTemplateSpec, out *resource.ResourceClaimTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(in, out, s) +} + +func autoConvert_resource_ResourceClaimTemplateSpec_To_v1alpha3_ResourceClaimTemplateSpec(in *resource.ResourceClaimTemplateSpec, out *v1alpha3.ResourceClaimTemplateSpec, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_resource_ResourceClaimSpec_To_v1alpha3_ResourceClaimSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_resource_ResourceClaimTemplateSpec_To_v1alpha3_ResourceClaimTemplateSpec is an autogenerated conversion function. +func Convert_resource_ResourceClaimTemplateSpec_To_v1alpha3_ResourceClaimTemplateSpec(in *resource.ResourceClaimTemplateSpec, out *v1alpha3.ResourceClaimTemplateSpec, s conversion.Scope) error { + return autoConvert_resource_ResourceClaimTemplateSpec_To_v1alpha3_ResourceClaimTemplateSpec(in, out, s) +} + +func autoConvert_v1alpha3_ResourcePool_To_resource_ResourcePool(in *v1alpha3.ResourcePool, out *resource.ResourcePool, s conversion.Scope) error { + out.Name = in.Name + out.Generation = in.Generation + out.ResourceSliceCount = in.ResourceSliceCount + return nil +} + +// Convert_v1alpha3_ResourcePool_To_resource_ResourcePool is an autogenerated conversion function. +func Convert_v1alpha3_ResourcePool_To_resource_ResourcePool(in *v1alpha3.ResourcePool, out *resource.ResourcePool, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourcePool_To_resource_ResourcePool(in, out, s) +} + +func autoConvert_resource_ResourcePool_To_v1alpha3_ResourcePool(in *resource.ResourcePool, out *v1alpha3.ResourcePool, s conversion.Scope) error { + out.Name = in.Name + out.Generation = in.Generation + out.ResourceSliceCount = in.ResourceSliceCount + return nil +} + +// Convert_resource_ResourcePool_To_v1alpha3_ResourcePool is an autogenerated conversion function. +func Convert_resource_ResourcePool_To_v1alpha3_ResourcePool(in *resource.ResourcePool, out *v1alpha3.ResourcePool, s conversion.Scope) error { + return autoConvert_resource_ResourcePool_To_v1alpha3_ResourcePool(in, out, s) +} + +func autoConvert_v1alpha3_ResourceSlice_To_resource_ResourceSlice(in *v1alpha3.ResourceSlice, out *resource.ResourceSlice, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ResourceSlice_To_resource_ResourceSlice is an autogenerated conversion function. +func Convert_v1alpha3_ResourceSlice_To_resource_ResourceSlice(in *v1alpha3.ResourceSlice, out *resource.ResourceSlice, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceSlice_To_resource_ResourceSlice(in, out, s) +} + +func autoConvert_resource_ResourceSlice_To_v1alpha3_ResourceSlice(in *resource.ResourceSlice, out *v1alpha3.ResourceSlice, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_resource_ResourceSlice_To_v1alpha3_ResourceSlice is an autogenerated conversion function. +func Convert_resource_ResourceSlice_To_v1alpha3_ResourceSlice(in *resource.ResourceSlice, out *v1alpha3.ResourceSlice, s conversion.Scope) error { + return autoConvert_resource_ResourceSlice_To_v1alpha3_ResourceSlice(in, out, s) +} + +func autoConvert_v1alpha3_ResourceSliceList_To_resource_ResourceSliceList(in *v1alpha3.ResourceSliceList, out *resource.ResourceSliceList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]resource.ResourceSlice)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha3_ResourceSliceList_To_resource_ResourceSliceList is an autogenerated conversion function. +func Convert_v1alpha3_ResourceSliceList_To_resource_ResourceSliceList(in *v1alpha3.ResourceSliceList, out *resource.ResourceSliceList, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceSliceList_To_resource_ResourceSliceList(in, out, s) +} + +func autoConvert_resource_ResourceSliceList_To_v1alpha3_ResourceSliceList(in *resource.ResourceSliceList, out *v1alpha3.ResourceSliceList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha3.ResourceSlice)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_resource_ResourceSliceList_To_v1alpha3_ResourceSliceList is an autogenerated conversion function. +func Convert_resource_ResourceSliceList_To_v1alpha3_ResourceSliceList(in *resource.ResourceSliceList, out *v1alpha3.ResourceSliceList, s conversion.Scope) error { + return autoConvert_resource_ResourceSliceList_To_v1alpha3_ResourceSliceList(in, out, s) +} + +func autoConvert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec(in *v1alpha3.ResourceSliceSpec, out *resource.ResourceSliceSpec, s conversion.Scope) error { + out.Driver = in.Driver + if err := Convert_v1alpha3_ResourcePool_To_resource_ResourcePool(&in.Pool, &out.Pool, s); err != nil { + return err + } + out.NodeName = in.NodeName + out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector)) + out.AllNodes = in.AllNodes + out.Devices = *(*[]resource.Device)(unsafe.Pointer(&in.Devices)) + return nil +} + +// Convert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec is an autogenerated conversion function. +func Convert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec(in *v1alpha3.ResourceSliceSpec, out *resource.ResourceSliceSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceSliceSpec_To_resource_ResourceSliceSpec(in, out, s) +} + +func autoConvert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec(in *resource.ResourceSliceSpec, out *v1alpha3.ResourceSliceSpec, s conversion.Scope) error { + out.Driver = in.Driver + if err := Convert_resource_ResourcePool_To_v1alpha3_ResourcePool(&in.Pool, &out.Pool, s); err != nil { + return err + } + out.NodeName = in.NodeName + out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector)) + out.AllNodes = in.AllNodes + out.Devices = *(*[]v1alpha3.Device)(unsafe.Pointer(&in.Devices)) + return nil +} + +// Convert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec is an autogenerated conversion function. +func Convert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec(in *resource.ResourceSliceSpec, out *v1alpha3.ResourceSliceSpec, s conversion.Scope) error { + return autoConvert_resource_ResourceSliceSpec_To_v1alpha3_ResourceSliceSpec(in, out, s) +} diff --git a/pkg/apis/resource/v1alpha2/zz_generated.defaults.go b/pkg/apis/resource/v1alpha3/zz_generated.defaults.go similarity index 59% rename from pkg/apis/resource/v1alpha2/zz_generated.defaults.go rename to pkg/apis/resource/v1alpha3/zz_generated.defaults.go index bcf5e1aa5bbc9..e5386fbc9216e 100644 --- a/pkg/apis/resource/v1alpha2/zz_generated.defaults.go +++ b/pkg/apis/resource/v1alpha3/zz_generated.defaults.go @@ -19,10 +19,10 @@ limitations under the License. // Code generated by defaulter-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -30,31 +30,37 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&v1alpha2.ResourceClaim{}, func(obj interface{}) { SetObjectDefaults_ResourceClaim(obj.(*v1alpha2.ResourceClaim)) }) - scheme.AddTypeDefaultingFunc(&v1alpha2.ResourceClaimList{}, func(obj interface{}) { SetObjectDefaults_ResourceClaimList(obj.(*v1alpha2.ResourceClaimList)) }) - scheme.AddTypeDefaultingFunc(&v1alpha2.ResourceClaimTemplate{}, func(obj interface{}) { SetObjectDefaults_ResourceClaimTemplate(obj.(*v1alpha2.ResourceClaimTemplate)) }) - scheme.AddTypeDefaultingFunc(&v1alpha2.ResourceClaimTemplateList{}, func(obj interface{}) { - SetObjectDefaults_ResourceClaimTemplateList(obj.(*v1alpha2.ResourceClaimTemplateList)) + scheme.AddTypeDefaultingFunc(&v1alpha3.ResourceClaim{}, func(obj interface{}) { SetObjectDefaults_ResourceClaim(obj.(*v1alpha3.ResourceClaim)) }) + scheme.AddTypeDefaultingFunc(&v1alpha3.ResourceClaimList{}, func(obj interface{}) { SetObjectDefaults_ResourceClaimList(obj.(*v1alpha3.ResourceClaimList)) }) + scheme.AddTypeDefaultingFunc(&v1alpha3.ResourceClaimTemplate{}, func(obj interface{}) { SetObjectDefaults_ResourceClaimTemplate(obj.(*v1alpha3.ResourceClaimTemplate)) }) + scheme.AddTypeDefaultingFunc(&v1alpha3.ResourceClaimTemplateList{}, func(obj interface{}) { + SetObjectDefaults_ResourceClaimTemplateList(obj.(*v1alpha3.ResourceClaimTemplateList)) }) return nil } -func SetObjectDefaults_ResourceClaim(in *v1alpha2.ResourceClaim) { - SetDefaults_ResourceClaimSpec(&in.Spec) +func SetObjectDefaults_ResourceClaim(in *v1alpha3.ResourceClaim) { + for i := range in.Spec.Devices.Requests { + a := &in.Spec.Devices.Requests[i] + SetDefaults_DeviceRequest(a) + } } -func SetObjectDefaults_ResourceClaimList(in *v1alpha2.ResourceClaimList) { +func SetObjectDefaults_ResourceClaimList(in *v1alpha3.ResourceClaimList) { for i := range in.Items { a := &in.Items[i] SetObjectDefaults_ResourceClaim(a) } } -func SetObjectDefaults_ResourceClaimTemplate(in *v1alpha2.ResourceClaimTemplate) { - SetDefaults_ResourceClaimSpec(&in.Spec.Spec) +func SetObjectDefaults_ResourceClaimTemplate(in *v1alpha3.ResourceClaimTemplate) { + for i := range in.Spec.Spec.Devices.Requests { + a := &in.Spec.Spec.Devices.Requests[i] + SetDefaults_DeviceRequest(a) + } } -func SetObjectDefaults_ResourceClaimTemplateList(in *v1alpha2.ResourceClaimTemplateList) { +func SetObjectDefaults_ResourceClaimTemplateList(in *v1alpha3.ResourceClaimTemplateList) { for i := range in.Items { a := &in.Items[i] SetObjectDefaults_ResourceClaimTemplate(a) diff --git a/pkg/apis/resource/validation/validation.go b/pkg/apis/resource/validation/validation.go index 7b93aae7db4a9..f49e60f8ff808 100644 --- a/pkg/apis/resource/validation/validation.go +++ b/pkg/apis/resource/validation/validation.go @@ -17,172 +17,264 @@ limitations under the License. package validation import ( + "encoding/json" + "errors" + "fmt" + "regexp" + "strings" + apiequality "k8s.io/apimachinery/pkg/api/equality" + apiresource "k8s.io/apimachinery/pkg/api/resource" apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" - pathvalidation "k8s.io/apimachinery/pkg/api/validation/path" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" - utilvalidation "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/apiserver/pkg/cel" + "k8s.io/apiserver/pkg/cel/environment" + dracel "k8s.io/dynamic-resource-allocation/cel" corevalidation "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/apis/resource" - namedresourcesvalidation "k8s.io/kubernetes/pkg/apis/resource/structured/namedresources/validation" ) -// validateResourceDriverName reuses the validation of a CSI driver because -// the allowed values are exactly the same. -var validateResourceDriverName = corevalidation.ValidateCSIDriverName +var ( + // validateResourceDriverName reuses the validation of a CSI driver because + // the allowed values are exactly the same. + validateDriverName = corevalidation.ValidateCSIDriverName + validateDeviceName = corevalidation.ValidateDNS1123Subdomain + validateDeviceClassName = corevalidation.ValidateDNS1123Subdomain + validateRequestName = corevalidation.ValidateDNS1123Label +) -// ValidateClaim validates a ResourceClaim. -func ValidateClaim(resourceClaim *resource.ResourceClaim) field.ErrorList { - allErrs := corevalidation.ValidateObjectMeta(&resourceClaim.ObjectMeta, true, corevalidation.ValidateResourceClaimName, field.NewPath("metadata")) - allErrs = append(allErrs, validateResourceClaimSpec(&resourceClaim.Spec, field.NewPath("spec"))...) +func validatePoolName(name string, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if name == "" { + allErrs = append(allErrs, field.Required(fldPath, "")) + } else { + if len(name) > resource.PoolNameMaxLength { + allErrs = append(allErrs, field.TooLongMaxLength(fldPath, name, resource.PoolNameMaxLength)) + } + parts := strings.Split(name, "/") + for i, part := range parts { + idxPath := fldPath + if len(parts) > 1 { + idxPath = idxPath.Index(i) + } + allErrs = append(allErrs, corevalidation.ValidateDNS1123Subdomain(part, idxPath)...) + } + } return allErrs } -func validateResourceClaimSpec(spec *resource.ResourceClaimSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - for _, msg := range corevalidation.ValidateClassName(spec.ResourceClassName, false) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceClassName"), spec.ResourceClassName, msg)) - } - allErrs = append(allErrs, validateResourceClaimParametersRef(spec.ParametersRef, fldPath.Child("parametersRef"))...) - if !supportedAllocationModes.Has(string(spec.AllocationMode)) { - allErrs = append(allErrs, field.NotSupported(fldPath.Child("allocationMode"), spec.AllocationMode, supportedAllocationModes.List())) - } +// ValidateResourceClaim validates a ResourceClaim. +func ValidateResourceClaim(resourceClaim *resource.ResourceClaim) field.ErrorList { + allErrs := corevalidation.ValidateObjectMeta(&resourceClaim.ObjectMeta, true, corevalidation.ValidateResourceClaimName, field.NewPath("metadata")) + allErrs = append(allErrs, validateResourceClaimSpec(&resourceClaim.Spec, field.NewPath("spec"), false)...) return allErrs } -var supportedAllocationModes = sets.NewString(string(resource.AllocationModeImmediate), string(resource.AllocationModeWaitForFirstConsumer)) - -// It would have been nice to use Go generics to reuse the same validation -// function for Kind and Name in both types, but generics cannot be used to -// access common fields in structs. - -func validateResourceClaimParametersRef(ref *resource.ResourceClaimParametersReference, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList +// ValidateResourceClaimUpdate tests if an update to ResourceClaim is valid. +func ValidateResourceClaimUpdate(resourceClaim, oldClaim *resource.ResourceClaim) field.ErrorList { + allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClaim.ObjectMeta, &oldClaim.ObjectMeta, field.NewPath("metadata")) + allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(resourceClaim.Spec, oldClaim.Spec, field.NewPath("spec"))...) + // Because the spec is immutable, all CEL expressions in it must have been stored. + // If the user tries an update, this is not true and checking is less strict, but + // as there are errors, it doesn't matter. + allErrs = append(allErrs, validateResourceClaimSpec(&resourceClaim.Spec, field.NewPath("spec"), true)...) + return allErrs +} - if ref == nil { - return allErrs - } +// ValidateResourceClaimStatusUpdate tests if an update to the status of a ResourceClaim is valid. +func ValidateResourceClaimStatusUpdate(resourceClaim, oldClaim *resource.ResourceClaim) field.ErrorList { + allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClaim.ObjectMeta, &oldClaim.ObjectMeta, field.NewPath("metadata")) + requestNames := gatherRequestNames(&resourceClaim.Spec.Devices) + allErrs = append(allErrs, validateResourceClaimStatusUpdate(&resourceClaim.Status, &oldClaim.Status, resourceClaim.DeletionTimestamp != nil, requestNames, field.NewPath("status"))...) + return allErrs +} - // group is required but the Core group is the empty value, so it can not be enforced. - if ref.APIGroup != "" { - for _, msg := range utilvalidation.IsDNS1123Subdomain(ref.APIGroup) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("apiGroup"), ref.APIGroup, msg)) - } +func validateResourceClaimSpec(spec *resource.ResourceClaimSpec, fldPath *field.Path, stored bool) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, validateDeviceClaim(&spec.Devices, fldPath.Child("devices"), stored)...) + if spec.Controller != "" { + allErrs = append(allErrs, validateDriverName(spec.Controller, fldPath.Child("controller"))...) } + return allErrs +} - if ref.Kind == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("kind"), "")) +func validateDeviceClaim(deviceClaim *resource.DeviceClaim, fldPath *field.Path, stored bool) field.ErrorList { + allErrs := field.ErrorList{} + requestNames := gatherRequestNames(deviceClaim) + allErrs = append(allErrs, validateSet(deviceClaim.Requests, resource.DeviceRequestsMaxSize, + func(request resource.DeviceRequest, fldPath *field.Path) field.ErrorList { + return validateDeviceRequest(request, fldPath, stored) + }, + func(request resource.DeviceRequest) (string, string) { + return request.Name, "name" + }, + fldPath.Child("requests"))...) + allErrs = append(allErrs, validateSlice(deviceClaim.Constraints, resource.DeviceConstraintsMaxSize, + func(constraint resource.DeviceConstraint, fldPath *field.Path) field.ErrorList { + return validateDeviceConstraint(constraint, fldPath, requestNames) + }, fldPath.Child("constraints"))...) + allErrs = append(allErrs, validateSlice(deviceClaim.Config, resource.DeviceConfigMaxSize, + func(config resource.DeviceClaimConfiguration, fldPath *field.Path) field.ErrorList { + return validateDeviceClaimConfiguration(config, fldPath, requestNames) + }, fldPath.Child("config"))...) + return allErrs +} + +func gatherRequestNames(deviceClaim *resource.DeviceClaim) sets.Set[string] { + requestNames := sets.New[string]() + for _, request := range deviceClaim.Requests { + requestNames.Insert(request.Name) + } + return requestNames +} + +func validateDeviceRequest(request resource.DeviceRequest, fldPath *field.Path, stored bool) field.ErrorList { + allErrs := validateRequestName(request.Name, fldPath.Child("name")) + if request.DeviceClassName == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("deviceClassName"), "")) } else { - for _, msg := range pathvalidation.IsValidPathSegmentName(ref.Kind) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), ref.Kind, msg)) + allErrs = append(allErrs, validateDeviceClassName(request.DeviceClassName, fldPath.Child("deviceClassName"))...) + } + allErrs = append(allErrs, validateSlice(request.Selectors, resource.DeviceSelectorsMaxSize, + func(selector resource.DeviceSelector, fldPath *field.Path) field.ErrorList { + return validateSelector(selector, fldPath, stored) + }, + fldPath.Child("selectors"))...) + switch request.CountMode { + case resource.DeviceCountModeAll: + if request.Count != 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("count"), request.Count, "a non-zero count is not valid for countMode="+string(request.CountMode))) + } + case resource.DeviceCountModeExact: + if request.Count <= 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("count"), request.Count, "must be greater than zero")) } + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("countMode"), request.Count, fmt.Sprintf("must be one of: %s", strings.Join([]string{string(resource.DeviceCountModeAll), string(resource.DeviceCountModeExact)}, ", ")))) } + return allErrs +} - if ref.Name == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) +func validateSelector(selector resource.DeviceSelector, fldPath *field.Path, stored bool) field.ErrorList { + var allErrs field.ErrorList + if selector.CEL == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("cel"), "")) } else { - for _, msg := range pathvalidation.IsValidPathSegmentName(ref.Name) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), ref.Name, msg)) - } + allErrs = append(allErrs, validateCELSelector(*selector.CEL, fldPath.Child("cel"), stored)...) } return allErrs } -func validateClassParameters(ref *resource.ResourceClassParametersReference, fldPath *field.Path) field.ErrorList { +func validateCELSelector(celSelector resource.CELDeviceSelector, fldPath *field.Path, stored bool) field.ErrorList { var allErrs field.ErrorList - - if ref == nil { - return allErrs + envType := environment.NewExpressions + if stored { + envType = environment.StoredExpressions } - - // group is required but the Core group is the empty value, so it can not be enforced. - if ref.APIGroup != "" { - for _, msg := range utilvalidation.IsDNS1123Subdomain(ref.APIGroup) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("apiGroup"), ref.APIGroup, msg)) - } + result := dracel.Compiler.CompileCELExpression(celSelector.Expression, envType) + if result.Error != nil { + allErrs = append(allErrs, convertCELErrorToValidationError(fldPath, celSelector.Expression, result.Error)) } + return allErrs +} - if ref.Kind == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("kind"), "")) - } else { - for _, msg := range pathvalidation.IsValidPathSegmentName(ref.Kind) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), ref.Kind, msg)) +func convertCELErrorToValidationError(fldPath *field.Path, expression string, err error) *field.Error { + var celErr *cel.Error + if errors.As(err, &celErr) { + switch celErr.Type { + case cel.ErrorTypeRequired: + return field.Required(fldPath, celErr.Detail) + case cel.ErrorTypeInvalid: + return field.Invalid(fldPath, expression, celErr.Detail) + case cel.ErrorTypeInternal: + return field.InternalError(fldPath, celErr) } } + return field.InternalError(fldPath, fmt.Errorf("unsupported error type: %w", err)) +} - if ref.Name == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) +func validateDeviceConstraint(constraint resource.DeviceConstraint, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { + var allErrs field.ErrorList + allErrs = append(allErrs, validateSet(constraint.Requests, resource.DeviceRequestsMaxSize, + func(name string, fldPath *field.Path) field.ErrorList { + return validateRequestNameRef(name, fldPath, requestNames) + }, + stringKey, fldPath.Child("requests"))...) + if constraint.MatchAttribute == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("matchAttribute"), "")) } else { - for _, msg := range pathvalidation.IsValidPathSegmentName(ref.Name) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), ref.Name, msg)) - } - } - - // namespace is optional. - if ref.Namespace != "" { - for _, msg := range apimachineryvalidation.ValidateNamespaceName(ref.Namespace, false) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("namespace"), ref.Namespace, msg)) - } + allErrs = append(allErrs, validateFullyQualifiedName(*constraint.MatchAttribute, fldPath.Child("matchAttribute"))...) } return allErrs } -// ValidateClass validates a ResourceClass. -func ValidateClass(resourceClass *resource.ResourceClass) field.ErrorList { - allErrs := corevalidation.ValidateObjectMeta(&resourceClass.ObjectMeta, false, corevalidation.ValidateClassName, field.NewPath("metadata")) - allErrs = append(allErrs, validateResourceDriverName(resourceClass.DriverName, field.NewPath("driverName"))...) - allErrs = append(allErrs, validateClassParameters(resourceClass.ParametersRef, field.NewPath("parametersRef"))...) - if resourceClass.SuitableNodes != nil { - allErrs = append(allErrs, corevalidation.ValidateNodeSelector(resourceClass.SuitableNodes, field.NewPath("suitableNodes"))...) - } - +func validateDeviceClaimConfiguration(config resource.DeviceClaimConfiguration, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { + var allErrs field.ErrorList + allErrs = append(allErrs, validateSet(config.Requests, resource.DeviceRequestsMaxSize, + func(name string, fldPath *field.Path) field.ErrorList { + return validateRequestNameRef(name, fldPath, requestNames) + }, stringKey, fldPath.Child("requests"))...) + allErrs = append(allErrs, validateDeviceConfiguration(config.DeviceConfiguration, fldPath)...) return allErrs } -// ValidateClassUpdate tests if an update to ResourceClass is valid. -func ValidateClassUpdate(resourceClass, oldClass *resource.ResourceClass) field.ErrorList { - allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClass.ObjectMeta, &oldClass.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateClass(resourceClass)...) +func validateRequestNameRef(name string, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { + allErrs := validateRequestName(name, fldPath) + if !requestNames.Has(name) { + allErrs = append(allErrs, field.Invalid(fldPath, name, "must be the name of a request in the claim")) + } return allErrs } -// ValidateClaimUpdate tests if an update to ResourceClaim is valid. -func ValidateClaimUpdate(resourceClaim, oldClaim *resource.ResourceClaim) field.ErrorList { - allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClaim.ObjectMeta, &oldClaim.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(resourceClaim.Spec, oldClaim.Spec, field.NewPath("spec"))...) - allErrs = append(allErrs, ValidateClaim(resourceClaim)...) +func validateDeviceConfiguration(config resource.DeviceConfiguration, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if config.Opaque == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("opaque"), "")) + } else { + allErrs = append(allErrs, validateOpaqueConfiguration(*config.Opaque, fldPath.Child("opaque"))...) + } return allErrs } -// ValidateClaimStatusUpdate tests if an update to the status of a ResourceClaim is valid. -func ValidateClaimStatusUpdate(resourceClaim, oldClaim *resource.ResourceClaim) field.ErrorList { - allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClaim.ObjectMeta, &oldClaim.ObjectMeta, field.NewPath("metadata")) - fldPath := field.NewPath("status") - // The name might not be set yet. - if resourceClaim.Status.DriverName != "" { - allErrs = append(allErrs, validateResourceDriverName(resourceClaim.Status.DriverName, fldPath.Child("driverName"))...) - } else if resourceClaim.Status.Allocation != nil { - allErrs = append(allErrs, field.Required(fldPath.Child("driverName"), "must be specified when `allocation` is set")) +func validateOpaqueConfiguration(config resource.OpaqueDeviceConfiguration, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + allErrs = append(allErrs, validateDriverName(config.Driver, fldPath.Child("driver"))...) + // Validation of RawExtension as in https://github.com/kubernetes/kubernetes/pull/125549/ + var v any + if len(config.Parameters.Raw) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("parameters"), "")) + } else if err := json.Unmarshal(config.Parameters.Raw, &v); err != nil { + allErrs = append(allErrs, field.Invalid(fldPath.Child("parameters"), "", fmt.Sprintf("error parsing data: %v", err.Error()))) + } else if v == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("parameters"), "")) + } else if _, isObject := v.(map[string]any); !isObject { + allErrs = append(allErrs, field.Invalid(fldPath.Child("parameters"), "", "parameters must be a valid JSON object")) } - allErrs = append(allErrs, validateAllocationResult(resourceClaim.Status.Allocation, fldPath.Child("allocation"))...) - allErrs = append(allErrs, validateResourceClaimConsumers(resourceClaim.Status.ReservedFor, resource.ResourceClaimReservedForMaxSize, fldPath.Child("reservedFor"))...) + return allErrs +} + +func validateResourceClaimStatusUpdate(status, oldStatus *resource.ResourceClaimStatus, claimDeleted bool, requestNames sets.Set[string], fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + allErrs = append(allErrs, validateAllocationResult(status.Allocation, fldPath.Child("allocation"), requestNames)...) + allErrs = append(allErrs, validateSet(status.ReservedFor, resource.ResourceClaimReservedForMaxSize, + validateResourceClaimUserReference, + func(consumer resource.ResourceClaimConsumerReference) (types.UID, string) { return consumer.UID, "uid" }, + fldPath.Child("reservedFor"))...) // Now check for invariants that must be valid for a ResourceClaim. - if len(resourceClaim.Status.ReservedFor) > 0 { - if resourceClaim.Status.Allocation == nil { + if len(status.ReservedFor) > 0 { + if status.Allocation == nil { allErrs = append(allErrs, field.Forbidden(fldPath.Child("reservedFor"), "may not be specified when `allocated` is not set")) } else { - if !resourceClaim.Status.Allocation.Shareable && len(resourceClaim.Status.ReservedFor) > 1 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("reservedFor"), "may not be reserved more than once")) - } // Items may be removed from ReservedFor while the claim is meant to be deallocated, // but not added. - if resourceClaim.DeletionTimestamp != nil || resourceClaim.Status.DeallocationRequested { - oldSet := sets.New(oldClaim.Status.ReservedFor...) - newSet := sets.New(resourceClaim.Status.ReservedFor...) + if claimDeleted || status.DeallocationRequested { + oldSet := sets.New(oldStatus.ReservedFor...) + newSet := sets.New(status.ReservedFor...) newItems := newSet.Difference(oldSet) if len(newItems) > 0 { allErrs = append(allErrs, field.Forbidden(fldPath.Child("reservedFor"), "new entries may not be added while `deallocationRequested` or `deletionTimestamp` are set")) @@ -191,19 +283,19 @@ func ValidateClaimStatusUpdate(resourceClaim, oldClaim *resource.ResourceClaim) } } - // Updates to a populated resourceClaim.Status.Allocation are not allowed - if oldClaim.Status.Allocation != nil && resourceClaim.Status.Allocation != nil { - allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(resourceClaim.Status.Allocation, oldClaim.Status.Allocation, fldPath.Child("allocation"))...) + // Updates to a populated status.Allocation are not allowed + if oldStatus.Allocation != nil && status.Allocation != nil { + allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(status.Allocation, oldStatus.Allocation, fldPath.Child("allocation"))...) } - if !oldClaim.Status.DeallocationRequested && - resourceClaim.Status.DeallocationRequested && - len(resourceClaim.Status.ReservedFor) > 0 { + if !oldStatus.DeallocationRequested && + status.DeallocationRequested && + len(status.ReservedFor) > 0 { allErrs = append(allErrs, field.Forbidden(fldPath.Child("deallocationRequested"), "deallocation cannot be requested while `reservedFor` is set")) } - if resourceClaim.Status.Allocation == nil && - resourceClaim.Status.DeallocationRequested { + if status.Allocation == nil && + status.DeallocationRequested { // Either one or the other field was modified incorrectly. // For the sake of simplicity this only reports the invalid // end result. @@ -214,146 +306,130 @@ func ValidateClaimStatusUpdate(resourceClaim, oldClaim *resource.ResourceClaim) // anymore because the deallocation may already have started. The field // can only get reset by the driver together with removing the // allocation. - if oldClaim.Status.DeallocationRequested && - !resourceClaim.Status.DeallocationRequested && - resourceClaim.Status.Allocation != nil { + if oldStatus.DeallocationRequested && + !status.DeallocationRequested && + status.Allocation != nil { allErrs = append(allErrs, field.Forbidden(fldPath.Child("deallocationRequested"), "may not be cleared when `allocation` is set")) } return allErrs } -func validateAllocationResult(allocation *resource.AllocationResult, fldPath *field.Path) field.ErrorList { +func validateResourceClaimUserReference(ref resource.ResourceClaimConsumerReference, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - if allocation != nil { - if len(allocation.ResourceHandles) > 0 { - allErrs = append(allErrs, validateResourceHandles(allocation.ResourceHandles, resource.AllocationResultResourceHandlesMaxSize, fldPath.Child("resourceHandles"))...) - } - if allocation.AvailableOnNodes != nil { - allErrs = append(allErrs, corevalidation.ValidateNodeSelector(allocation.AvailableOnNodes, fldPath.Child("availableOnNodes"))...) - } + if ref.Resource == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("resource"), "")) + } + if ref.Name == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) + } + if ref.UID == "" { + allErrs = append(allErrs, field.Required(fldPath.Child("uid"), "")) } return allErrs } -func validateResourceHandles(resourceHandles []resource.ResourceHandle, maxSize int, fldPath *field.Path) field.ErrorList { +func validateAllocationResult(allocation *resource.AllocationResult, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { + if allocation == nil { + return nil + } + var allErrs field.ErrorList - for i, resourceHandle := range resourceHandles { - idxPath := fldPath.Index(i) - allErrs = append(allErrs, validateResourceDriverName(resourceHandle.DriverName, idxPath.Child("driverName"))...) - if len(resourceHandle.Data) > resource.ResourceHandleDataMaxSize { - allErrs = append(allErrs, field.TooLongMaxLength(idxPath.Child("data"), len(resourceHandle.Data), resource.ResourceHandleDataMaxSize)) - } - if resourceHandle.StructuredData != nil { - allErrs = append(allErrs, validateStructuredResourceHandle(resourceHandle.StructuredData, idxPath.Child("structuredData"))...) - } - if len(resourceHandle.Data) > 0 && resourceHandle.StructuredData != nil { - allErrs = append(allErrs, field.Invalid(idxPath, nil, "data and structuredData are mutually exclusive")) - } + allErrs = append(allErrs, validateDeviceAllocationResult(allocation.Devices, fldPath.Child("devices"), requestNames)...) + if allocation.NodeSelector != nil { + allErrs = append(allErrs, corevalidation.ValidateNodeSelector(allocation.NodeSelector, fldPath.Child("nodeSelector"))...) } - if len(resourceHandles) > maxSize { - // Dumping the entire field into the error message is likely to be too long, - // in particular when it is already beyond the maximum size. Instead this - // just shows the number of entries. - allErrs = append(allErrs, field.TooLongMaxLength(fldPath, len(resourceHandles), maxSize)) + if allocation.Controller != "" { + allErrs = append(allErrs, validateDriverName(allocation.Controller, fldPath.Child("controller"))...) } return allErrs } -func validateStructuredResourceHandle(handle *resource.StructuredResourceHandle, fldPath *field.Path) field.ErrorList { +func validateDeviceAllocationResult(allocation resource.DeviceAllocationResult, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { var allErrs field.ErrorList - if handle.NodeName != "" { - allErrs = append(allErrs, validateNodeName(handle.NodeName, fldPath.Child("nodeName"))...) - } - allErrs = append(allErrs, validateDriverAllocationResults(handle.Results, fldPath.Child("results"))...) + allErrs = append(allErrs, validateSlice(allocation.Results, resource.AllocationResultsMaxSize, + func(result resource.DeviceRequestAllocationResult, fldPath *field.Path) field.ErrorList { + return validateDeviceRequestAllocationResult(result, fldPath, requestNames) + }, fldPath.Child("results"))...) + allErrs = append(allErrs, validateSlice(allocation.Config, 2*resource.DeviceConfigMaxSize, /* class + claim */ + func(config resource.DeviceAllocationConfiguration, fldPath *field.Path) field.ErrorList { + return validateDeviceAllocationConfiguration(config, fldPath, requestNames) + }, fldPath.Child("config"))...) + return allErrs } -func validateDriverAllocationResults(results []resource.DriverAllocationResult, fldPath *field.Path) field.ErrorList { +func validateDeviceRequestAllocationResult(result resource.DeviceRequestAllocationResult, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { var allErrs field.ErrorList - for index, result := range results { - idxPath := fldPath.Index(index) - allErrs = append(allErrs, validateAllocationResultModel(&result.AllocationResultModel, idxPath)...) - } + allErrs = append(allErrs, validateRequestNameRef(result.Request, fldPath.Child("request"), requestNames)...) + allErrs = append(allErrs, validateDriverName(result.Driver, fldPath.Child("driver"))...) + allErrs = append(allErrs, validatePoolName(result.Pool, fldPath.Child("pool"))...) + allErrs = append(allErrs, validateDeviceName(result.Device, fldPath.Child("device"))...) return allErrs } -func validateAllocationResultModel(model *resource.AllocationResultModel, fldPath *field.Path) field.ErrorList { +func validateDeviceAllocationConfiguration(config resource.DeviceAllocationConfiguration, fldPath *field.Path, requestNames sets.Set[string]) field.ErrorList { var allErrs field.ErrorList - entries := sets.New[string]() - if model.NamedResources != nil { - entries.Insert("namedResources") - allErrs = append(allErrs, namedresourcesvalidation.ValidateAllocationResult(model.NamedResources, fldPath.Child("namedResources"))...) - } - switch len(entries) { - case 0: - allErrs = append(allErrs, field.Required(fldPath, "exactly one structured model field must be set")) - case 1: - // Okay. - default: - allErrs = append(allErrs, field.Invalid(fldPath, sets.List(entries), "exactly one field must be set, not several")) - } + allErrs = append(allErrs, validateAllocationConfigSource(config.Source, fldPath.Child("source"))...) + allErrs = append(allErrs, validateSet(config.Requests, resource.DeviceRequestsMaxSize, + func(name string, fldPath *field.Path) field.ErrorList { + return validateRequestNameRef(name, fldPath, requestNames) + }, stringKey, fldPath.Child("requests"))...) + allErrs = append(allErrs, validateDeviceConfiguration(config.DeviceConfiguration, fldPath)...) return allErrs } -func validateResourceClaimUserReference(ref resource.ResourceClaimConsumerReference, fldPath *field.Path) field.ErrorList { +func validateAllocationConfigSource(source resource.AllocationConfigSource, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - if ref.Resource == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("resource"), "")) - } - if ref.Name == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) - } - if ref.UID == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("uid"), "")) + switch source { + case "": + allErrs = append(allErrs, field.Required(fldPath, "")) + case resource.AllocationConfigSourceClaim, resource.AllocationConfigSourceClass: + default: + allErrs = append(allErrs, field.Invalid(fldPath, source, fmt.Sprintf("must be one of: %s", strings.Join([]string{string(resource.AllocationConfigSourceClaim), string(resource.AllocationConfigSourceClass)}, ", ")))) } return allErrs } -// validateSliceIsASet ensures that a slice contains no duplicates and does not exceed a certain maximum size. -func validateSliceIsASet[T comparable](slice []T, maxSize int, validateItem func(item T, fldPath *field.Path) field.ErrorList, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - allItems := sets.New[T]() - for i, item := range slice { - idxPath := fldPath.Index(i) - if allItems.Has(item) { - allErrs = append(allErrs, field.Duplicate(idxPath, item)) - } else { - allErrs = append(allErrs, validateItem(item, idxPath)...) - allItems.Insert(item) - } - } - if len(slice) > maxSize { - // Dumping the entire field into the error message is likely to be too long, - // in particular when it is already beyond the maximum size. Instead this - // just shows the number of entries. - allErrs = append(allErrs, field.TooLongMaxLength(fldPath, len(slice), maxSize)) - } +// ValidateClass validates a DeviceClass. +func ValidateDeviceClass(class *resource.DeviceClass) field.ErrorList { + allErrs := corevalidation.ValidateObjectMeta(&class.ObjectMeta, false, corevalidation.ValidateClassName, field.NewPath("metadata")) + allErrs = append(allErrs, validateDeviceClassSpec(&class.Spec, nil, field.NewPath("spec"))...) return allErrs } -// validateResourceClaimConsumers ensures that the slice contains no duplicate UIDs and does not exceed a certain maximum size. -func validateResourceClaimConsumers(consumers []resource.ResourceClaimConsumerReference, maxSize int, fldPath *field.Path) field.ErrorList { +// ValidateClassUpdate tests if an update to DeviceClass is valid. +func ValidateDeviceClassUpdate(class, oldClass *resource.DeviceClass) field.ErrorList { + allErrs := corevalidation.ValidateObjectMetaUpdate(&class.ObjectMeta, &oldClass.ObjectMeta, field.NewPath("metadata")) + allErrs = append(allErrs, validateDeviceClassSpec(&class.Spec, &oldClass.Spec, field.NewPath("spec"))...) + return allErrs +} + +func validateDeviceClassSpec(spec, oldSpec *resource.DeviceClassSpec, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - allUIDs := sets.New[types.UID]() - for i, consumer := range consumers { - idxPath := fldPath.Index(i) - if allUIDs.Has(consumer.UID) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("uid"), consumer.UID)) - } else { - allErrs = append(allErrs, validateResourceClaimUserReference(consumer, idxPath)...) - allUIDs.Insert(consumer.UID) - } + // If the selectors are exactly as before, we treat the CEL expressions as "stored". + // Any change, including merely reordering selectors, triggers validation as new + // expressions. + stored := false + if oldSpec != nil { + stored = apiequality.Semantic.DeepEqual(spec.Selectors, oldSpec.Selectors) } - if len(consumers) > maxSize { - // Dumping the entire field into the error message is likely to be too long, - // in particular when it is already beyond the maximum size. Instead this - // just shows the number of entries. - allErrs = append(allErrs, field.TooLongMaxLength(fldPath, len(consumers), maxSize)) + allErrs = append(allErrs, validateSlice(spec.Selectors, resource.DeviceSelectorsMaxSize, + func(selector resource.DeviceSelector, fldPath *field.Path) field.ErrorList { + return validateSelector(selector, fldPath, stored) + }, + fldPath.Child("selectors"))...) + allErrs = append(allErrs, validateSlice(spec.Config, resource.DeviceConfigMaxSize, validateDeviceClassConfiguration, fldPath.Child("config"))...) + if spec.SuitableNodes != nil { + allErrs = append(allErrs, corevalidation.ValidateNodeSelector(spec.SuitableNodes, field.NewPath("suitableNodes"))...) } return allErrs } +func validateDeviceClassConfiguration(config resource.DeviceClassConfiguration, fldPath *field.Path) field.ErrorList { + return validateDeviceConfiguration(config.DeviceConfiguration, fldPath) +} + // ValidatePodSchedulingContext validates a PodSchedulingContext. func ValidatePodSchedulingContexts(schedulingCtx *resource.PodSchedulingContext) field.ErrorList { allErrs := corevalidation.ValidateObjectMeta(&schedulingCtx.ObjectMeta, true, corevalidation.ValidatePodName, field.NewPath("metadata")) @@ -362,7 +438,7 @@ func ValidatePodSchedulingContexts(schedulingCtx *resource.PodSchedulingContext) } func validatePodSchedulingSpec(spec *resource.PodSchedulingContextSpec, fldPath *field.Path) field.ErrorList { - allErrs := validateSliceIsASet(spec.PotentialNodes, resource.PodSchedulingNodeListMaxSize, validateNodeName, fldPath.Child("potentialNodes")) + allErrs := validateSet(spec.PotentialNodes, resource.PodSchedulingNodeListMaxSize, validateNodeName, stringKey, fldPath.Child("potentialNodes")) return allErrs } @@ -399,28 +475,31 @@ func validatePodSchedulingClaims(claimStatuses []resource.ResourceClaimSchedulin } func validatePodSchedulingClaim(status resource.ResourceClaimSchedulingStatus, fldPath *field.Path) field.ErrorList { - allErrs := validateSliceIsASet(status.UnsuitableNodes, resource.PodSchedulingNodeListMaxSize, validateNodeName, fldPath.Child("unsuitableNodes")) + allErrs := validateSet(status.UnsuitableNodes, resource.PodSchedulingNodeListMaxSize, validateNodeName, stringKey, fldPath.Child("unsuitableNodes")) return allErrs } -// ValidateClaimTemplace validates a ResourceClaimTemplate. -func ValidateClaimTemplate(template *resource.ResourceClaimTemplate) field.ErrorList { +// ValidateResourceClaimTemplate validates a ResourceClaimTemplate. +func ValidateResourceClaimTemplate(template *resource.ResourceClaimTemplate) field.ErrorList { allErrs := corevalidation.ValidateObjectMeta(&template.ObjectMeta, true, corevalidation.ValidateResourceClaimTemplateName, field.NewPath("metadata")) - allErrs = append(allErrs, validateResourceClaimTemplateSpec(&template.Spec, field.NewPath("spec"))...) + allErrs = append(allErrs, validateResourceClaimTemplateSpec(&template.Spec, field.NewPath("spec"), false)...) return allErrs } -func validateResourceClaimTemplateSpec(spec *resource.ResourceClaimTemplateSpec, fldPath *field.Path) field.ErrorList { +func validateResourceClaimTemplateSpec(spec *resource.ResourceClaimTemplateSpec, fldPath *field.Path, stored bool) field.ErrorList { allErrs := corevalidation.ValidateTemplateObjectMeta(&spec.ObjectMeta, fldPath.Child("metadata")) - allErrs = append(allErrs, validateResourceClaimSpec(&spec.Spec, fldPath.Child("spec"))...) + allErrs = append(allErrs, validateResourceClaimSpec(&spec.Spec, fldPath.Child("spec"), stored)...) return allErrs } -// ValidateClaimTemplateUpdate tests if an update to template is valid. -func ValidateClaimTemplateUpdate(template, oldTemplate *resource.ResourceClaimTemplate) field.ErrorList { +// ValidateResourceClaimTemplateUpdate tests if an update to template is valid. +func ValidateResourceClaimTemplateUpdate(template, oldTemplate *resource.ResourceClaimTemplate) field.ErrorList { allErrs := corevalidation.ValidateObjectMetaUpdate(&template.ObjectMeta, &oldTemplate.ObjectMeta, field.NewPath("metadata")) allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(template.Spec, oldTemplate.Spec, field.NewPath("spec"))...) - allErrs = append(allErrs, ValidateClaimTemplate(template)...) + // Because the spec is immutable, all CEL expressions in it must have been stored. + // If the user tries an update, this is not true and checking is less strict, but + // as there are errors, it doesn't matter. + allErrs = append(allErrs, validateResourceClaimTemplateSpec(&template.Spec, field.NewPath("spec"), true)...) return allErrs } @@ -433,179 +512,244 @@ func validateNodeName(name string, fldPath *field.Path) field.ErrorList { } // ValidateResourceSlice tests if a ResourceSlice object is valid. -func ValidateResourceSlice(resourceSlice *resource.ResourceSlice) field.ErrorList { - allErrs := corevalidation.ValidateObjectMeta(&resourceSlice.ObjectMeta, false, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata")) - if resourceSlice.NodeName != "" { - allErrs = append(allErrs, validateNodeName(resourceSlice.NodeName, field.NewPath("nodeName"))...) - } - allErrs = append(allErrs, validateResourceDriverName(resourceSlice.DriverName, field.NewPath("driverName"))...) - allErrs = append(allErrs, validateResourceModel(&resourceSlice.ResourceModel, nil)...) +func ValidateResourceSlice(slice *resource.ResourceSlice) field.ErrorList { + allErrs := corevalidation.ValidateObjectMeta(&slice.ObjectMeta, false, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata")) + allErrs = append(allErrs, validateResourceSliceSpec(&slice.Spec, nil, field.NewPath("spec"))...) + return allErrs +} + +// ValidateResourceSlice tests if a ResourceSlice update is valid. +func ValidateResourceSliceUpdate(resourceSlice, oldResourceSlice *resource.ResourceSlice) field.ErrorList { + allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceSlice.ObjectMeta, &oldResourceSlice.ObjectMeta, field.NewPath("metadata")) + allErrs = append(allErrs, validateResourceSliceSpec(&resourceSlice.Spec, &oldResourceSlice.Spec, field.NewPath("spec"))...) return allErrs } -func validateResourceModel(model *resource.ResourceModel, fldPath *field.Path) field.ErrorList { +func validateResourceSliceSpec(spec, oldSpec *resource.ResourceSliceSpec, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - entries := sets.New[string]() - if model.NamedResources != nil { - entries.Insert("namedResources") - allErrs = append(allErrs, namedresourcesvalidation.ValidateResources(model.NamedResources, fldPath.Child("namedResources"))...) + allErrs = append(allErrs, validateDriverName(spec.Driver, fldPath.Child("driver"))...) + allErrs = append(allErrs, validateResourcePool(spec.Pool, fldPath.Child("pool"))...) + nodeSelectionFields := sets.New[string]() + if spec.NodeName != "" { + nodeSelectionFields.Insert("nodeName") + allErrs = append(allErrs, validateNodeName(spec.NodeName, fldPath.Child("nodeName"))...) } - switch len(entries) { + if spec.NodeSelector != nil { + nodeSelectionFields.Insert("nodeSelector") + allErrs = append(allErrs, corevalidation.ValidateNodeSelector(spec.NodeSelector, fldPath.Child("nodeSelector"))...) + } + if spec.AllNodes { + nodeSelectionFields.Insert("allNodes") + } + switch nodeSelectionFields.Len() { case 0: - allErrs = append(allErrs, field.Required(fldPath, "exactly one structured model field must be set")) + allErrs = append(allErrs, field.Required(fldPath, "exactly one of nodeName, nodeSelector or allNodes is required")) case 1: - // Okay. default: - allErrs = append(allErrs, field.Invalid(fldPath, sets.List(entries), "exactly one field must be set, not several")) + allErrs = append(allErrs, field.Invalid(fldPath, sets.List(nodeSelectionFields), "these fields are mutually exclusive")) + } + allErrs = append(allErrs, validateSet(spec.Devices, resource.ResourceSliceMaxDevices, validateDevice, + func(device resource.Device) (string, string) { + return device.Name, "name" + }, fldPath.Child("devices"))...) + if oldSpec != nil { + allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(spec.Pool, oldSpec.Pool, fldPath.Child("pool"))...) + allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(spec.Driver, oldSpec.Driver, fldPath.Child("driver"))...) + allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(spec.NodeName, oldSpec.NodeName, fldPath.Child("nodeName"))...) } return allErrs } -// ValidateResourceSlice tests if a ResourceSlice update is valid. -func ValidateResourceSliceUpdate(resourceSlice, oldResourceSlice *resource.ResourceSlice) field.ErrorList { - allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceSlice.ObjectMeta, &oldResourceSlice.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateResourceSlice(resourceSlice)...) - allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(resourceSlice.NodeName, oldResourceSlice.NodeName, field.NewPath("nodeName"))...) - allErrs = append(allErrs, apimachineryvalidation.ValidateImmutableField(resourceSlice.DriverName, oldResourceSlice.DriverName, field.NewPath("driverName"))...) - return allErrs -} - -// ValidateResourceClaimParameters tests if a ResourceClaimParameters object is valid for creation. -func ValidateResourceClaimParameters(parameters *resource.ResourceClaimParameters) field.ErrorList { - return validateResourceClaimParameters(parameters, false) -} - -func validateResourceClaimParameters(parameters *resource.ResourceClaimParameters, requestStored bool) field.ErrorList { - allErrs := corevalidation.ValidateObjectMeta(¶meters.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata")) - allErrs = append(allErrs, validateResourceClaimParametersRef(parameters.GeneratedFrom, field.NewPath("generatedFrom"))...) - allErrs = append(allErrs, validateDriverRequests(parameters.DriverRequests, field.NewPath("driverRequests"), requestStored)...) +func validateResourcePool(pool resource.ResourcePool, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + allErrs = append(allErrs, validatePoolName(pool.Name, fldPath.Child("name"))...) + if pool.ResourceSliceCount <= 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceSliceCount"), pool.ResourceSliceCount, "must be greater than zero")) + } return allErrs } -func validateDriverRequests(requests []resource.DriverRequests, fldPath *field.Path, requestStored bool) field.ErrorList { +func validateDevice(device resource.Device, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - driverNames := sets.New[string]() - for i, request := range requests { - idxPath := fldPath.Index(i) - driverName := request.DriverName - allErrs = append(allErrs, validateResourceDriverName(driverName, idxPath.Child("driverName"))...) - if driverNames.Has(driverName) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("driverName"), driverName)) - } else { - driverNames.Insert(driverName) - } - allErrs = append(allErrs, validateResourceRequests(request.Requests, idxPath.Child("requests"), requestStored)...) + allErrs = append(allErrs, validateDeviceName(device.Name, fldPath.Child("name"))...) + if device.Basic == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("basic"), "")) + } else { + allErrs = append(allErrs, validateBasicDevice(*device.Basic, fldPath.Child("basic"))...) } return allErrs } -func validateResourceRequests(requests []resource.ResourceRequest, fldPath *field.Path, requestStored bool) field.ErrorList { +func validateBasicDevice(device resource.BasicDevice, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - for i, request := range requests { - idxPath := fldPath.Index(i) - allErrs = append(allErrs, validateResourceRequestModel(&request.ResourceRequestModel, idxPath, requestStored)...) - } - if len(requests) == 0 { - // We could allow this, it just doesn't make sense: the entire entry would get ignored and thus - // should have been left out entirely. - allErrs = append(allErrs, field.Required(fldPath, "empty entries with no requests are not allowed")) + allErrs = append(allErrs, validateMap(device.Attributes, resource.ResourceSliceMaxAttributesAndCapacitiesPerDevice, validateQualifiedName, validateDeviceAttribute, fldPath.Child("attributes"))...) + allErrs = append(allErrs, validateMap(device.Capacity, resource.ResourceSliceMaxAttributesAndCapacitiesPerDevice, validateQualifiedName, validateQuantity, fldPath.Child("capacity"))...) + if combinedLen, max := len(device.Attributes)+len(device.Capacity), resource.ResourceSliceMaxAttributesAndCapacitiesPerDevice; combinedLen > max { + allErrs = append(allErrs, field.Invalid(fldPath, combinedLen, fmt.Sprintf("the total number of attributes and capacities must not exceed %d", max))) } return allErrs } -func validateResourceRequestModel(model *resource.ResourceRequestModel, fldPath *field.Path, requestStored bool) field.ErrorList { +var ( + numericIdentifier = `(0|[1-9]\d*)` + + preReleaseIdentifier = `(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)` + + buildIdentifier = `[0-9a-zA-Z-]+` + + semverRe = regexp.MustCompile(`^` + + + // dot-separated version segments (e.g. 1.2.3) + numericIdentifier + `\.` + numericIdentifier + `\.` + numericIdentifier + + + // optional dot-separated prerelease segments (e.g. -alpha.PRERELEASE.1) + `(-` + preReleaseIdentifier + `(\.` + preReleaseIdentifier + `)*)?` + + + // optional dot-separated build identifier segments (e.g. +build.id.20240305) + `(\+` + buildIdentifier + `(\.` + buildIdentifier + `)*)?` + + + `$`) +) + +func validateDeviceAttribute(attribute resource.DeviceAttribute, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - entries := sets.New[string]() - if model.NamedResources != nil { - entries.Insert("namedResources") - allErrs = append(allErrs, namedresourcesvalidation.ValidateRequest(namedresourcesvalidation.Options{StoredExpressions: requestStored}, model.NamedResources, fldPath.Child("namedResources"))...) + numFields := 0 + if attribute.BoolValue != nil { + numFields++ + } + if attribute.IntValue != nil { + numFields++ + } + if attribute.StringValue != nil { + if len(*attribute.StringValue) > resource.DeviceAttributeMaxValueLength { + allErrs = append(allErrs, field.TooLongMaxLength(fldPath.Child("string"), *attribute.StringValue, resource.DeviceAttributeMaxValueLength)) + } + numFields++ } - switch len(entries) { + if attribute.VersionValue != nil { + numFields++ + if !semverRe.MatchString(*attribute.VersionValue) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("version"), *attribute.VersionValue, "must be a string compatible with semver.org spec 2.0.0")) + } + if len(*attribute.VersionValue) > resource.DeviceAttributeMaxValueLength { + allErrs = append(allErrs, field.TooLongMaxLength(fldPath.Child("version"), *attribute.VersionValue, resource.DeviceAttributeMaxValueLength)) + } + } + + switch numFields { case 0: - allErrs = append(allErrs, field.Required(fldPath, "exactly one structured model field must be set")) + allErrs = append(allErrs, field.Required(fldPath, "exactly one value must be set")) case 1: // Okay. default: - allErrs = append(allErrs, field.Invalid(fldPath, sets.List(entries), "exactly one field must be set, not several")) + allErrs = append(allErrs, field.Invalid(fldPath, attribute, "exactly one field must be set, not several")) } return allErrs } -// ValidateResourceClaimParameters tests if a ResourceClaimParameters update is valid. -func ValidateResourceClaimParametersUpdate(resourceClaimParameters, oldResourceClaimParameters *resource.ResourceClaimParameters) field.ErrorList { - allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClaimParameters.ObjectMeta, &oldResourceClaimParameters.ObjectMeta, field.NewPath("metadata")) - requestStored := apiequality.Semantic.DeepEqual(oldResourceClaimParameters.DriverRequests, resourceClaimParameters.DriverRequests) - allErrs = append(allErrs, validateResourceClaimParameters(resourceClaimParameters, requestStored)...) - return allErrs +func validateQuantity(quantity apiresource.Quantity, fldPath *field.Path) field.ErrorList { + // Any parsed quantity is valid. + return nil } -// ValidateResourceClassParameters tests if a ResourceClassParameters object is valid for creation. -func ValidateResourceClassParameters(parameters *resource.ResourceClassParameters) field.ErrorList { - return validateResourceClassParameters(parameters, false) +func validateQualifiedName(name resource.QualifiedName, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if name == "" { + allErrs = append(allErrs, field.Required(fldPath, "name required")) + return allErrs + } + + // Naming the two parts in a field path is tricky. Treating them as a child field + // is not quite right, but close enough... + parts := strings.Split(string(name), "/") + switch len(parts) { + case 1: + allErrs = append(allErrs, validateCIdentifier(parts[0], fldPath.Child("identifier"))...) + case 2: + allErrs = append(allErrs, validateDriverName(parts[0], fldPath.Child("domain"))...) + allErrs = append(allErrs, validateCIdentifier(parts[1], fldPath.Child("identifier"))...) + + } + return allErrs } -func validateResourceClassParameters(parameters *resource.ResourceClassParameters, filtersStored bool) field.ErrorList { - allErrs := corevalidation.ValidateObjectMeta(¶meters.ObjectMeta, true, apimachineryvalidation.NameIsDNSSubdomain, field.NewPath("metadata")) - allErrs = append(allErrs, validateClassParameters(parameters.GeneratedFrom, field.NewPath("generatedFrom"))...) - allErrs = append(allErrs, validateResourceFilters(parameters.Filters, field.NewPath("filters"), filtersStored)...) - allErrs = append(allErrs, validateVendorParameters(parameters.VendorParameters, field.NewPath("vendorParameters"))...) +func validateFullyQualifiedName(name resource.FullyQualifiedName, fldPath *field.Path) field.ErrorList { + allErrs := validateQualifiedName(resource.QualifiedName(name), fldPath) + if !strings.Contains(string(name), "/") { + allErrs = append(allErrs, field.Required(fldPath.Child("domain"), "a fully-qualified name must include a domain prefix")) + } return allErrs } -func validateResourceFilters(filters []resource.ResourceFilter, fldPath *field.Path, filtersStored bool) field.ErrorList { +// cIdentifierFmt is the same as in https://github.com/google/cel-spec/blob/master/doc/langdef.md#overview for IDENT. +const cIdentifierFmt string = "[_a-zA-Z][_a-zA-Z0-9]*" +const cIdentifierErrMsg string = "a C identifier must consist of alphanumeric characters or '_', and must start with an alphabetic character or '_'" + +var cIdentifierRegexp = regexp.MustCompile("^" + cIdentifierFmt + "$") + +func validateCIdentifier(id string, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - driverNames := sets.New[string]() - for i, filter := range filters { - idxPath := fldPath.Index(i) - driverName := filter.DriverName - allErrs = append(allErrs, validateResourceDriverName(driverName, idxPath.Child("driverName"))...) - if driverNames.Has(driverName) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("driverName"), driverName)) - } else { - driverNames.Insert(driverName) - } - allErrs = append(allErrs, validateResourceFilterModel(&filter.ResourceFilterModel, idxPath, filtersStored)...) + if len(id) > resource.DeviceMaxIDLength { + allErrs = append(allErrs, field.TooLongMaxLength(fldPath, id, resource.DeviceMaxIDLength)) + } + if !cIdentifierRegexp.MatchString(id) { + allErrs = append(allErrs, field.TypeInvalid(fldPath, id, validation.RegexError(cIdentifierErrMsg, cIdentifierFmt, "myName", "_abc42"))) } return allErrs } -func validateResourceFilterModel(model *resource.ResourceFilterModel, fldPath *field.Path, filtersStored bool) field.ErrorList { +// validateSlice ensures that a slice does not exceed a certain maximum size +// and that all entries are valid. +func validateSlice[T any](slice []T, maxSize int, validateItem func(T, *field.Path) field.ErrorList, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList - entries := sets.New[string]() - if model.NamedResources != nil { - entries.Insert("namedResources") - allErrs = append(allErrs, namedresourcesvalidation.ValidateFilter(namedresourcesvalidation.Options{StoredExpressions: filtersStored}, model.NamedResources, fldPath.Child("namedResources"))...) + for i, item := range slice { + idxPath := fldPath.Index(i) + allErrs = append(allErrs, validateItem(item, idxPath)...) } - switch len(entries) { - case 0: - allErrs = append(allErrs, field.Required(fldPath, "exactly one structured model field must be set")) - case 1: - // Okay. - default: - allErrs = append(allErrs, field.Invalid(fldPath, sets.List(entries), "exactly one field must be set, not several")) + if len(slice) > maxSize { + // Dumping the entire field into the error message is likely to be too long, + // in particular when it is already beyond the maximum size. Instead this + // just shows the number of entries. + allErrs = append(allErrs, field.TooLongMaxLength(fldPath, len(slice), maxSize)) } return allErrs } -func validateVendorParameters(parameters []resource.VendorParameters, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - driverNames := sets.New[string]() - for i, parameters := range parameters { +// validateSet ensures that a slice contains no duplicates, does not +// exceed a certain maximum size and that all entries are valid. +func validateSet[T any, K comparable](slice []T, maxSize int, validateItem func(item T, fldPath *field.Path) field.ErrorList, itemKey func(T) (K, string), fldPath *field.Path) field.ErrorList { + allErrs := validateSlice(slice, maxSize, validateItem, fldPath) + allItems := sets.New[K]() + for i, item := range slice { idxPath := fldPath.Index(i) - driverName := parameters.DriverName - allErrs = append(allErrs, validateResourceDriverName(driverName, idxPath.Child("driverName"))...) - if driverNames.Has(driverName) { - allErrs = append(allErrs, field.Duplicate(idxPath.Child("driverName"), driverName)) + key, fieldName := itemKey(item) + childPath := idxPath + if fieldName != "" { + childPath = childPath.Child(fieldName) + } + if allItems.Has(key) { + allErrs = append(allErrs, field.Duplicate(childPath, key)) } else { - driverNames.Insert(driverName) + allItems.Insert(key) } } return allErrs } -// ValidateResourceClassParameters tests if a ResourceClassParameters update is valid. -func ValidateResourceClassParametersUpdate(resourceClassParameters, oldResourceClassParameters *resource.ResourceClassParameters) field.ErrorList { - allErrs := corevalidation.ValidateObjectMetaUpdate(&resourceClassParameters.ObjectMeta, &oldResourceClassParameters.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateResourceClassParameters(resourceClassParameters)...) +// stringKey uses the item itself as a key for validateSet. +func stringKey(item string) (string, string) { + return item, "" +} + +// validateMap validates keys, items and the maximum length of a map. +func validateMap[K ~string, T any](m map[K]T, maxSize int, validateKey func(K, *field.Path) field.ErrorList, validateItem func(T, *field.Path) field.ErrorList, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if len(m) > maxSize { + allErrs = append(allErrs, field.TooLongMaxLength(fldPath, len(m), maxSize)) + } + for key, item := range m { + allErrs = append(allErrs, validateKey(key, fldPath)...) + allErrs = append(allErrs, validateItem(item, fldPath.Key(string(key)))...) + } return allErrs } diff --git a/pkg/apis/resource/validation/validation_deviceclass_test.go b/pkg/apis/resource/validation/validation_deviceclass_test.go new file mode 100644 index 0000000000000..3acc4be9d186f --- /dev/null +++ b/pkg/apis/resource/validation/validation_deviceclass_test.go @@ -0,0 +1,247 @@ +/* +Copyright 2022 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. +*/ + +package validation + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/kubernetes/pkg/apis/core" + "k8s.io/kubernetes/pkg/apis/resource" + "k8s.io/utils/ptr" +) + +func testClass(name string) *resource.DeviceClass { + return &resource.DeviceClass{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } +} + +func TestValidateClass(t *testing.T) { + goodName := "foo" + now := metav1.Now() + badName := "!@#$%^" + badValue := "spaces not allowed" + + scenarios := map[string]struct { + class *resource.DeviceClass + wantFailures field.ErrorList + }{ + "good-class": { + class: testClass(goodName), + }, + "missing-name": { + wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "name"), "name or generateName is required")}, + class: testClass(""), + }, + "bad-name": { + wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, + class: testClass(badName), + }, + "generate-name": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.GenerateName = "pvc-" + return class + }(), + }, + "uid": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.UID = "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d" + return class + }(), + }, + "resource-version": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.ResourceVersion = "1" + return class + }(), + }, + "generation": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Generation = 100 + return class + }(), + }, + "creation-timestamp": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.CreationTimestamp = now + return class + }(), + }, + "deletion-grace-period-seconds": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.DeletionGracePeriodSeconds = ptr.To(int64(10)) + return class + }(), + }, + "owner-references": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.OwnerReferences = []metav1.OwnerReference{ + { + APIVersion: "v1", + Kind: "pod", + Name: "foo", + UID: "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d", + }, + } + return class + }(), + }, + "finalizers": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Finalizers = []string{ + "example.com/foo", + } + return class + }(), + }, + "managed-fields": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.ManagedFields = []metav1.ManagedFieldsEntry{ + { + FieldsType: "FieldsV1", + Operation: "Apply", + APIVersion: "apps/v1", + Manager: "foo", + }, + } + return class + }(), + }, + "good-labels": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Labels = map[string]string{ + "apps.kubernetes.io/name": "test", + } + return class + }(), + }, + "bad-labels": { + wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "labels"), badValue, "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')")}, + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Labels = map[string]string{ + "hello-world": badValue, + } + return class + }(), + }, + "good-annotations": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Annotations = map[string]string{ + "foo": "bar", + } + return class + }(), + }, + "bad-annotations": { + wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "annotations"), badName, "name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')")}, + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Annotations = map[string]string{ + badName: "hello world", + } + return class + }(), + }, + "invalid-node-selector": { + wantFailures: field.ErrorList{field.Required(field.NewPath("suitableNodes", "nodeSelectorTerms"), "must have at least one node selector term")}, + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Spec.SuitableNodes = &core.NodeSelector{ + // Must not be empty. + } + return class + }(), + }, + "valid-node-selector": { + class: func() *resource.DeviceClass { + class := testClass(goodName) + class.Spec.SuitableNodes = &core.NodeSelector{ + NodeSelectorTerms: []core.NodeSelectorTerm{{ + MatchExpressions: []core.NodeSelectorRequirement{{ + Key: "foo", + Operator: core.NodeSelectorOpDoesNotExist, + }}, + }}, + } + return class + }(), + }, + } + + for name, scenario := range scenarios { + t.Run(name, func(t *testing.T) { + errs := ValidateDeviceClass(scenario.class) + assert.Equal(t, scenario.wantFailures, errs) + }) + } +} + +func TestValidateClassUpdate(t *testing.T) { + validClass := testClass(goodName) + + scenarios := map[string]struct { + oldClass *resource.DeviceClass + update func(class *resource.DeviceClass) *resource.DeviceClass + wantFailures field.ErrorList + }{ + "valid-no-op-update": { + oldClass: validClass, + update: func(class *resource.DeviceClass) *resource.DeviceClass { return class }, + }, + "update-node-selector": { + oldClass: validClass, + update: func(class *resource.DeviceClass) *resource.DeviceClass { + class = class.DeepCopy() + class.Spec.SuitableNodes = &core.NodeSelector{ + NodeSelectorTerms: []core.NodeSelectorTerm{{ + MatchExpressions: []core.NodeSelectorRequirement{{ + Key: "foo", + Operator: core.NodeSelectorOpDoesNotExist, + }}, + }}, + } + return class + }, + }, + } + + for name, scenario := range scenarios { + t.Run(name, func(t *testing.T) { + scenario.oldClass.ResourceVersion = "1" + errs := ValidateDeviceClassUpdate(scenario.update(scenario.oldClass.DeepCopy()), scenario.oldClass) + assert.Equal(t, scenario.wantFailures, errs) + }) + } +} diff --git a/pkg/apis/resource/validation/validation_resourceclaim_test.go b/pkg/apis/resource/validation/validation_resourceclaim_test.go index 5c735baef5386..75051cbd97c00 100644 --- a/pkg/apis/resource/validation/validation_resourceclaim_test.go +++ b/pkg/apis/resource/validation/validation_resourceclaim_test.go @@ -18,17 +18,18 @@ package validation import ( "fmt" - "strings" "testing" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/apis/resource" "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) func testClaim(name, namespace string, spec resource.ResourceClaimSpec) *resource.ResourceClaim { @@ -37,89 +38,98 @@ func testClaim(name, namespace string, spec resource.ResourceClaimSpec) *resourc Name: name, Namespace: namespace, }, - Spec: spec, + Spec: *spec.DeepCopy(), } } -func TestValidateClaim(t *testing.T) { - validMode := resource.AllocationModeImmediate - invalidMode := resource.AllocationMode("invalid") - goodName := "foo" - badName := "!@#$%^" - goodNS := "ns" - goodClaimSpec := resource.ResourceClaimSpec{ - ResourceClassName: goodName, - AllocationMode: validMode, +const ( + goodName = "foo" + badName = "!@#$%^" + goodNS = "ns" +) + +var ( + validClaimSpec = resource.ResourceClaimSpec{ + Devices: resource.DeviceClaim{ + Requests: []resource.DeviceRequest{{ + Name: goodName, + DeviceClassName: goodName, + CountMode: resource.DeviceCountModeExact, + Count: 1, + }}, + }, } + validClaim = testClaim(goodName, goodNS, validClaimSpec) +) + +func TestValidateClaim(t *testing.T) { now := metav1.Now() badValue := "spaces not allowed" - badAPIGroup := "example.com/v1" - goodAPIGroup := "example.com" scenarios := map[string]struct { claim *resource.ResourceClaim wantFailures field.ErrorList }{ "good-claim": { - claim: testClaim(goodName, goodNS, goodClaimSpec), + claim: testClaim(goodName, goodNS, validClaimSpec), }, "missing-name": { wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "name"), "name or generateName is required")}, - claim: testClaim("", goodNS, goodClaimSpec), + claim: testClaim("", goodNS, validClaimSpec), }, "bad-name": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - claim: testClaim(badName, goodNS, goodClaimSpec), + claim: testClaim(badName, goodNS, validClaimSpec), }, "missing-namespace": { wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "namespace"), "")}, - claim: testClaim(goodName, "", goodClaimSpec), + claim: testClaim(goodName, "", validClaimSpec), }, "generate-name": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.GenerateName = "pvc-" return claim }(), }, "uid": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.UID = "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d" return claim }(), }, "resource-version": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.ResourceVersion = "1" return claim }(), }, "generation": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.Generation = 100 return claim }(), }, "creation-timestamp": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.CreationTimestamp = now return claim }(), }, "deletion-grace-period-seconds": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.DeletionGracePeriodSeconds = pointer.Int64(10) return claim }(), }, "owner-references": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.OwnerReferences = []metav1.OwnerReference{ { APIVersion: "v1", @@ -133,7 +143,7 @@ func TestValidateClaim(t *testing.T) { }, "finalizers": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.Finalizers = []string{ "example.com/foo", } @@ -142,7 +152,7 @@ func TestValidateClaim(t *testing.T) { }, "managed-fields": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.ManagedFields = []metav1.ManagedFieldsEntry{ { FieldsType: "FieldsV1", @@ -156,7 +166,7 @@ func TestValidateClaim(t *testing.T) { }, "good-labels": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.Labels = map[string]string{ "apps.kubernetes.io/name": "test", } @@ -166,7 +176,7 @@ func TestValidateClaim(t *testing.T) { "bad-labels": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "labels"), badValue, "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')")}, claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.Labels = map[string]string{ "hello-world": badValue, } @@ -175,7 +185,7 @@ func TestValidateClaim(t *testing.T) { }, "good-annotations": { claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.Annotations = map[string]string{ "foo": "bar", } @@ -185,7 +195,7 @@ func TestValidateClaim(t *testing.T) { "bad-annotations": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "annotations"), badName, "name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')")}, claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) + claim := testClaim(goodName, goodNS, validClaimSpec) claim.Annotations = map[string]string{ badName: "hello world", } @@ -193,70 +203,115 @@ func TestValidateClaim(t *testing.T) { }(), }, "bad-classname": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "resourceClassName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.ResourceClassName = badName - return claim - }(), - }, - "bad-mode": { - wantFailures: field.ErrorList{field.NotSupported(field.NewPath("spec", "allocationMode"), invalidMode, supportedAllocationModes.List())}, + wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "devices", "requests").Index(0).Child("deviceClassName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.AllocationMode = invalidMode + claim := testClaim(goodName, goodNS, validClaimSpec) + claim.Spec.Devices.Requests[0].DeviceClassName = badName return claim }(), }, - "good-parameters": { - claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - Kind: "foo", - Name: "bar", - } - return claim - }(), - }, - "good-parameters-apigroup": { - claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - APIGroup: goodAPIGroup, - Kind: "foo", - Name: "bar", - } - return claim - }(), - }, - "bad-parameters-apigroup": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "parametersRef", "apiGroup"), badAPIGroup, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, + "invalid-request-name": { + wantFailures: field.ErrorList{ + field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("requests").Index(1), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')"), + field.Invalid(field.NewPath("spec", "devices", "constraints").Index(0).Child("requests").Index(1), badName, "must be the name of a request in the claim"), + field.Invalid(field.NewPath("spec", "devices", "config").Index(0).Child("requests").Index(1), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')"), + field.Invalid(field.NewPath("spec", "devices", "config").Index(0).Child("requests").Index(1), badName, "must be the name of a request in the claim"), + }, claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - APIGroup: badAPIGroup, - Kind: "foo", - Name: "bar", - } + claim := testClaim(goodName, goodNS, validClaimSpec) + claim.Spec.Devices.Constraints = []resource.DeviceConstraint{{ + Requests: []string{claim.Spec.Devices.Requests[0].Name, badName}, + MatchAttribute: ptr.To(resource.FullyQualifiedName("dra.example.com/numa")), + }} + claim.Spec.Devices.Config = []resource.DeviceClaimConfiguration{{ + Requests: []string{claim.Spec.Devices.Requests[0].Name, badName}, + DeviceConfiguration: resource.DeviceConfiguration{ + Opaque: &resource.OpaqueDeviceConfiguration{ + Driver: "dra.example.com", + Parameters: runtime.RawExtension{ + Raw: []byte(`{"kind": "foo", "apiVersion": "dra.example.com/v1"}`), + }, + }, + }, + }} return claim }(), }, - "missing-parameters-kind": { - wantFailures: field.ErrorList{field.Required(field.NewPath("spec", "parametersRef", "kind"), "")}, + "invalid-config-json": { + wantFailures: field.ErrorList{ + field.Required(field.NewPath("spec", "devices", "config").Index(0).Child("opaque", "parameters"), ""), + field.Invalid(field.NewPath("spec", "devices", "config").Index(1).Child("opaque", "parameters"), "", "error parsing data: unexpected end of JSON input"), + field.Invalid(field.NewPath("spec", "devices", "config").Index(2).Child("opaque", "parameters"), "", "parameters must be a valid JSON object"), + field.Required(field.NewPath("spec", "devices", "config").Index(3).Child("opaque", "parameters"), ""), + }, claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - Name: "bar", + claim := testClaim(goodName, goodNS, validClaimSpec) + claim.Spec.Devices.Config = []resource.DeviceClaimConfiguration{ + { + DeviceConfiguration: resource.DeviceConfiguration{ + Opaque: &resource.OpaqueDeviceConfiguration{ + Driver: "dra.example.com", + Parameters: runtime.RawExtension{ + Raw: []byte(``), + }, + }, + }, + }, + { + DeviceConfiguration: resource.DeviceConfiguration{ + Opaque: &resource.OpaqueDeviceConfiguration{ + Driver: "dra.example.com", + Parameters: runtime.RawExtension{ + Raw: []byte(`{`), + }, + }, + }, + }, + { + DeviceConfiguration: resource.DeviceConfiguration{ + Opaque: &resource.OpaqueDeviceConfiguration{ + Driver: "dra.example.com", + Parameters: runtime.RawExtension{ + Raw: []byte(`"hello-world"`), + }, + }, + }, + }, + { + DeviceConfiguration: resource.DeviceConfiguration{ + Opaque: &resource.OpaqueDeviceConfiguration{ + Driver: "dra.example.com", + Parameters: runtime.RawExtension{ + Raw: []byte(`null`), + }, + }, + }, + }, } return claim }(), }, - "missing-parameters-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("spec", "parametersRef", "name"), "")}, + "CEL-compile-errors": { + wantFailures: field.ErrorList{ + field.Invalid(field.NewPath("spec", "devices", "requests").Index(1).Child("selectors").Index(1).Child("cel"), `device.attributes[true].someBoolean`, "compilation failed: ERROR: :1:18: found no matching overload for '_[_]' applied to '(map(string, map(string, any)), bool)'\n | device.attributes[true].someBoolean\n | .................^"), + }, claim: func() *resource.ResourceClaim { - claim := testClaim(goodName, goodNS, goodClaimSpec) - claim.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - Kind: "foo", + claim := testClaim(goodName, goodNS, validClaimSpec) + claim.Spec.Devices.Requests = append(claim.Spec.Devices.Requests, claim.Spec.Devices.Requests[0]) + claim.Spec.Devices.Requests[1].Name += "-2" + claim.Spec.Devices.Requests[1].Selectors = []resource.DeviceSelector{ + { + // Good selector. + CEL: &resource.CELDeviceSelector{ + Expression: `device.driver == "dra.example.com"`, + }, + }, + { + // Bad selector. + CEL: &resource.CELDeviceSelector{ + Expression: `device.attributes[true].someBoolean`, + }, + }, } return claim }(), @@ -265,24 +320,13 @@ func TestValidateClaim(t *testing.T) { for name, scenario := range scenarios { t.Run(name, func(t *testing.T) { - errs := ValidateClaim(scenario.claim) + errs := ValidateResourceClaim(scenario.claim) assert.Equal(t, scenario.wantFailures, errs) }) } } func TestValidateClaimUpdate(t *testing.T) { - name := "valid" - parameters := &resource.ResourceClaimParametersReference{ - Kind: "foo", - Name: "bar", - } - validClaim := testClaim("foo", "ns", resource.ResourceClaimSpec{ - ResourceClassName: name, - AllocationMode: resource.AllocationModeImmediate, - ParametersRef: parameters, - }) - scenarios := map[string]struct { oldClaim *resource.ResourceClaim update func(claim *resource.ResourceClaim) *resource.ResourceClaim @@ -295,36 +339,12 @@ func TestValidateClaimUpdate(t *testing.T) { "invalid-update-class": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec"), func() resource.ResourceClaimSpec { spec := validClaim.Spec.DeepCopy() - spec.ResourceClassName += "2" + spec.Devices.Requests[0].DeviceClassName += "2" return *spec }(), "field is immutable")}, oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Spec.ResourceClassName += "2" - return claim - }, - }, - "invalid-update-remove-parameters": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec"), func() resource.ResourceClaimSpec { - spec := validClaim.Spec.DeepCopy() - spec.ParametersRef = nil - return *spec - }(), "field is immutable")}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Spec.ParametersRef = nil - return claim - }, - }, - "invalid-update-mode": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec"), func() resource.ResourceClaimSpec { - spec := validClaim.Spec.DeepCopy() - spec.AllocationMode = resource.AllocationModeWaitForFirstConsumer - return *spec - }(), "field is immutable")}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Spec.AllocationMode = resource.AllocationModeWaitForFirstConsumer + claim.Spec.Devices.Requests[0].DeviceClassName += "2" return claim }, }, @@ -333,35 +353,24 @@ func TestValidateClaimUpdate(t *testing.T) { for name, scenario := range scenarios { t.Run(name, func(t *testing.T) { scenario.oldClaim.ResourceVersion = "1" - errs := ValidateClaimUpdate(scenario.update(scenario.oldClaim.DeepCopy()), scenario.oldClaim) + errs := ValidateResourceClaimUpdate(scenario.update(scenario.oldClaim.DeepCopy()), scenario.oldClaim) assert.Equal(t, scenario.wantFailures, errs) }) } } func TestValidateClaimStatusUpdate(t *testing.T) { - invalidName := "!@#$%^" - validClaim := testClaim("foo", "ns", resource.ResourceClaimSpec{ - ResourceClassName: "valid", - AllocationMode: resource.AllocationModeImmediate, - }) - validAllocatedClaim := validClaim.DeepCopy() validAllocatedClaim.Status = resource.ResourceClaimStatus{ - DriverName: "valid", Allocation: &resource.AllocationResult{ - ResourceHandles: func() []resource.ResourceHandle { - var handles []resource.ResourceHandle - for i := 0; i < resource.AllocationResultResourceHandlesMaxSize; i++ { - handle := resource.ResourceHandle{ - DriverName: "valid", - Data: strings.Repeat(" ", resource.ResourceHandleDataMaxSize), - } - handles = append(handles, handle) - } - return handles - }(), - Shareable: true, + Devices: resource.DeviceAllocationResult{ + Results: []resource.DeviceRequestAllocationResult{{ + Request: goodName, + Driver: goodName, + Pool: goodName, + Device: goodName, + }}, + }, }, } @@ -374,176 +383,55 @@ func TestValidateClaimStatusUpdate(t *testing.T) { oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { return claim }, }, - "add-driver": { + "valid-add-allocation-empty": { oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - return claim - }, - }, - "invalid-add-allocation": { - wantFailures: field.ErrorList{field.Required(field.NewPath("status", "driverName"), "must be specified when `allocation` is set")}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - // DriverName must also get set here! claim.Status.Allocation = &resource.AllocationResult{} return claim }, }, - "valid-add-allocation": { - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: "valid", - Data: strings.Repeat(" ", resource.ResourceHandleDataMaxSize), - }, - }, - } - return claim - }, - }, - "valid-add-empty-allocation-structured": { + "valid-add-allocation-non-empty": { oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: "valid", - StructuredData: &resource.StructuredResourceHandle{}, - }, + Devices: resource.DeviceAllocationResult{ + Results: []resource.DeviceRequestAllocationResult{{ + Request: goodName, + Driver: goodName, + Pool: goodName, + Device: goodName, + }}, }, } return claim }, }, - "valid-add-allocation-structured": { - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: "valid", - StructuredData: &resource.StructuredResourceHandle{ - NodeName: "worker", - }, - }, - }, - } - return claim - }, - }, - "invalid-add-allocation-structured": { + "invalid-add-allocation-bad-request": { wantFailures: field.ErrorList{ - field.Invalid(field.NewPath("status", "allocation", "resourceHandles").Index(0).Child("structuredData", "nodeName"), "&^!", "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), - field.Required(field.NewPath("status", "allocation", "resourceHandles").Index(0).Child("structuredData", "results").Index(1), "exactly one structured model field must be set"), + field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("request"), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')"), + field.Invalid(field.NewPath("status", "allocation", "devices", "results").Index(0).Child("request"), badName, "must be the name of a request in the claim"), }, oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: "valid", - StructuredData: &resource.StructuredResourceHandle{ - NodeName: "&^!", - Results: []resource.DriverAllocationResult{ - { - AllocationResultModel: resource.AllocationResultModel{ - NamedResources: &resource.NamedResourcesAllocationResult{ - Name: "some-resource-instance", - }, - }, - }, - { - AllocationResultModel: resource.AllocationResultModel{}, // invalid - }, - }, - }, - }, - }, - } - return claim - }, - }, - "invalid-duplicated-data": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("status", "allocation", "resourceHandles").Index(0), nil, "data and structuredData are mutually exclusive")}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: "valid", - Data: "something", - StructuredData: &resource.StructuredResourceHandle{ - NodeName: "worker", - }, - }, - }, - } - return claim - }, - }, - "invalid-allocation-resourceHandles": { - wantFailures: field.ErrorList{field.TooLongMaxLength(field.NewPath("status", "allocation", "resourceHandles"), resource.AllocationResultResourceHandlesMaxSize+1, resource.AllocationResultResourceHandlesMaxSize)}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: func() []resource.ResourceHandle { - var handles []resource.ResourceHandle - for i := 0; i < resource.AllocationResultResourceHandlesMaxSize+1; i++ { - handles = append(handles, resource.ResourceHandle{DriverName: "valid"}) - } - return handles - }(), - } - return claim - }, - }, - "invalid-allocation-resource-handle-drivername": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("status", "allocation", "resourceHandles[0]", "driverName"), invalidName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: invalidName, - }, - }, - } - return claim - }, - }, - "invalid-allocation-resource-handle-data": { - wantFailures: field.ErrorList{field.TooLongMaxLength(field.NewPath("status", "allocation", "resourceHandles").Index(0).Child("data"), resource.ResourceHandleDataMaxSize+1, resource.ResourceHandleDataMaxSize)}, - oldClaim: validClaim, - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" - claim.Status.Allocation = &resource.AllocationResult{ - ResourceHandles: []resource.ResourceHandle{ - { - DriverName: "valid", - Data: strings.Repeat(" ", resource.ResourceHandleDataMaxSize+1), - }, + Devices: resource.DeviceAllocationResult{ + Results: []resource.DeviceRequestAllocationResult{{ + Request: badName, + Driver: goodName, + Pool: goodName, + Device: goodName, + }}, }, } return claim }, }, "invalid-node-selector": { - wantFailures: field.ErrorList{field.Required(field.NewPath("status", "allocation", "availableOnNodes", "nodeSelectorTerms"), "must have at least one node selector term")}, + wantFailures: field.ErrorList{field.Required(field.NewPath("status", "allocation", "nodeSelector", "nodeSelectorTerms"), "must have at least one node selector term")}, oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" claim.Status.Allocation = &resource.AllocationResult{ - AvailableOnNodes: &core.NodeSelector{ + NodeSelector: &core.NodeSelector{ // Must not be empty. }, } @@ -609,30 +497,10 @@ func TestValidateClaimStatusUpdate(t *testing.T) { return claim }, }, - "invalid-reserved-for-not-shared": { - wantFailures: field.ErrorList{field.Forbidden(field.NewPath("status", "reservedFor"), "may not be reserved more than once")}, - oldClaim: func() *resource.ResourceClaim { - claim := validAllocatedClaim.DeepCopy() - claim.Status.Allocation.Shareable = false - return claim - }(), - update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - for i := 0; i < 2; i++ { - claim.Status.ReservedFor = append(claim.Status.ReservedFor, - resource.ResourceClaimConsumerReference{ - Resource: "pods", - Name: fmt.Sprintf("foo-%d", i), - UID: types.UID(fmt.Sprintf("%d", i)), - }) - } - return claim - }, - }, "invalid-reserved-for-no-allocation": { wantFailures: field.ErrorList{field.Forbidden(field.NewPath("status", "reservedFor"), "may not be specified when `allocated` is not set")}, oldClaim: validClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.DriverName = "valid" claim.Status.ReservedFor = []resource.ResourceClaimConsumerReference{ { Resource: "pods", @@ -753,26 +621,12 @@ func TestValidateClaimStatusUpdate(t *testing.T) { "invalid-allocation-modification": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("status.allocation"), func() *resource.AllocationResult { claim := validAllocatedClaim.DeepCopy() - claim.Status.Allocation.ResourceHandles = []resource.ResourceHandle{ - { - DriverName: "valid", - Data: strings.Repeat(" ", resource.ResourceHandleDataMaxSize/2), - }, - } + claim.Status.Allocation.Devices.Results[0].Driver += "-2" return claim.Status.Allocation }(), "field is immutable")}, - oldClaim: func() *resource.ResourceClaim { - claim := validAllocatedClaim.DeepCopy() - claim.Status.DeallocationRequested = false - return claim - }(), + oldClaim: validAllocatedClaim, update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { - claim.Status.Allocation.ResourceHandles = []resource.ResourceHandle{ - { - DriverName: "valid", - Data: strings.Repeat(" ", resource.ResourceHandleDataMaxSize/2), - }, - } + claim.Status.Allocation.Devices.Results[0].Driver += "-2" return claim }, }, @@ -814,12 +668,36 @@ func TestValidateClaimStatusUpdate(t *testing.T) { return claim }, }, + "invalid-request-name": { + wantFailures: field.ErrorList{ + field.Invalid(field.NewPath("status", "allocation", "devices", "config").Index(0).Child("requests").Index(1), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')"), + field.Invalid(field.NewPath("status", "allocation", "devices", "config").Index(0).Child("requests").Index(1), badName, "must be the name of a request in the claim"), + }, + oldClaim: validClaim, + update: func(claim *resource.ResourceClaim) *resource.ResourceClaim { + claim = claim.DeepCopy() + claim.Status.Allocation = validAllocatedClaim.Status.Allocation.DeepCopy() + claim.Status.Allocation.Devices.Config = []resource.DeviceAllocationConfiguration{{ + Source: resource.AllocationConfigSourceClaim, + Requests: []string{claim.Spec.Devices.Requests[0].Name, badName}, + DeviceConfiguration: resource.DeviceConfiguration{ + Opaque: &resource.OpaqueDeviceConfiguration{ + Driver: "dra.example.com", + Parameters: runtime.RawExtension{ + Raw: []byte(`{"kind": "foo", "apiVersion": "dra.example.com/v1"}`), + }, + }, + }, + }} + return claim + }, + }, } for name, scenario := range scenarios { t.Run(name, func(t *testing.T) { scenario.oldClaim.ResourceVersion = "1" - errs := ValidateClaimStatusUpdate(scenario.update(scenario.oldClaim.DeepCopy()), scenario.oldClaim) + errs := ValidateResourceClaimStatusUpdate(scenario.update(scenario.oldClaim.DeepCopy()), scenario.oldClaim) assert.Equal(t, scenario.wantFailures, errs) }) } diff --git a/pkg/apis/resource/validation/validation_resourceclaimparameters_test.go b/pkg/apis/resource/validation/validation_resourceclaimparameters_test.go deleted file mode 100644 index f4af43f8b4610..0000000000000 --- a/pkg/apis/resource/validation/validation_resourceclaimparameters_test.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package validation - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/utils/ptr" -) - -func testResourceClaimParameters(name, namespace string, requests []resource.DriverRequests) *resource.ResourceClaimParameters { - return &resource.ResourceClaimParameters{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - DriverRequests: requests, - } -} - -var goodRequests []resource.DriverRequests - -func TestValidateResourceClaimParameters(t *testing.T) { - goodName := "foo" - badName := "!@#$%^" - badValue := "spaces not allowed" - now := metav1.Now() - - scenarios := map[string]struct { - parameters *resource.ResourceClaimParameters - wantFailures field.ErrorList - }{ - "good": { - parameters: testResourceClaimParameters(goodName, goodName, goodRequests), - }, - "missing-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "name"), "name or generateName is required")}, - parameters: testResourceClaimParameters("", goodName, goodRequests), - }, - "missing-namespace": { - wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "namespace"), "")}, - parameters: testResourceClaimParameters(goodName, "", goodRequests), - }, - "bad-name": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - parameters: testResourceClaimParameters(badName, goodName, goodRequests), - }, - "bad-namespace": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "namespace"), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')")}, - parameters: testResourceClaimParameters(goodName, badName, goodRequests), - }, - "generate-name": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.GenerateName = "prefix-" - return parameters - }(), - }, - "uid": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.UID = "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d" - return parameters - }(), - }, - "resource-version": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.ResourceVersion = "1" - return parameters - }(), - }, - "generation": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.Generation = 100 - return parameters - }(), - }, - "creation-timestamp": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.CreationTimestamp = now - return parameters - }(), - }, - "deletion-grace-period-seconds": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.DeletionGracePeriodSeconds = ptr.To[int64](10) - return parameters - }(), - }, - "owner-references": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.OwnerReferences = []metav1.OwnerReference{ - { - APIVersion: "v1", - Kind: "pod", - Name: "foo", - UID: "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d", - }, - } - return parameters - }(), - }, - "finalizers": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.Finalizers = []string{ - "example.com/foo", - } - return parameters - }(), - }, - "managed-fields": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.ManagedFields = []metav1.ManagedFieldsEntry{ - { - FieldsType: "FieldsV1", - Operation: "Apply", - APIVersion: "apps/v1", - Manager: "foo", - }, - } - return parameters - }(), - }, - "good-labels": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.Labels = map[string]string{ - "apps.kubernetes.io/name": "test", - } - return parameters - }(), - }, - "bad-labels": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "labels"), badValue, "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')")}, - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.Labels = map[string]string{ - "hello-world": badValue, - } - return parameters - }(), - }, - "good-annotations": { - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.Annotations = map[string]string{ - "foo": "bar", - } - return parameters - }(), - }, - "bad-annotations": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "annotations"), badName, "name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')")}, - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.Annotations = map[string]string{ - badName: "hello world", - } - return parameters - }(), - }, - - "empty-model": { - wantFailures: field.ErrorList{field.Required(field.NewPath("driverRequests").Index(0).Child("requests").Index(0), "exactly one structured model field must be set")}, - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.DriverRequests = []resource.DriverRequests{{DriverName: goodName, Requests: []resource.ResourceRequest{{}}}} - return parameters - }(), - }, - - "empty-requests": { - wantFailures: field.ErrorList{field.Required(field.NewPath("driverRequests").Index(0).Child("requests"), "empty entries with no requests are not allowed")}, - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.DriverRequests = []resource.DriverRequests{{DriverName: goodName}} - return parameters - }(), - }, - - "invalid-driver": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("driverRequests").Index(1).Child("driverName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.DriverRequests = []resource.DriverRequests{ - { - DriverName: goodName, - Requests: []resource.ResourceRequest{ - { - ResourceRequestModel: resource.ResourceRequestModel{ - NamedResources: &resource.NamedResourcesRequest{Selector: "true"}, - }, - }, - }, - }, - { - DriverName: badName, - Requests: []resource.ResourceRequest{ - { - ResourceRequestModel: resource.ResourceRequestModel{ - NamedResources: &resource.NamedResourcesRequest{Selector: "true"}, - }, - }, - }, - }, - } - return parameters - }(), - }, - - "duplicate-driver": { - wantFailures: field.ErrorList{field.Duplicate(field.NewPath("driverRequests").Index(1).Child("driverName"), goodName)}, - parameters: func() *resource.ResourceClaimParameters { - parameters := testResourceClaimParameters(goodName, goodName, goodRequests) - parameters.DriverRequests = []resource.DriverRequests{ - { - DriverName: goodName, - Requests: []resource.ResourceRequest{ - { - ResourceRequestModel: resource.ResourceRequestModel{ - NamedResources: &resource.NamedResourcesRequest{Selector: "true"}, - }, - }, - }, - }, - { - DriverName: goodName, - Requests: []resource.ResourceRequest{ - { - ResourceRequestModel: resource.ResourceRequestModel{ - NamedResources: &resource.NamedResourcesRequest{Selector: "true"}, - }, - }, - }, - }, - } - return parameters - }(), - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - errs := ValidateResourceClaimParameters(scenario.parameters) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} - -func TestValidateResourceClaimParametersUpdate(t *testing.T) { - name := "valid" - validResourceClaimParameters := testResourceClaimParameters(name, name, nil) - - scenarios := map[string]struct { - oldResourceClaimParameters *resource.ResourceClaimParameters - update func(claim *resource.ResourceClaimParameters) *resource.ResourceClaimParameters - wantFailures field.ErrorList - }{ - "valid-no-op-update": { - oldResourceClaimParameters: validResourceClaimParameters, - update: func(claim *resource.ResourceClaimParameters) *resource.ResourceClaimParameters { return claim }, - }, - "invalid-name-update": { - oldResourceClaimParameters: validResourceClaimParameters, - update: func(claim *resource.ResourceClaimParameters) *resource.ResourceClaimParameters { - claim.Name += "-update" - return claim - }, - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), name+"-update", "field is immutable")}, - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - scenario.oldResourceClaimParameters.ResourceVersion = "1" - errs := ValidateResourceClaimParametersUpdate(scenario.update(scenario.oldResourceClaimParameters.DeepCopy()), scenario.oldResourceClaimParameters) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} diff --git a/pkg/apis/resource/validation/validation_resourceclaimtemplate_test.go b/pkg/apis/resource/validation/validation_resourceclaimtemplate_test.go index 3f6c55041476e..9c4640fb75b8b 100644 --- a/pkg/apis/resource/validation/validation_resourceclaimtemplate_test.go +++ b/pkg/apis/resource/validation/validation_resourceclaimtemplate_test.go @@ -34,90 +34,79 @@ func testClaimTemplate(name, namespace string, spec resource.ResourceClaimSpec) Namespace: namespace, }, Spec: resource.ResourceClaimTemplateSpec{ - Spec: spec, + Spec: *spec.DeepCopy(), }, } } func TestValidateClaimTemplate(t *testing.T) { - validMode := resource.AllocationModeImmediate - invalidMode := resource.AllocationMode("invalid") - goodName := "foo" - badName := "!@#$%^" - goodNS := "ns" - goodClaimSpec := resource.ResourceClaimSpec{ - ResourceClassName: goodName, - AllocationMode: validMode, - } now := metav1.Now() badValue := "spaces not allowed" - badAPIGroup := "example.com/v1" - goodAPIGroup := "example.com" scenarios := map[string]struct { template *resource.ResourceClaimTemplate wantFailures field.ErrorList }{ "good-claim": { - template: testClaimTemplate(goodName, goodNS, goodClaimSpec), + template: testClaimTemplate(goodName, goodNS, validClaimSpec), }, "missing-name": { wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "name"), "name or generateName is required")}, - template: testClaimTemplate("", goodNS, goodClaimSpec), + template: testClaimTemplate("", goodNS, validClaimSpec), }, "bad-name": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - template: testClaimTemplate(badName, goodNS, goodClaimSpec), + template: testClaimTemplate(badName, goodNS, validClaimSpec), }, "missing-namespace": { wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "namespace"), "")}, - template: testClaimTemplate(goodName, "", goodClaimSpec), + template: testClaimTemplate(goodName, "", validClaimSpec), }, "generate-name": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.GenerateName = "pvc-" return template }(), }, "uid": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.UID = "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d" return template }(), }, "resource-version": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.ResourceVersion = "1" return template }(), }, "generation": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.Generation = 100 return template }(), }, "creation-timestamp": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.CreationTimestamp = now return template }(), }, "deletion-grace-period-seconds": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.DeletionGracePeriodSeconds = pointer.Int64(10) return template }(), }, "owner-references": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.OwnerReferences = []metav1.OwnerReference{ { APIVersion: "v1", @@ -131,7 +120,7 @@ func TestValidateClaimTemplate(t *testing.T) { }, "finalizers": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.Finalizers = []string{ "example.com/foo", } @@ -140,7 +129,7 @@ func TestValidateClaimTemplate(t *testing.T) { }, "managed-fields": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.ManagedFields = []metav1.ManagedFieldsEntry{ { FieldsType: "FieldsV1", @@ -154,7 +143,7 @@ func TestValidateClaimTemplate(t *testing.T) { }, "good-labels": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.Labels = map[string]string{ "apps.kubernetes.io/name": "test", } @@ -164,7 +153,7 @@ func TestValidateClaimTemplate(t *testing.T) { "bad-labels": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "labels"), badValue, "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')")}, template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.Labels = map[string]string{ "hello-world": badValue, } @@ -173,7 +162,7 @@ func TestValidateClaimTemplate(t *testing.T) { }, "good-annotations": { template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.Annotations = map[string]string{ "foo": "bar", } @@ -183,7 +172,7 @@ func TestValidateClaimTemplate(t *testing.T) { "bad-annotations": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "annotations"), badName, "name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')")}, template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) + template := testClaimTemplate(goodName, goodNS, validClaimSpec) template.Annotations = map[string]string{ badName: "hello world", } @@ -191,71 +180,10 @@ func TestValidateClaimTemplate(t *testing.T) { }(), }, "bad-classname": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "spec", "resourceClassName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, + wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "spec", "devices", "requests").Index(0).Child("deviceClassName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.ResourceClassName = badName - return template - }(), - }, - "bad-mode": { - wantFailures: field.ErrorList{field.NotSupported(field.NewPath("spec", "spec", "allocationMode"), invalidMode, supportedAllocationModes.List())}, - template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.AllocationMode = invalidMode - return template - }(), - }, - "good-parameters": { - template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - Kind: "foo", - Name: "bar", - } - return template - }(), - }, - "good-parameters-apigroup": { - template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - APIGroup: goodAPIGroup, - Kind: "foo", - Name: "bar", - } - return template - }(), - }, - "bad-parameters-apigroup": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "spec", "parametersRef", "apiGroup"), badAPIGroup, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - APIGroup: badAPIGroup, - Kind: "foo", - Name: "bar", - } - return template - }(), - }, - "missing-parameters-kind": { - wantFailures: field.ErrorList{field.Required(field.NewPath("spec", "spec", "parametersRef", "kind"), "")}, - template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - Name: "bar", - } - return template - }(), - }, - "missing-parameters-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("spec", "spec", "parametersRef", "name"), "")}, - template: func() *resource.ResourceClaimTemplate { - template := testClaimTemplate(goodName, goodNS, goodClaimSpec) - template.Spec.Spec.ParametersRef = &resource.ResourceClaimParametersReference{ - Kind: "foo", - } + template := testClaimTemplate(goodName, goodNS, validClaimSpec) + template.Spec.Spec.Devices.Requests[0].DeviceClassName = badName return template }(), }, @@ -263,23 +191,14 @@ func TestValidateClaimTemplate(t *testing.T) { for name, scenario := range scenarios { t.Run(name, func(t *testing.T) { - errs := ValidateClaimTemplate(scenario.template) + errs := ValidateResourceClaimTemplate(scenario.template) assert.Equal(t, scenario.wantFailures, errs) }) } } func TestValidateClaimTemplateUpdate(t *testing.T) { - name := "valid" - parameters := &resource.ResourceClaimParametersReference{ - Kind: "foo", - Name: "bar", - } - validClaimTemplate := testClaimTemplate("foo", "ns", resource.ResourceClaimSpec{ - ResourceClassName: name, - AllocationMode: resource.AllocationModeImmediate, - ParametersRef: parameters, - }) + validClaimTemplate := testClaimTemplate(goodName, goodNS, validClaimSpec) scenarios := map[string]struct { oldClaimTemplate *resource.ResourceClaimTemplate @@ -293,36 +212,12 @@ func TestValidateClaimTemplateUpdate(t *testing.T) { "invalid-update-class": { wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec"), func() resource.ResourceClaimTemplateSpec { spec := validClaimTemplate.Spec.DeepCopy() - spec.Spec.ResourceClassName += "2" - return *spec - }(), "field is immutable")}, - oldClaimTemplate: validClaimTemplate, - update: func(template *resource.ResourceClaimTemplate) *resource.ResourceClaimTemplate { - template.Spec.Spec.ResourceClassName += "2" - return template - }, - }, - "invalid-update-remove-parameters": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec"), func() resource.ResourceClaimTemplateSpec { - spec := validClaimTemplate.Spec.DeepCopy() - spec.Spec.ParametersRef = nil - return *spec - }(), "field is immutable")}, - oldClaimTemplate: validClaimTemplate, - update: func(template *resource.ResourceClaimTemplate) *resource.ResourceClaimTemplate { - template.Spec.Spec.ParametersRef = nil - return template - }, - }, - "invalid-update-mode": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec"), func() resource.ResourceClaimTemplateSpec { - spec := validClaimTemplate.Spec.DeepCopy() - spec.Spec.AllocationMode = resource.AllocationModeWaitForFirstConsumer + spec.Spec.Devices.Requests[0].DeviceClassName += "2" return *spec }(), "field is immutable")}, oldClaimTemplate: validClaimTemplate, update: func(template *resource.ResourceClaimTemplate) *resource.ResourceClaimTemplate { - template.Spec.Spec.AllocationMode = resource.AllocationModeWaitForFirstConsumer + template.Spec.Spec.Devices.Requests[0].DeviceClassName += "2" return template }, }, @@ -331,7 +226,7 @@ func TestValidateClaimTemplateUpdate(t *testing.T) { for name, scenario := range scenarios { t.Run(name, func(t *testing.T) { scenario.oldClaimTemplate.ResourceVersion = "1" - errs := ValidateClaimTemplateUpdate(scenario.update(scenario.oldClaimTemplate.DeepCopy()), scenario.oldClaimTemplate) + errs := ValidateResourceClaimTemplateUpdate(scenario.update(scenario.oldClaimTemplate.DeepCopy()), scenario.oldClaimTemplate) assert.Equal(t, scenario.wantFailures, errs) }) } diff --git a/pkg/apis/resource/validation/validation_resourceclass_test.go b/pkg/apis/resource/validation/validation_resourceclass_test.go deleted file mode 100644 index e4de81d04e52e..0000000000000 --- a/pkg/apis/resource/validation/validation_resourceclass_test.go +++ /dev/null @@ -1,301 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package validation - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kubernetes/pkg/apis/core" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/utils/pointer" -) - -func testClass(name, driverName string) *resource.ResourceClass { - return &resource.ResourceClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - DriverName: driverName, - } -} - -func TestValidateClass(t *testing.T) { - goodName := "foo" - now := metav1.Now() - goodParameters := resource.ResourceClassParametersReference{ - Name: "valid", - Namespace: "valid", - Kind: "foo", - } - badName := "!@#$%^" - badValue := "spaces not allowed" - badAPIGroup := "example.com/v1" - goodAPIGroup := "example.com" - - scenarios := map[string]struct { - class *resource.ResourceClass - wantFailures field.ErrorList - }{ - "good-class": { - class: testClass(goodName, goodName), - }, - "good-long-driver-name": { - class: testClass(goodName, "acme.example.com"), - }, - "missing-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "name"), "name or generateName is required")}, - class: testClass("", goodName), - }, - "bad-name": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - class: testClass(badName, goodName), - }, - "generate-name": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.GenerateName = "pvc-" - return class - }(), - }, - "uid": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.UID = "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d" - return class - }(), - }, - "resource-version": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ResourceVersion = "1" - return class - }(), - }, - "generation": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.Generation = 100 - return class - }(), - }, - "creation-timestamp": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.CreationTimestamp = now - return class - }(), - }, - "deletion-grace-period-seconds": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.DeletionGracePeriodSeconds = pointer.Int64(10) - return class - }(), - }, - "owner-references": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.OwnerReferences = []metav1.OwnerReference{ - { - APIVersion: "v1", - Kind: "pod", - Name: "foo", - UID: "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d", - }, - } - return class - }(), - }, - "finalizers": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.Finalizers = []string{ - "example.com/foo", - } - return class - }(), - }, - "managed-fields": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ManagedFields = []metav1.ManagedFieldsEntry{ - { - FieldsType: "FieldsV1", - Operation: "Apply", - APIVersion: "apps/v1", - Manager: "foo", - }, - } - return class - }(), - }, - "good-labels": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.Labels = map[string]string{ - "apps.kubernetes.io/name": "test", - } - return class - }(), - }, - "bad-labels": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "labels"), badValue, "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.Labels = map[string]string{ - "hello-world": badValue, - } - return class - }(), - }, - "good-annotations": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.Annotations = map[string]string{ - "foo": "bar", - } - return class - }(), - }, - "bad-annotations": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "annotations"), badName, "name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.Annotations = map[string]string{ - badName: "hello world", - } - return class - }(), - }, - "missing-driver-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("driverName"), ""), - field.Invalid(field.NewPath("driverName"), "", "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), - }, - class: testClass(goodName, ""), - }, - "invalid-driver-name": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("driverName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - class: testClass(goodName, badName), - }, - "invalid-qualified-driver-name": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("driverName"), goodName+"/path", "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - class: testClass(goodName, goodName+"/path"), - }, - "good-parameters": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ParametersRef = goodParameters.DeepCopy() - return class - }(), - }, - "good-parameters-apigroup": { - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ParametersRef = goodParameters.DeepCopy() - class.ParametersRef.APIGroup = goodAPIGroup - return class - }(), - }, - "bad-parameters-apigroup": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("parametersRef", "apiGroup"), badAPIGroup, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ParametersRef = goodParameters.DeepCopy() - class.ParametersRef.APIGroup = badAPIGroup - return class - }(), - }, - "missing-parameters-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("parametersRef", "name"), "")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ParametersRef = goodParameters.DeepCopy() - class.ParametersRef.Name = "" - return class - }(), - }, - "bad-parameters-namespace": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("parametersRef", "namespace"), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ParametersRef = goodParameters.DeepCopy() - class.ParametersRef.Namespace = badName - return class - }(), - }, - "missing-parameters-kind": { - wantFailures: field.ErrorList{field.Required(field.NewPath("parametersRef", "kind"), "")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.ParametersRef = goodParameters.DeepCopy() - class.ParametersRef.Kind = "" - return class - }(), - }, - "invalid-node-selector": { - wantFailures: field.ErrorList{field.Required(field.NewPath("suitableNodes", "nodeSelectorTerms"), "must have at least one node selector term")}, - class: func() *resource.ResourceClass { - class := testClass(goodName, goodName) - class.SuitableNodes = &core.NodeSelector{ - // Must not be empty. - } - return class - }(), - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - errs := ValidateClass(scenario.class) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} - -func TestValidateClassUpdate(t *testing.T) { - validClass := testClass("foo", "valid") - - scenarios := map[string]struct { - oldClass *resource.ResourceClass - update func(class *resource.ResourceClass) *resource.ResourceClass - wantFailures field.ErrorList - }{ - "valid-no-op-update": { - oldClass: validClass, - update: func(class *resource.ResourceClass) *resource.ResourceClass { return class }, - }, - "update-driver": { - oldClass: validClass, - update: func(class *resource.ResourceClass) *resource.ResourceClass { - class.DriverName += "2" - return class - }, - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - scenario.oldClass.ResourceVersion = "1" - errs := ValidateClassUpdate(scenario.update(scenario.oldClass.DeepCopy()), scenario.oldClass) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} diff --git a/pkg/apis/resource/validation/validation_resourceclassparameters_test.go b/pkg/apis/resource/validation/validation_resourceclassparameters_test.go deleted file mode 100644 index 8286bf44d3261..0000000000000 --- a/pkg/apis/resource/validation/validation_resourceclassparameters_test.go +++ /dev/null @@ -1,313 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package validation - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/utils/ptr" -) - -func testResourceClassParameters(name, namespace string, filters []resource.ResourceFilter) *resource.ResourceClassParameters { - return &resource.ResourceClassParameters{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Filters: filters, - } -} - -var goodFilters []resource.ResourceFilter - -func TestValidateResourceClassParameters(t *testing.T) { - goodName := "foo" - badName := "!@#$%^" - badValue := "spaces not allowed" - now := metav1.Now() - - scenarios := map[string]struct { - parameters *resource.ResourceClassParameters - wantFailures field.ErrorList - }{ - "good": { - parameters: testResourceClassParameters(goodName, goodName, goodFilters), - }, - "missing-name": { - wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "name"), "name or generateName is required")}, - parameters: testResourceClassParameters("", goodName, goodFilters), - }, - "missing-namespace": { - wantFailures: field.ErrorList{field.Required(field.NewPath("metadata", "namespace"), "")}, - parameters: testResourceClassParameters(goodName, "", goodFilters), - }, - "bad-name": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - parameters: testResourceClassParameters(badName, goodName, goodFilters), - }, - "bad-namespace": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "namespace"), badName, "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')")}, - parameters: testResourceClassParameters(goodName, badName, goodFilters), - }, - "generate-name": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.GenerateName = "prefix-" - return parameters - }(), - }, - "uid": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.UID = "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d" - return parameters - }(), - }, - "resource-version": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.ResourceVersion = "1" - return parameters - }(), - }, - "generation": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Generation = 100 - return parameters - }(), - }, - "creation-timestamp": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.CreationTimestamp = now - return parameters - }(), - }, - "deletion-grace-period-seconds": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.DeletionGracePeriodSeconds = ptr.To[int64](10) - return parameters - }(), - }, - "owner-references": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.OwnerReferences = []metav1.OwnerReference{ - { - APIVersion: "v1", - Kind: "pod", - Name: "foo", - UID: "ac051fac-2ead-46d9-b8b4-4e0fbeb7455d", - }, - } - return parameters - }(), - }, - "finalizers": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Finalizers = []string{ - "example.com/foo", - } - return parameters - }(), - }, - "managed-fields": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.ManagedFields = []metav1.ManagedFieldsEntry{ - { - FieldsType: "FieldsV1", - Operation: "Apply", - APIVersion: "apps/v1", - Manager: "foo", - }, - } - return parameters - }(), - }, - "good-labels": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Labels = map[string]string{ - "apps.kubernetes.io/name": "test", - } - return parameters - }(), - }, - "bad-labels": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "labels"), badValue, "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')")}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Labels = map[string]string{ - "hello-world": badValue, - } - return parameters - }(), - }, - "good-annotations": { - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Annotations = map[string]string{ - "foo": "bar", - } - return parameters - }(), - }, - "bad-annotations": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "annotations"), badName, "name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')")}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Annotations = map[string]string{ - badName: "hello world", - } - return parameters - }(), - }, - - "empty-model": { - wantFailures: field.ErrorList{field.Required(field.NewPath("filters").Index(0), "exactly one structured model field must be set")}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Filters = []resource.ResourceFilter{{DriverName: goodName}} - return parameters - }(), - }, - - "filters-invalid-driver": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("filters").Index(1).Child("driverName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Filters = []resource.ResourceFilter{ - { - DriverName: goodName, - ResourceFilterModel: resource.ResourceFilterModel{ - NamedResources: &resource.NamedResourcesFilter{Selector: "true"}, - }, - }, - { - DriverName: badName, - ResourceFilterModel: resource.ResourceFilterModel{ - NamedResources: &resource.NamedResourcesFilter{Selector: "true"}, - }, - }, - } - return parameters - }(), - }, - - "filters-duplicate-driver": { - wantFailures: field.ErrorList{field.Duplicate(field.NewPath("filters").Index(1).Child("driverName"), goodName)}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.Filters = []resource.ResourceFilter{ - { - DriverName: goodName, - ResourceFilterModel: resource.ResourceFilterModel{ - NamedResources: &resource.NamedResourcesFilter{Selector: "true"}, - }, - }, - { - DriverName: goodName, - ResourceFilterModel: resource.ResourceFilterModel{ - NamedResources: &resource.NamedResourcesFilter{Selector: "true"}, - }, - }, - } - return parameters - }(), - }, - - "parameters-invalid-driver": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("vendorParameters").Index(1).Child("driverName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.VendorParameters = []resource.VendorParameters{ - { - DriverName: goodName, - }, - { - DriverName: badName, - }, - } - return parameters - }(), - }, - - "parameters-duplicate-driver": { - wantFailures: field.ErrorList{field.Duplicate(field.NewPath("vendorParameters").Index(1).Child("driverName"), goodName)}, - parameters: func() *resource.ResourceClassParameters { - parameters := testResourceClassParameters(goodName, goodName, goodFilters) - parameters.VendorParameters = []resource.VendorParameters{ - { - DriverName: goodName, - }, - { - DriverName: goodName, - }, - } - return parameters - }(), - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - errs := ValidateResourceClassParameters(scenario.parameters) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} - -func TestValidateResourceClassParametersUpdate(t *testing.T) { - name := "valid" - validResourceClassParameters := testResourceClassParameters(name, name, nil) - - scenarios := map[string]struct { - oldResourceClassParameters *resource.ResourceClassParameters - update func(class *resource.ResourceClassParameters) *resource.ResourceClassParameters - wantFailures field.ErrorList - }{ - "valid-no-op-update": { - oldResourceClassParameters: validResourceClassParameters, - update: func(class *resource.ResourceClassParameters) *resource.ResourceClassParameters { return class }, - }, - "invalid-name-update": { - oldResourceClassParameters: validResourceClassParameters, - update: func(class *resource.ResourceClassParameters) *resource.ResourceClassParameters { - class.Name += "-update" - return class - }, - wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), name+"-update", "field is immutable")}, - }, - } - - for name, scenario := range scenarios { - t.Run(name, func(t *testing.T) { - scenario.oldResourceClassParameters.ResourceVersion = "1" - errs := ValidateResourceClassParametersUpdate(scenario.update(scenario.oldResourceClassParameters.DeepCopy()), scenario.oldResourceClassParameters) - assert.Equal(t, scenario.wantFailures, errs) - }) - } -} diff --git a/pkg/apis/resource/validation/validation_resourceslice_test.go b/pkg/apis/resource/validation/validation_resourceslice_test.go index 8e68fdcefb2e3..1b830a1acc2e2 100644 --- a/pkg/apis/resource/validation/validation_resourceslice_test.go +++ b/pkg/apis/resource/validation/validation_resourceslice_test.go @@ -32,10 +32,13 @@ func testResourceSlice(name, nodeName, driverName string) *resource.ResourceSlic ObjectMeta: metav1.ObjectMeta{ Name: name, }, - NodeName: nodeName, - DriverName: driverName, - ResourceModel: resource.ResourceModel{ - NamedResources: &resource.NamedResourcesResources{}, + Spec: resource.ResourceSliceSpec{ + NodeName: nodeName, + Driver: driverName, + Pool: resource.ResourcePool{ + Name: nodeName, + ResourceSliceCount: 1, + }, }, } } @@ -180,22 +183,24 @@ func TestValidateResourceSlice(t *testing.T) { }(), }, "bad-nodename": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("nodeName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, - slice: testResourceSlice(goodName, badName, driverName), + wantFailures: field.ErrorList{ + field.Invalid(field.NewPath("spec", "pool", "name"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), + field.Invalid(field.NewPath("spec", "nodeName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), + }, + slice: testResourceSlice(goodName, badName, driverName), + }, + "bad-multi-pool-name": { + wantFailures: field.ErrorList{ + field.Invalid(field.NewPath("spec", "pool", "name").Index(0), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), + field.Invalid(field.NewPath("spec", "pool", "name").Index(1), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), + field.Invalid(field.NewPath("spec", "nodeName"), badName+"/"+badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')"), + }, + slice: testResourceSlice(goodName, badName+"/"+badName, driverName), }, "bad-drivername": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("driverName"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, + wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "driver"), badName, "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')")}, slice: testResourceSlice(goodName, goodName, badName), }, - - "empty-model": { - wantFailures: field.ErrorList{field.Required(nil, "exactly one structured model field must be set")}, - slice: func() *resource.ResourceSlice { - slice := testResourceSlice(goodName, goodName, driverName) - slice.ResourceModel = resource.ResourceModel{} - return slice - }(), - }, } for name, scenario := range scenarios { @@ -228,18 +233,30 @@ func TestValidateResourceSliceUpdate(t *testing.T) { wantFailures: field.ErrorList{field.Invalid(field.NewPath("metadata", "name"), name+"-update", "field is immutable")}, }, "invalid-update-nodename": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("nodeName"), name+"-updated", "field is immutable")}, + wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "nodeName"), name+"-updated", "field is immutable")}, oldResourceSlice: validResourceSlice, update: func(slice *resource.ResourceSlice) *resource.ResourceSlice { - slice.NodeName += "-updated" + slice.Spec.NodeName += "-updated" return slice }, }, "invalid-update-drivername": { - wantFailures: field.ErrorList{field.Invalid(field.NewPath("driverName"), name+"-updated", "field is immutable")}, + wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "driver"), name+"-updated", "field is immutable")}, + oldResourceSlice: validResourceSlice, + update: func(slice *resource.ResourceSlice) *resource.ResourceSlice { + slice.Spec.Driver += "-updated" + return slice + }, + }, + "invalid-update-pool": { + wantFailures: field.ErrorList{field.Invalid(field.NewPath("spec", "pool"), func() any { + slice := validResourceSlice.DeepCopy() + slice.Spec.Pool.Name += "-updated" + return slice.Spec.Pool + }(), "field is immutable")}, oldResourceSlice: validResourceSlice, update: func(slice *resource.ResourceSlice) *resource.ResourceSlice { - slice.DriverName += "-updated" + slice.Spec.Pool.Name += "-updated" return slice }, }, diff --git a/pkg/apis/resource/zz_generated.deepcopy.go b/pkg/apis/resource/zz_generated.deepcopy.go index ec26381c01b83..54b43208f4041 100644 --- a/pkg/apis/resource/zz_generated.deepcopy.go +++ b/pkg/apis/resource/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ limitations under the License. package resource import ( + apiresource "k8s.io/apimachinery/pkg/api/resource" runtime "k8s.io/apimachinery/pkg/runtime" core "k8s.io/kubernetes/pkg/apis/core" ) @@ -29,15 +30,9 @@ import ( // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AllocationResult) DeepCopyInto(out *AllocationResult) { *out = *in - if in.ResourceHandles != nil { - in, out := &in.ResourceHandles, &out.ResourceHandles - *out = make([]ResourceHandle, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AvailableOnNodes != nil { - in, out := &in.AvailableOnNodes, &out.AvailableOnNodes + in.Devices.DeepCopyInto(&out.Devices) + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector *out = new(core.NodeSelector) (*in).DeepCopyInto(*out) } @@ -55,138 +50,140 @@ func (in *AllocationResult) DeepCopy() *AllocationResult { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AllocationResultModel) DeepCopyInto(out *AllocationResultModel) { +func (in *BasicDevice) DeepCopyInto(out *BasicDevice) { *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesAllocationResult) - **out = **in + if in.Attributes != nil { + in, out := &in.Attributes, &out.Attributes + *out = make(map[QualifiedName]DeviceAttribute, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(map[QualifiedName]apiresource.Quantity, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllocationResultModel. -func (in *AllocationResultModel) DeepCopy() *AllocationResultModel { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicDevice. +func (in *BasicDevice) DeepCopy() *BasicDevice { if in == nil { return nil } - out := new(AllocationResultModel) + out := new(BasicDevice) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DriverAllocationResult) DeepCopyInto(out *DriverAllocationResult) { +func (in *CELDeviceSelector) DeepCopyInto(out *CELDeviceSelector) { *out = *in - if in.VendorRequestParameters != nil { - out.VendorRequestParameters = in.VendorRequestParameters.DeepCopyObject() - } - in.AllocationResultModel.DeepCopyInto(&out.AllocationResultModel) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverAllocationResult. -func (in *DriverAllocationResult) DeepCopy() *DriverAllocationResult { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CELDeviceSelector. +func (in *CELDeviceSelector) DeepCopy() *CELDeviceSelector { if in == nil { return nil } - out := new(DriverAllocationResult) + out := new(CELDeviceSelector) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DriverRequests) DeepCopyInto(out *DriverRequests) { +func (in *Device) DeepCopyInto(out *Device) { *out = *in - if in.VendorParameters != nil { - out.VendorParameters = in.VendorParameters.DeepCopyObject() - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make([]ResourceRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicDevice) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverRequests. -func (in *DriverRequests) DeepCopy() *DriverRequests { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device. +func (in *Device) DeepCopy() *Device { if in == nil { return nil } - out := new(DriverRequests) + out := new(Device) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesAllocationResult) DeepCopyInto(out *NamedResourcesAllocationResult) { +func (in *DeviceAllocationConfiguration) DeepCopyInto(out *DeviceAllocationConfiguration) { *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAllocationResult. -func (in *NamedResourcesAllocationResult) DeepCopy() *NamedResourcesAllocationResult { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAllocationConfiguration. +func (in *DeviceAllocationConfiguration) DeepCopy() *DeviceAllocationConfiguration { if in == nil { return nil } - out := new(NamedResourcesAllocationResult) + out := new(DeviceAllocationConfiguration) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesAttribute) DeepCopyInto(out *NamedResourcesAttribute) { +func (in *DeviceAllocationResult) DeepCopyInto(out *DeviceAllocationResult) { *out = *in - in.NamedResourcesAttributeValue.DeepCopyInto(&out.NamedResourcesAttributeValue) + if in.Results != nil { + in, out := &in.Results, &out.Results + *out = make([]DeviceRequestAllocationResult, len(*in)) + copy(*out, *in) + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]DeviceAllocationConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAttribute. -func (in *NamedResourcesAttribute) DeepCopy() *NamedResourcesAttribute { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAllocationResult. +func (in *DeviceAllocationResult) DeepCopy() *DeviceAllocationResult { if in == nil { return nil } - out := new(NamedResourcesAttribute) + out := new(DeviceAllocationResult) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesAttributeValue) DeepCopyInto(out *NamedResourcesAttributeValue) { +func (in *DeviceAttribute) DeepCopyInto(out *DeviceAttribute) { *out = *in - if in.QuantityValue != nil { - in, out := &in.QuantityValue, &out.QuantityValue - x := (*in).DeepCopy() - *out = &x - } - if in.BoolValue != nil { - in, out := &in.BoolValue, &out.BoolValue - *out = new(bool) - **out = **in - } if in.IntValue != nil { in, out := &in.IntValue, &out.IntValue *out = new(int64) **out = **in } - if in.IntSliceValue != nil { - in, out := &in.IntSliceValue, &out.IntSliceValue - *out = new(NamedResourcesIntSlice) - (*in).DeepCopyInto(*out) + if in.BoolValue != nil { + in, out := &in.BoolValue, &out.BoolValue + *out = new(bool) + **out = **in } if in.StringValue != nil { in, out := &in.StringValue, &out.StringValue *out = new(string) **out = **in } - if in.StringSliceValue != nil { - in, out := &in.StringSliceValue, &out.StringSliceValue - *out = new(NamedResourcesStringSlice) - (*in).DeepCopyInto(*out) - } if in.VersionValue != nil { in, out := &in.VersionValue, &out.VersionValue *out = new(string) @@ -195,98 +192,240 @@ func (in *NamedResourcesAttributeValue) DeepCopyInto(out *NamedResourcesAttribut return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAttributeValue. -func (in *NamedResourcesAttributeValue) DeepCopy() *NamedResourcesAttributeValue { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAttribute. +func (in *DeviceAttribute) DeepCopy() *DeviceAttribute { if in == nil { return nil } - out := new(NamedResourcesAttributeValue) + out := new(DeviceAttribute) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesFilter) DeepCopyInto(out *NamedResourcesFilter) { +func (in *DeviceClaim) DeepCopyInto(out *DeviceClaim) { *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]DeviceRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Constraints != nil { + in, out := &in.Constraints, &out.Constraints + *out = make([]DeviceConstraint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]DeviceClaimConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesFilter. -func (in *NamedResourcesFilter) DeepCopy() *NamedResourcesFilter { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaim. +func (in *DeviceClaim) DeepCopy() *DeviceClaim { if in == nil { return nil } - out := new(NamedResourcesFilter) + out := new(DeviceClaim) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesInstance) DeepCopyInto(out *NamedResourcesInstance) { +func (in *DeviceClaimConfiguration) DeepCopyInto(out *DeviceClaimConfiguration) { *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make([]NamedResourcesAttribute, len(*in)) + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimConfiguration. +func (in *DeviceClaimConfiguration) DeepCopy() *DeviceClaimConfiguration { + if in == nil { + return nil + } + out := new(DeviceClaimConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClass) DeepCopyInto(out *DeviceClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClass. +func (in *DeviceClass) DeepCopy() *DeviceClass { + if in == nil { + return nil + } + out := new(DeviceClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeviceClass) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClassConfiguration) DeepCopyInto(out *DeviceClassConfiguration) { + *out = *in + in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassConfiguration. +func (in *DeviceClassConfiguration) DeepCopy() *DeviceClassConfiguration { + if in == nil { + return nil + } + out := new(DeviceClassConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClassList) DeepCopyInto(out *DeviceClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DeviceClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassList. +func (in *DeviceClassList) DeepCopy() *DeviceClassList { + if in == nil { + return nil + } + out := new(DeviceClassList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeviceClassList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClassSpec) DeepCopyInto(out *DeviceClassSpec) { + *out = *in + if in.Selectors != nil { + in, out := &in.Selectors, &out.Selectors + *out = make([]DeviceSelector, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]DeviceClassConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SuitableNodes != nil { + in, out := &in.SuitableNodes, &out.SuitableNodes + *out = new(core.NodeSelector) + (*in).DeepCopyInto(*out) + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesInstance. -func (in *NamedResourcesInstance) DeepCopy() *NamedResourcesInstance { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassSpec. +func (in *DeviceClassSpec) DeepCopy() *DeviceClassSpec { if in == nil { return nil } - out := new(NamedResourcesInstance) + out := new(DeviceClassSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesIntSlice) DeepCopyInto(out *NamedResourcesIntSlice) { +func (in *DeviceConfiguration) DeepCopyInto(out *DeviceConfiguration) { *out = *in - if in.Ints != nil { - in, out := &in.Ints, &out.Ints - *out = make([]int64, len(*in)) - copy(*out, *in) + if in.Opaque != nil { + in, out := &in.Opaque, &out.Opaque + *out = new(OpaqueDeviceConfiguration) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesIntSlice. -func (in *NamedResourcesIntSlice) DeepCopy() *NamedResourcesIntSlice { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceConfiguration. +func (in *DeviceConfiguration) DeepCopy() *DeviceConfiguration { if in == nil { return nil } - out := new(NamedResourcesIntSlice) + out := new(DeviceConfiguration) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesRequest) DeepCopyInto(out *NamedResourcesRequest) { +func (in *DeviceConstraint) DeepCopyInto(out *DeviceConstraint) { *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.MatchAttribute != nil { + in, out := &in.MatchAttribute, &out.MatchAttribute + *out = new(FullyQualifiedName) + **out = **in + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesRequest. -func (in *NamedResourcesRequest) DeepCopy() *NamedResourcesRequest { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceConstraint. +func (in *DeviceConstraint) DeepCopy() *DeviceConstraint { if in == nil { return nil } - out := new(NamedResourcesRequest) + out := new(DeviceConstraint) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesResources) DeepCopyInto(out *NamedResourcesResources) { +func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) { *out = *in - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]NamedResourcesInstance, len(*in)) + if in.Selectors != nil { + in, out := &in.Selectors, &out.Selectors + *out = make([]DeviceSelector, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -294,33 +433,66 @@ func (in *NamedResourcesResources) DeepCopyInto(out *NamedResourcesResources) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesResources. -func (in *NamedResourcesResources) DeepCopy() *NamedResourcesResources { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceRequest. +func (in *DeviceRequest) DeepCopy() *DeviceRequest { if in == nil { return nil } - out := new(NamedResourcesResources) + out := new(DeviceRequest) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesStringSlice) DeepCopyInto(out *NamedResourcesStringSlice) { +func (in *DeviceRequestAllocationResult) DeepCopyInto(out *DeviceRequestAllocationResult) { *out = *in - if in.Strings != nil { - in, out := &in.Strings, &out.Strings - *out = make([]string, len(*in)) - copy(*out, *in) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceRequestAllocationResult. +func (in *DeviceRequestAllocationResult) DeepCopy() *DeviceRequestAllocationResult { + if in == nil { + return nil + } + out := new(DeviceRequestAllocationResult) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceSelector) DeepCopyInto(out *DeviceSelector) { + *out = *in + if in.CEL != nil { + in, out := &in.CEL, &out.CEL + *out = new(CELDeviceSelector) + **out = **in } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesStringSlice. -func (in *NamedResourcesStringSlice) DeepCopy() *NamedResourcesStringSlice { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceSelector. +func (in *DeviceSelector) DeepCopy() *DeviceSelector { if in == nil { return nil } - out := new(NamedResourcesStringSlice) + out := new(DeviceSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpaqueDeviceConfiguration) DeepCopyInto(out *OpaqueDeviceConfiguration) { + *out = *in + in.Parameters.DeepCopyInto(&out.Parameters) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpaqueDeviceConfiguration. +func (in *OpaqueDeviceConfiguration) DeepCopy() *OpaqueDeviceConfiguration { + if in == nil { + return nil + } + out := new(OpaqueDeviceConfiguration) in.DeepCopyInto(out) return out } @@ -507,93 +679,6 @@ func (in *ResourceClaimList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClaimParameters) DeepCopyInto(out *ResourceClaimParameters) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.GeneratedFrom != nil { - in, out := &in.GeneratedFrom, &out.GeneratedFrom - *out = new(ResourceClaimParametersReference) - **out = **in - } - if in.DriverRequests != nil { - in, out := &in.DriverRequests, &out.DriverRequests - *out = make([]DriverRequests, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParameters. -func (in *ResourceClaimParameters) DeepCopy() *ResourceClaimParameters { - if in == nil { - return nil - } - out := new(ResourceClaimParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClaimParameters) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClaimParametersList) DeepCopyInto(out *ResourceClaimParametersList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceClaimParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersList. -func (in *ResourceClaimParametersList) DeepCopy() *ResourceClaimParametersList { - if in == nil { - return nil - } - out := new(ResourceClaimParametersList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClaimParametersList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClaimParametersReference) DeepCopyInto(out *ResourceClaimParametersReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersReference. -func (in *ResourceClaimParametersReference) DeepCopy() *ResourceClaimParametersReference { - if in == nil { - return nil - } - out := new(ResourceClaimParametersReference) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceClaimSchedulingStatus) DeepCopyInto(out *ResourceClaimSchedulingStatus) { *out = *in @@ -618,11 +703,7 @@ func (in *ResourceClaimSchedulingStatus) DeepCopy() *ResourceClaimSchedulingStat // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceClaimSpec) DeepCopyInto(out *ResourceClaimSpec) { *out = *in - if in.ParametersRef != nil { - in, out := &in.ParametersRef, &out.ParametersRef - *out = new(ResourceClaimParametersReference) - **out = **in - } + in.Devices.DeepCopyInto(&out.Devices) return } @@ -741,290 +822,17 @@ func (in *ResourceClaimTemplateSpec) DeepCopy() *ResourceClaimTemplateSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClass) DeepCopyInto(out *ResourceClass) { +func (in *ResourcePool) DeepCopyInto(out *ResourcePool) { *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.ParametersRef != nil { - in, out := &in.ParametersRef, &out.ParametersRef - *out = new(ResourceClassParametersReference) - **out = **in - } - if in.SuitableNodes != nil { - in, out := &in.SuitableNodes, &out.SuitableNodes - *out = new(core.NodeSelector) - (*in).DeepCopyInto(*out) - } - if in.StructuredParameters != nil { - in, out := &in.StructuredParameters, &out.StructuredParameters - *out = new(bool) - **out = **in - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClass. -func (in *ResourceClass) DeepCopy() *ResourceClass { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePool. +func (in *ResourcePool) DeepCopy() *ResourcePool { if in == nil { return nil } - out := new(ResourceClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClass) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassList) DeepCopyInto(out *ResourceClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassList. -func (in *ResourceClassList) DeepCopy() *ResourceClassList { - if in == nil { - return nil - } - out := new(ResourceClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClassList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassParameters) DeepCopyInto(out *ResourceClassParameters) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.GeneratedFrom != nil { - in, out := &in.GeneratedFrom, &out.GeneratedFrom - *out = new(ResourceClassParametersReference) - **out = **in - } - if in.VendorParameters != nil { - in, out := &in.VendorParameters, &out.VendorParameters - *out = make([]VendorParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Filters != nil { - in, out := &in.Filters, &out.Filters - *out = make([]ResourceFilter, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParameters. -func (in *ResourceClassParameters) DeepCopy() *ResourceClassParameters { - if in == nil { - return nil - } - out := new(ResourceClassParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClassParameters) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassParametersList) DeepCopyInto(out *ResourceClassParametersList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceClassParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersList. -func (in *ResourceClassParametersList) DeepCopy() *ResourceClassParametersList { - if in == nil { - return nil - } - out := new(ResourceClassParametersList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClassParametersList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassParametersReference) DeepCopyInto(out *ResourceClassParametersReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersReference. -func (in *ResourceClassParametersReference) DeepCopy() *ResourceClassParametersReference { - if in == nil { - return nil - } - out := new(ResourceClassParametersReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter) { - *out = *in - in.ResourceFilterModel.DeepCopyInto(&out.ResourceFilterModel) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilter. -func (in *ResourceFilter) DeepCopy() *ResourceFilter { - if in == nil { - return nil - } - out := new(ResourceFilter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceFilterModel) DeepCopyInto(out *ResourceFilterModel) { - *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesFilter) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilterModel. -func (in *ResourceFilterModel) DeepCopy() *ResourceFilterModel { - if in == nil { - return nil - } - out := new(ResourceFilterModel) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceHandle) DeepCopyInto(out *ResourceHandle) { - *out = *in - if in.StructuredData != nil { - in, out := &in.StructuredData, &out.StructuredData - *out = new(StructuredResourceHandle) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceHandle. -func (in *ResourceHandle) DeepCopy() *ResourceHandle { - if in == nil { - return nil - } - out := new(ResourceHandle) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceModel) DeepCopyInto(out *ResourceModel) { - *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesResources) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceModel. -func (in *ResourceModel) DeepCopy() *ResourceModel { - if in == nil { - return nil - } - out := new(ResourceModel) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceRequest) DeepCopyInto(out *ResourceRequest) { - *out = *in - if in.VendorParameters != nil { - out.VendorParameters = in.VendorParameters.DeepCopyObject() - } - in.ResourceRequestModel.DeepCopyInto(&out.ResourceRequestModel) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequest. -func (in *ResourceRequest) DeepCopy() *ResourceRequest { - if in == nil { - return nil - } - out := new(ResourceRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceRequestModel) DeepCopyInto(out *ResourceRequestModel) { - *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesRequest) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequestModel. -func (in *ResourceRequestModel) DeepCopy() *ResourceRequestModel { - if in == nil { - return nil - } - out := new(ResourceRequestModel) + out := new(ResourcePool) in.DeepCopyInto(out) return out } @@ -1034,7 +842,7 @@ func (in *ResourceSlice) DeepCopyInto(out *ResourceSlice) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.ResourceModel.DeepCopyInto(&out.ResourceModel) + in.Spec.DeepCopyInto(&out.Spec) return } @@ -1090,17 +898,17 @@ func (in *ResourceSliceList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StructuredResourceHandle) DeepCopyInto(out *StructuredResourceHandle) { +func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) { *out = *in - if in.VendorClassParameters != nil { - out.VendorClassParameters = in.VendorClassParameters.DeepCopyObject() - } - if in.VendorClaimParameters != nil { - out.VendorClaimParameters = in.VendorClaimParameters.DeepCopyObject() + out.Pool = in.Pool + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = new(core.NodeSelector) + (*in).DeepCopyInto(*out) } - if in.Results != nil { - in, out := &in.Results, &out.Results - *out = make([]DriverAllocationResult, len(*in)) + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]Device, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1108,31 +916,12 @@ func (in *StructuredResourceHandle) DeepCopyInto(out *StructuredResourceHandle) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StructuredResourceHandle. -func (in *StructuredResourceHandle) DeepCopy() *StructuredResourceHandle { - if in == nil { - return nil - } - out := new(StructuredResourceHandle) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VendorParameters) DeepCopyInto(out *VendorParameters) { - *out = *in - if in.Parameters != nil { - out.Parameters = in.Parameters.DeepCopyObject() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VendorParameters. -func (in *VendorParameters) DeepCopy() *VendorParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSliceSpec. +func (in *ResourceSliceSpec) DeepCopy() *ResourceSliceSpec { if in == nil { return nil } - out := new(VendorParameters) + out := new(ResourceSliceSpec) in.DeepCopyInto(out) return out } diff --git a/pkg/controller/resourceclaim/controller.go b/pkg/controller/resourceclaim/controller.go index daa000ee92ac9..596113b17d26e 100644 --- a/pkg/controller/resourceclaim/controller.go +++ b/pkg/controller/resourceclaim/controller.go @@ -25,7 +25,7 @@ import ( "time" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -33,12 +33,12 @@ import ( "k8s.io/apimachinery/pkg/util/wait" corev1apply "k8s.io/client-go/applyconfigurations/core/v1" v1informers "k8s.io/client-go/informers/core/v1" - resourcev1alpha2informers "k8s.io/client-go/informers/resource/v1alpha2" + resourceinformers "k8s.io/client-go/informers/resource/v1alpha3" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" v1core "k8s.io/client-go/kubernetes/typed/core/v1" v1listers "k8s.io/client-go/listers/core/v1" - resourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" + resourcelisters "k8s.io/client-go/listers/resource/v1alpha3" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" @@ -78,7 +78,7 @@ type Controller struct { // claimLister is the shared ResourceClaim lister used to fetch and store ResourceClaim // objects from the API server. It is shared with other controllers and // therefore the ResourceClaim objects in its store should be treated as immutable. - claimLister resourcev1alpha2listers.ResourceClaimLister + claimLister resourcelisters.ResourceClaimLister claimsSynced cache.InformerSynced claimCache cache.MutationCache @@ -92,14 +92,14 @@ type Controller struct { // fetch scheduling objects from the API server. It is shared with other // controllers and therefore the objects in its store should be treated // as immutable. - podSchedulingLister resourcev1alpha2listers.PodSchedulingContextLister + podSchedulingLister resourcelisters.PodSchedulingContextLister podSchedulingSynced cache.InformerSynced // templateLister is the shared ResourceClaimTemplate lister used to // fetch template objects from the API server. It is shared with other // controllers and therefore the objects in its store should be treated // as immutable. - templateLister resourcev1alpha2listers.ResourceClaimTemplateLister + templateLister resourcelisters.ResourceClaimTemplateLister templatesSynced cache.InformerSynced // podIndexer has the common PodResourceClaim indexer installed To @@ -127,9 +127,9 @@ func NewController( logger klog.Logger, kubeClient clientset.Interface, podInformer v1informers.PodInformer, - podSchedulingInformer resourcev1alpha2informers.PodSchedulingContextInformer, - claimInformer resourcev1alpha2informers.ResourceClaimInformer, - templateInformer resourcev1alpha2informers.ResourceClaimTemplateInformer) (*Controller, error) { + podSchedulingInformer resourceinformers.PodSchedulingContextInformer, + claimInformer resourceinformers.ResourceClaimInformer, + templateInformer resourceinformers.ResourceClaimTemplateInformer) (*Controller, error) { ec := &Controller{ kubeClient: kubeClient, @@ -329,8 +329,7 @@ func (ec *Controller) podNeedsWork(pod *v1.Pod) (bool, string) { // - a user created a pod with spec.nodeName set, perhaps for testing // - some scheduler was used which is unaware of DRA // - DRA was not enabled in kube-scheduler (version skew, configuration) - if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer && - claim.Status.Allocation == nil { + if claim.Status.Allocation == nil { scheduling, err := ec.podSchedulingLister.PodSchedulingContexts(pod.Namespace).Get(pod.Name) if apierrors.IsNotFound(err) { return true, "need to create PodSchedulingContext for scheduled pod" @@ -359,7 +358,7 @@ func (ec *Controller) enqueueResourceClaim(logger klog.Logger, obj interface{}, if d, ok := obj.(cache.DeletedFinalStateUnknown); ok { obj = d.Obj } - claim, ok := obj.(*resourcev1alpha2.ResourceClaim) + claim, ok := obj.(*resourceapi.ResourceClaim) if !ok { return } @@ -533,8 +532,7 @@ func (ec *Controller) syncPod(ctx context.Context, namespace, name string) error return err } } - if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer && - claim.Status.Allocation == nil { + if claim.Status.Allocation == nil { logger.V(5).Info("create PodSchedulingContext because claim needs to be allocated", "resourceClaim", klog.KObj(claim)) return ec.ensurePodSchedulingContext(ctx, pod) } @@ -633,7 +631,7 @@ func (ec *Controller) handleClaim(ctx context.Context, pod *v1.Pod, podClaim v1. "-" + podClaim.Name[0:len(podClaim.Name)*maxBaseLen/len(generateName)] } - claim = &resourcev1alpha2.ResourceClaim{ + claim = &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ GenerateName: generateName, OwnerReferences: []metav1.OwnerReference{ @@ -653,7 +651,7 @@ func (ec *Controller) handleClaim(ctx context.Context, pod *v1.Pod, podClaim v1. } metrics.ResourceClaimCreateAttempts.Inc() claimName := claim.Name - claim, err = ec.kubeClient.ResourceV1alpha2().ResourceClaims(pod.Namespace).Create(ctx, claim, metav1.CreateOptions{}) + claim, err = ec.kubeClient.ResourceV1alpha3().ResourceClaims(pod.Namespace).Create(ctx, claim, metav1.CreateOptions{}) if err != nil { metrics.ResourceClaimCreateFailures.Inc() return fmt.Errorf("create ResourceClaim %s: %v", claimName, err) @@ -674,7 +672,7 @@ func (ec *Controller) handleClaim(ctx context.Context, pod *v1.Pod, podClaim v1. // findPodResourceClaim looks for an existing ResourceClaim with the right // annotation (ties it to the pod claim) and the right ownership (ties it to // the pod). -func (ec *Controller) findPodResourceClaim(pod *v1.Pod, podClaim v1.PodResourceClaim) (*resourcev1alpha2.ResourceClaim, error) { +func (ec *Controller) findPodResourceClaim(pod *v1.Pod, podClaim v1.PodResourceClaim) (*resourceapi.ResourceClaim, error) { // Only claims owned by the pod will get returned here. claims, err := ec.claimCache.ByIndex(claimPodOwnerIndex, string(pod.UID)) if err != nil { @@ -682,7 +680,7 @@ func (ec *Controller) findPodResourceClaim(pod *v1.Pod, podClaim v1.PodResourceC } deterministicName := pod.Name + "-" + podClaim.Name // Kubernetes <= 1.27 behavior. for _, claimObj := range claims { - claim, ok := claimObj.(*resourcev1alpha2.ResourceClaim) + claim, ok := claimObj.(*resourceapi.ResourceClaim) if !ok { return nil, fmt.Errorf("unexpected object of type %T returned by claim cache", claimObj) } @@ -714,7 +712,7 @@ func (ec *Controller) ensurePodSchedulingContext(ctx context.Context, pod *v1.Po return fmt.Errorf("retrieve PodSchedulingContext: %v", err) } if scheduling == nil { - scheduling = &resourcev1alpha2.PodSchedulingContext{ + scheduling = &resourceapi.PodSchedulingContext{ ObjectMeta: metav1.ObjectMeta{ Name: pod.Name, Namespace: pod.Namespace, @@ -728,14 +726,14 @@ func (ec *Controller) ensurePodSchedulingContext(ctx context.Context, pod *v1.Po }, }, }, - Spec: resourcev1alpha2.PodSchedulingContextSpec{ + Spec: resourceapi.PodSchedulingContextSpec{ SelectedNode: pod.Spec.NodeName, // There is no need for negotiation about // potential and suitable nodes anymore, so // PotentialNodes can be left empty. }, } - if _, err := ec.kubeClient.ResourceV1alpha2().PodSchedulingContexts(pod.Namespace).Create(ctx, scheduling, metav1.CreateOptions{}); err != nil { + if _, err := ec.kubeClient.ResourceV1alpha3().PodSchedulingContexts(pod.Namespace).Create(ctx, scheduling, metav1.CreateOptions{}); err != nil { return fmt.Errorf("create PodSchedulingContext %s: %w", klog.KObj(scheduling), err) } return nil @@ -744,7 +742,7 @@ func (ec *Controller) ensurePodSchedulingContext(ctx context.Context, pod *v1.Po if scheduling.Spec.SelectedNode != pod.Spec.NodeName { scheduling := scheduling.DeepCopy() scheduling.Spec.SelectedNode = pod.Spec.NodeName - if _, err := ec.kubeClient.ResourceV1alpha2().PodSchedulingContexts(pod.Namespace).Update(ctx, scheduling, metav1.UpdateOptions{}); err != nil { + if _, err := ec.kubeClient.ResourceV1alpha3().PodSchedulingContexts(pod.Namespace).Update(ctx, scheduling, metav1.UpdateOptions{}); err != nil { return fmt.Errorf("update spec.selectedNode in PodSchedulingContext %s: %w", klog.KObj(scheduling), err) } } @@ -752,15 +750,15 @@ func (ec *Controller) ensurePodSchedulingContext(ctx context.Context, pod *v1.Po return nil } -func (ec *Controller) reserveForPod(ctx context.Context, pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) error { +func (ec *Controller) reserveForPod(ctx context.Context, pod *v1.Pod, claim *resourceapi.ResourceClaim) error { claim = claim.DeepCopy() claim.Status.ReservedFor = append(claim.Status.ReservedFor, - resourcev1alpha2.ResourceClaimConsumerReference{ + resourceapi.ResourceClaimConsumerReference{ Resource: "pods", Name: pod.Name, UID: pod.UID, }) - if _, err := ec.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}); err != nil { + if _, err := ec.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}); err != nil { return fmt.Errorf("reserve claim %s for pod: %w", klog.KObj(claim), err) } return nil @@ -779,7 +777,7 @@ func (ec *Controller) syncClaim(ctx context.Context, namespace, name string) err } // Check if the ReservedFor entries are all still valid. - valid := make([]resourcev1alpha2.ResourceClaimConsumerReference, 0, len(claim.Status.ReservedFor)) + valid := make([]resourceapi.ResourceClaimConsumerReference, 0, len(claim.Status.ReservedFor)) for _, reservedFor := range claim.Status.ReservedFor { if reservedFor.APIGroup == "" && reservedFor.Resource == "pods" { @@ -838,7 +836,7 @@ func (ec *Controller) syncClaim(ctx context.Context, namespace, name string) err return fmt.Errorf("unsupported ReservedFor entry: %v", reservedFor) } - builtinControllerFinalizer := slices.Index(claim.Finalizers, resourcev1alpha2.Finalizer) + builtinControllerFinalizer := slices.Index(claim.Finalizers, resourceapi.Finalizer) logger.V(5).Info("claim reserved for counts", "currentCount", len(claim.Status.ReservedFor), "claim", klog.KRef(namespace, name), "updatedCount", len(valid), "builtinController", builtinControllerFinalizer >= 0) if len(valid) < len(claim.Status.ReservedFor) { // This is not using a patch because we want the update to fail if anything @@ -864,32 +862,27 @@ func (ec *Controller) syncClaim(ctx context.Context, namespace, name string) err // for such claims and not checking for them keeps this code simpler. if len(valid) == 0 { if builtinControllerFinalizer >= 0 { - if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer || - claim.DeletionTimestamp != nil { - // Allocated by scheduler with structured parameters. We can "deallocate" - // by clearing the allocation. - claim.Status.Allocation = nil - } - } else if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer { + // Allocated by scheduler with structured parameters. We can "deallocate" + // by clearing the allocation. + claim.Status.Allocation = nil + } else { // DRA driver controller in the control plane // needs to do the deallocation. claim.Status.DeallocationRequested = true } - // In all other cases, we keep the claim allocated, in particular for immediate allocation - // with a control plane controller. } - claim, err := ec.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) + claim, err := ec.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) if err != nil { return err } // Now also remove the finalizer if it is not needed anymore. // Note that the index may have changed as a result of the UpdateStatus call. - builtinControllerFinalizer := slices.Index(claim.Finalizers, resourcev1alpha2.Finalizer) + builtinControllerFinalizer := slices.Index(claim.Finalizers, resourceapi.Finalizer) if builtinControllerFinalizer >= 0 && claim.Status.Allocation == nil { claim.Finalizers = slices.Delete(claim.Finalizers, builtinControllerFinalizer, builtinControllerFinalizer+1) - if _, err := ec.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}); err != nil { + if _, err := ec.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}); err != nil { return err } } @@ -901,14 +894,14 @@ func (ec *Controller) syncClaim(ctx context.Context, namespace, name string) err // deleted. As above we then need to clear the allocation. claim.Status.Allocation = nil var err error - claim, err = ec.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) + claim, err = ec.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) if err != nil { return err } } // Whether it was allocated or not, remove the finalizer to unblock removal. claim.Finalizers = slices.Delete(claim.Finalizers, builtinControllerFinalizer, builtinControllerFinalizer+1) - _, err := ec.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) + _, err := ec.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) if err != nil { return err } @@ -929,7 +922,7 @@ func (ec *Controller) syncClaim(ctx context.Context, namespace, name string) err // We are certain that the owning pod is not going to need // the claim and therefore remove the claim. logger.V(5).Info("deleting unused generated claim", "claim", klog.KObj(claim), "pod", klog.KObj(pod)) - err := ec.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).Delete(ctx, claim.Name, metav1.DeleteOptions{}) + err := ec.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).Delete(ctx, claim.Name, metav1.DeleteOptions{}) if err != nil { return fmt.Errorf("delete claim %s: %w", klog.KObj(claim), err) } @@ -951,7 +944,7 @@ func (ec *Controller) syncClaim(ctx context.Context, namespace, name string) err return nil } -func owningPod(claim *resourcev1alpha2.ResourceClaim) (string, types.UID) { +func owningPod(claim *resourceapi.ResourceClaim) (string, types.UID) { for _, owner := range claim.OwnerReferences { if ptr.Deref(owner.Controller, false) && owner.APIVersion == "v1" && @@ -993,7 +986,7 @@ func isPodDone(pod *v1.Pod) bool { // claimPodOwnerIndexFunc is an index function that returns the pod UIDs of // all pods which own the resource claim. Should only be one, though. func claimPodOwnerIndexFunc(obj interface{}) ([]string, error) { - claim, ok := obj.(*resourcev1alpha2.ResourceClaim) + claim, ok := obj.(*resourceapi.ResourceClaim) if !ok { return nil, nil } diff --git a/pkg/controller/resourceclaim/controller_test.go b/pkg/controller/resourceclaim/controller_test.go index b089c74c95122..9921c88a19855 100644 --- a/pkg/controller/resourceclaim/controller_test.go +++ b/pkg/controller/resourceclaim/controller_test.go @@ -27,7 +27,7 @@ import ( "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -79,7 +79,7 @@ var ( return pod }() - podSchedulingContext = resourcev1alpha2.PodSchedulingContext{ + podSchedulingContext = resourceapi.PodSchedulingContext{ ObjectMeta: metav1.ObjectMeta{ Name: testPodName, Namespace: testNamespace, @@ -93,7 +93,7 @@ var ( }, }, }, - Spec: resourcev1alpha2.PodSchedulingContextSpec{ + Spec: resourceapi.PodSchedulingContextSpec{ SelectedNode: nodeName, }, } @@ -107,13 +107,13 @@ func TestSyncHandler(t *testing.T) { tests := []struct { name string key string - claims []*resourcev1alpha2.ResourceClaim - claimsInCache []*resourcev1alpha2.ResourceClaim + claims []*resourceapi.ResourceClaim + claimsInCache []*resourceapi.ResourceClaim pods []*v1.Pod podsLater []*v1.Pod - templates []*resourcev1alpha2.ResourceClaimTemplate - expectedClaims []resourcev1alpha2.ResourceClaim - expectedPodSchedulingContexts []resourcev1alpha2.PodSchedulingContext + templates []*resourceapi.ResourceClaimTemplate + expectedClaims []resourceapi.ResourceClaim + expectedPodSchedulingContexts []resourceapi.PodSchedulingContext expectedStatuses map[string][]v1.PodResourceClaimStatus expectedError bool expectedMetrics expectedMetrics @@ -121,9 +121,9 @@ func TestSyncHandler(t *testing.T) { { name: "create", pods: []*v1.Pod{testPodWithResource}, - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, + templates: []*resourceapi.ResourceClaimTemplate{template}, key: podKey(testPodWithResource), - expectedClaims: []resourcev1alpha2.ResourceClaim{*generatedTestClaim}, + expectedClaims: []resourceapi.ResourceClaim{*generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -140,10 +140,10 @@ func TestSyncHandler(t *testing.T) { } return pod }()}, - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, + templates: []*resourceapi.ResourceClaimTemplate{template}, key: podKey(testPodWithResource), - claims: []*resourcev1alpha2.ResourceClaim{generatedTestClaim}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*generatedTestClaim}, + claims: []*resourceapi.ResourceClaim{generatedTestClaim}, + expectedClaims: []resourceapi.ResourceClaim{*generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -160,9 +160,9 @@ func TestSyncHandler(t *testing.T) { } return pod }()}, - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, + templates: []*resourceapi.ResourceClaimTemplate{template}, key: podKey(testPodWithResource), - expectedClaims: []resourcev1alpha2.ResourceClaim{*generatedTestClaim}, + expectedClaims: []resourceapi.ResourceClaim{*generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -181,8 +181,8 @@ func TestSyncHandler(t *testing.T) { name: "find-existing-claim-by-label", pods: []*v1.Pod{testPodWithResource}, key: podKey(testPodWithResource), - claims: []*resourcev1alpha2.ResourceClaim{generatedTestClaim}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*generatedTestClaim}, + claims: []*resourceapi.ResourceClaim{generatedTestClaim}, + expectedClaims: []resourceapi.ResourceClaim{*generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -194,8 +194,8 @@ func TestSyncHandler(t *testing.T) { name: "find-existing-claim-by-name", pods: []*v1.Pod{testPodWithResource}, key: podKey(testPodWithResource), - claims: []*resourcev1alpha2.ResourceClaim{testClaim}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*testClaim}, + claims: []*resourceapi.ResourceClaim{testClaim}, + expectedClaims: []resourceapi.ResourceClaim{*testClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &testClaim.Name}, @@ -207,7 +207,7 @@ func TestSyncHandler(t *testing.T) { name: "find-created-claim-in-cache", pods: []*v1.Pod{testPodWithResource}, key: podKey(testPodWithResource), - claimsInCache: []*resourcev1alpha2.ResourceClaim{generatedTestClaim}, + claimsInCache: []*resourceapi.ResourceClaim{generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -237,10 +237,10 @@ func TestSyncHandler(t *testing.T) { { name: "create-with-other-claim", pods: []*v1.Pod{testPodWithResource}, - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, + templates: []*resourceapi.ResourceClaimTemplate{template}, key: podKey(testPodWithResource), - claims: []*resourcev1alpha2.ResourceClaim{otherNamespaceClaim}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*otherNamespaceClaim, *generatedTestClaim}, + claims: []*resourceapi.ResourceClaim{otherNamespaceClaim}, + expectedClaims: []resourceapi.ResourceClaim{*otherNamespaceClaim, *generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithResource.Name: { {Name: testPodWithResource.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -252,14 +252,14 @@ func TestSyncHandler(t *testing.T) { name: "wrong-claim-owner", pods: []*v1.Pod{testPodWithResource}, key: podKey(testPodWithResource), - claims: []*resourcev1alpha2.ResourceClaim{conflictingClaim}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*conflictingClaim}, + claims: []*resourceapi.ResourceClaim{conflictingClaim}, + expectedClaims: []resourceapi.ResourceClaim{*conflictingClaim}, expectedError: true, }, { name: "create-conflict", pods: []*v1.Pod{testPodWithResource}, - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, + templates: []*resourceapi.ResourceClaimTemplate{template}, key: podKey(testPodWithResource), expectedMetrics: expectedMetrics{1, 1}, expectedError: true, @@ -268,176 +268,118 @@ func TestSyncHandler(t *testing.T) { name: "stay-reserved-seen", pods: []*v1.Pod{testPodWithResource}, key: claimKey(testClaimReserved), - claims: []*resourcev1alpha2.ResourceClaim{testClaimReserved}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*testClaimReserved}, + claims: []*resourceapi.ResourceClaim{testClaimReserved}, + expectedClaims: []resourceapi.ResourceClaim{*testClaimReserved}, expectedMetrics: expectedMetrics{0, 0}, }, { name: "stay-reserved-not-seen", podsLater: []*v1.Pod{testPodWithResource}, key: claimKey(testClaimReserved), - claims: []*resourcev1alpha2.ResourceClaim{testClaimReserved}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*testClaimReserved}, + claims: []*resourceapi.ResourceClaim{testClaimReserved}, + expectedClaims: []resourceapi.ResourceClaim{*testClaimReserved}, expectedMetrics: expectedMetrics{0, 0}, }, { - name: "clear-reserved-delayed-allocation", + name: "clear-reserved", pods: []*v1.Pod{}, key: claimKey(testClaimReserved), - claims: []*resourcev1alpha2.ResourceClaim{testClaimReserved}, - expectedClaims: func() []resourcev1alpha2.ResourceClaim { + claims: []*resourceapi.ResourceClaim{testClaimReserved}, + expectedClaims: func() []resourceapi.ResourceClaim { claim := testClaimAllocated.DeepCopy() claim.Status.DeallocationRequested = true - return []resourcev1alpha2.ResourceClaim{*claim} + return []resourceapi.ResourceClaim{*claim} }(), expectedMetrics: expectedMetrics{0, 0}, }, { - name: "clear-reserved-delayed-allocation-structured", + name: "clear-reserved-structured", pods: []*v1.Pod{}, key: claimKey(testClaimReserved), - claims: []*resourcev1alpha2.ResourceClaim{structuredParameters(testClaimReserved)}, - expectedClaims: func() []resourcev1alpha2.ResourceClaim { + claims: []*resourceapi.ResourceClaim{structuredParameters(testClaimReserved)}, + expectedClaims: func() []resourceapi.ResourceClaim { claim := testClaimAllocated.DeepCopy() claim.Finalizers = []string{} claim.Status.Allocation = nil - return []resourcev1alpha2.ResourceClaim{*claim} + return []resourceapi.ResourceClaim{*claim} }(), expectedMetrics: expectedMetrics{0, 0}, }, { - name: "dont-clear-reserved-delayed-allocation-structured", + name: "dont-clear-reserved-structured", pods: []*v1.Pod{testPodWithResource}, key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { + claims: func() []*resourceapi.ResourceClaim { claim := structuredParameters(testClaimReserved) claim = reserveClaim(claim, otherTestPod) - return []*resourcev1alpha2.ResourceClaim{claim} + return []*resourceapi.ResourceClaim{claim} }(), - expectedClaims: []resourcev1alpha2.ResourceClaim{*structuredParameters(testClaimReserved)}, + expectedClaims: []resourceapi.ResourceClaim{*structuredParameters(testClaimReserved)}, expectedMetrics: expectedMetrics{0, 0}, }, { - name: "clear-reserved-immediate-allocation", + name: "clear-reserved-structured-deleted", pods: []*v1.Pod{}, key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { - claim := testClaimReserved.DeepCopy() - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate - return []*resourcev1alpha2.ResourceClaim{claim} - }(), - expectedClaims: func() []resourcev1alpha2.ResourceClaim { - claim := testClaimAllocated.DeepCopy() - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate - return []resourcev1alpha2.ResourceClaim{*claim} - }(), - expectedMetrics: expectedMetrics{0, 0}, - }, - { - name: "clear-reserved-immediate-allocation-structured", - pods: []*v1.Pod{}, - key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { + claims: func() []*resourceapi.ResourceClaim { claim := structuredParameters(testClaimReserved.DeepCopy()) - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate - return []*resourcev1alpha2.ResourceClaim{claim} - }(), - expectedClaims: func() []resourcev1alpha2.ResourceClaim { - claim := structuredParameters(testClaimAllocated.DeepCopy()) - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate - return []resourcev1alpha2.ResourceClaim{*claim} - }(), - expectedMetrics: expectedMetrics{0, 0}, - }, - { - name: "clear-reserved-immediate-allocation-structured-deleted", - pods: []*v1.Pod{}, - key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { - claim := structuredParameters(testClaimReserved.DeepCopy()) - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate claim.DeletionTimestamp = &metav1.Time{} - return []*resourcev1alpha2.ResourceClaim{claim} + return []*resourceapi.ResourceClaim{claim} }(), - expectedClaims: func() []resourcev1alpha2.ResourceClaim { + expectedClaims: func() []resourceapi.ResourceClaim { claim := structuredParameters(testClaimAllocated.DeepCopy()) - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate claim.DeletionTimestamp = &metav1.Time{} claim.Finalizers = []string{} claim.Status.Allocation = nil - return []resourcev1alpha2.ResourceClaim{*claim} + return []resourceapi.ResourceClaim{*claim} }(), expectedMetrics: expectedMetrics{0, 0}, }, { - name: "immediate-allocation-structured-deleted", + name: "structured-deleted", pods: []*v1.Pod{}, key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { + claims: func() []*resourceapi.ResourceClaim { claim := structuredParameters(testClaimAllocated.DeepCopy()) - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate claim.DeletionTimestamp = &metav1.Time{} - return []*resourcev1alpha2.ResourceClaim{claim} + return []*resourceapi.ResourceClaim{claim} }(), - expectedClaims: func() []resourcev1alpha2.ResourceClaim { + expectedClaims: func() []resourceapi.ResourceClaim { claim := structuredParameters(testClaimAllocated.DeepCopy()) - claim.Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate claim.DeletionTimestamp = &metav1.Time{} claim.Finalizers = []string{} claim.Status.Allocation = nil - return []resourcev1alpha2.ResourceClaim{*claim} + return []resourceapi.ResourceClaim{*claim} }(), expectedMetrics: expectedMetrics{0, 0}, }, { - name: "clear-reserved-when-done-delayed-allocation", + name: "clear-reserved-when-done", pods: func() []*v1.Pod { pods := []*v1.Pod{testPodWithResource.DeepCopy()} pods[0].Status.Phase = v1.PodSucceeded return pods }(), key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { - claims := []*resourcev1alpha2.ResourceClaim{testClaimReserved.DeepCopy()} + claims: func() []*resourceapi.ResourceClaim { + claims := []*resourceapi.ResourceClaim{testClaimReserved.DeepCopy()} claims[0].OwnerReferences = nil return claims }(), - expectedClaims: func() []resourcev1alpha2.ResourceClaim { - claims := []resourcev1alpha2.ResourceClaim{*testClaimAllocated.DeepCopy()} + expectedClaims: func() []resourceapi.ResourceClaim { + claims := []resourceapi.ResourceClaim{*testClaimAllocated.DeepCopy()} claims[0].OwnerReferences = nil claims[0].Status.DeallocationRequested = true return claims }(), expectedMetrics: expectedMetrics{0, 0}, }, - { - name: "clear-reserved-when-done-immediate-allocation", - pods: func() []*v1.Pod { - pods := []*v1.Pod{testPodWithResource.DeepCopy()} - pods[0].Status.Phase = v1.PodSucceeded - return pods - }(), - key: claimKey(testClaimReserved), - claims: func() []*resourcev1alpha2.ResourceClaim { - claims := []*resourcev1alpha2.ResourceClaim{testClaimReserved.DeepCopy()} - claims[0].OwnerReferences = nil - claims[0].Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate - return claims - }(), - expectedClaims: func() []resourcev1alpha2.ResourceClaim { - claims := []resourcev1alpha2.ResourceClaim{*testClaimAllocated.DeepCopy()} - claims[0].OwnerReferences = nil - claims[0].Spec.AllocationMode = resourcev1alpha2.AllocationModeImmediate - return claims - }(), - expectedMetrics: expectedMetrics{0, 0}, - }, { name: "remove-reserved", pods: []*v1.Pod{testPod}, key: claimKey(testClaimReservedTwice), - claims: []*resourcev1alpha2.ResourceClaim{testClaimReservedTwice}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*testClaimReserved}, + claims: []*resourceapi.ResourceClaim{testClaimReservedTwice}, + expectedClaims: []resourceapi.ResourceClaim{*testClaimReserved}, expectedMetrics: expectedMetrics{0, 0}, }, { @@ -448,7 +390,7 @@ func TestSyncHandler(t *testing.T) { return pods }(), key: claimKey(testClaimReserved), - claims: []*resourcev1alpha2.ResourceClaim{testClaimReserved}, + claims: []*resourceapi.ResourceClaim{testClaimReserved}, expectedClaims: nil, expectedMetrics: expectedMetrics{0, 0}, }, @@ -456,24 +398,24 @@ func TestSyncHandler(t *testing.T) { name: "trigger-allocation", pods: []*v1.Pod{testPodWithNodeName}, key: podKey(testPodWithNodeName), - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, - claims: []*resourcev1alpha2.ResourceClaim{generatedTestClaim}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*generatedTestClaim}, + templates: []*resourceapi.ResourceClaimTemplate{template}, + claims: []*resourceapi.ResourceClaim{generatedTestClaim}, + expectedClaims: []resourceapi.ResourceClaim{*generatedTestClaim}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithNodeName.Name: { {Name: testPodWithNodeName.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, }, }, - expectedPodSchedulingContexts: []resourcev1alpha2.PodSchedulingContext{podSchedulingContext}, + expectedPodSchedulingContexts: []resourceapi.PodSchedulingContext{podSchedulingContext}, expectedMetrics: expectedMetrics{0, 0}, }, { name: "add-reserved", pods: []*v1.Pod{testPodWithNodeName}, key: podKey(testPodWithNodeName), - templates: []*resourcev1alpha2.ResourceClaimTemplate{template}, - claims: []*resourcev1alpha2.ResourceClaim{generatedTestClaimAllocated}, - expectedClaims: []resourcev1alpha2.ResourceClaim{*generatedTestClaimReserved}, + templates: []*resourceapi.ResourceClaimTemplate{template}, + claims: []*resourceapi.ResourceClaim{generatedTestClaimAllocated}, + expectedClaims: []resourceapi.ResourceClaim{*generatedTestClaimReserved}, expectedStatuses: map[string][]v1.PodResourceClaimStatus{ testPodWithNodeName.Name: { {Name: testPodWithNodeName.Spec.ResourceClaims[0].Name, ResourceClaimName: &generatedTestClaim.Name}, @@ -509,9 +451,9 @@ func TestSyncHandler(t *testing.T) { setupMetrics() informerFactory := informers.NewSharedInformerFactory(fakeKubeClient, controller.NoResyncPeriodFunc()) podInformer := informerFactory.Core().V1().Pods() - podSchedulingInformer := informerFactory.Resource().V1alpha2().PodSchedulingContexts() - claimInformer := informerFactory.Resource().V1alpha2().ResourceClaims() - templateInformer := informerFactory.Resource().V1alpha2().ResourceClaimTemplates() + podSchedulingInformer := informerFactory.Resource().V1alpha3().PodSchedulingContexts() + claimInformer := informerFactory.Resource().V1alpha3().ResourceClaims() + templateInformer := informerFactory.Resource().V1alpha3().ResourceClaimTemplates() ec, err := NewController(klog.FromContext(ctx), fakeKubeClient, podInformer, podSchedulingInformer, claimInformer, templateInformer) if err != nil { @@ -549,7 +491,7 @@ func TestSyncHandler(t *testing.T) { t.Fatalf("unexpected success") } - claims, err := fakeKubeClient.ResourceV1alpha2().ResourceClaims("").List(ctx, metav1.ListOptions{}) + claims, err := fakeKubeClient.ResourceV1alpha3().ResourceClaims("").List(ctx, metav1.ListOptions{}) if err != nil { t.Fatalf("unexpected error while listing claims: %v", err) } @@ -571,7 +513,7 @@ func TestSyncHandler(t *testing.T) { } assert.Equal(t, tc.expectedStatuses, actualStatuses, "pod resource claim statuses") - scheduling, err := fakeKubeClient.ResourceV1alpha2().PodSchedulingContexts("").List(ctx, metav1.ListOptions{}) + scheduling, err := fakeKubeClient.ResourceV1alpha3().PodSchedulingContexts("").List(ctx, metav1.ListOptions{}) if err != nil { t.Fatalf("unexpected error while listing claims: %v", err) } @@ -582,13 +524,9 @@ func TestSyncHandler(t *testing.T) { } } -func makeClaim(name, namespace, classname string, owner *metav1.OwnerReference) *resourcev1alpha2.ResourceClaim { - claim := &resourcev1alpha2.ResourceClaim{ +func makeClaim(name, namespace, classname string, owner *metav1.OwnerReference) *resourceapi.ResourceClaim { + claim := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: namespace}, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: classname, - AllocationMode: resourcev1alpha2.AllocationModeWaitForFirstConsumer, - }, } if owner != nil { claim.OwnerReferences = []metav1.OwnerReference{*owner} @@ -597,18 +535,14 @@ func makeClaim(name, namespace, classname string, owner *metav1.OwnerReference) return claim } -func makeGeneratedClaim(podClaimName, generateName, namespace, classname string, createCounter int, owner *metav1.OwnerReference) *resourcev1alpha2.ResourceClaim { - claim := &resourcev1alpha2.ResourceClaim{ +func makeGeneratedClaim(podClaimName, generateName, namespace, classname string, createCounter int, owner *metav1.OwnerReference) *resourceapi.ResourceClaim { + claim := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%s-%d", generateName, createCounter), GenerateName: generateName, Namespace: namespace, Annotations: map[string]string{"resource.kubernetes.io/pod-claim-name": podClaimName}, }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: classname, - AllocationMode: resourcev1alpha2.AllocationModeWaitForFirstConsumer, - }, } if owner != nil { claim.OwnerReferences = []metav1.OwnerReference{*owner} @@ -617,26 +551,24 @@ func makeGeneratedClaim(podClaimName, generateName, namespace, classname string, return claim } -func allocateClaim(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { +func allocateClaim(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { claim = claim.DeepCopy() - claim.Status.Allocation = &resourcev1alpha2.AllocationResult{ - Shareable: true, - } + claim.Status.Allocation = &resourceapi.AllocationResult{} return claim } -func structuredParameters(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { +func structuredParameters(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { claim = claim.DeepCopy() // As far the controller is concerned, a claim was allocated by us if it has // this finalizer. For testing we don't need to update the allocation result. - claim.Finalizers = append(claim.Finalizers, resourcev1alpha2.Finalizer) + claim.Finalizers = append(claim.Finalizers, resourceapi.Finalizer) return claim } -func reserveClaim(claim *resourcev1alpha2.ResourceClaim, pod *v1.Pod) *resourcev1alpha2.ResourceClaim { +func reserveClaim(claim *resourceapi.ResourceClaim, pod *v1.Pod) *resourceapi.ResourceClaim { claim = claim.DeepCopy() claim.Status.ReservedFor = append(claim.Status.ReservedFor, - resourcev1alpha2.ResourceClaimConsumerReference{ + resourceapi.ResourceClaimConsumerReference{ Resource: "pods", Name: pod.Name, UID: pod.UID, @@ -663,14 +595,9 @@ func makePod(name, namespace string, uid types.UID, podClaims ...v1.PodResourceC return pod } -func makeTemplate(name, namespace, classname string) *resourcev1alpha2.ResourceClaimTemplate { - template := &resourcev1alpha2.ResourceClaimTemplate{ +func makeTemplate(name, namespace, classname string) *resourceapi.ResourceClaimTemplate { + template := &resourceapi.ResourceClaimTemplate{ ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: namespace}, - Spec: resourcev1alpha2.ResourceClaimTemplateSpec{ - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: classname, - }, - }, } return template } @@ -679,7 +606,7 @@ func podKey(pod *v1.Pod) string { return podKeyPrefix + pod.Namespace + "/" + pod.Name } -func claimKey(claim *resourcev1alpha2.ResourceClaim) string { +func claimKey(claim *resourceapi.ResourceClaim) string { return claimKeyPrefix + claim.Namespace + "/" + claim.Name } @@ -695,7 +622,7 @@ func makeOwnerReference(pod *v1.Pod, isController bool) *metav1.OwnerReference { } } -func normalizeClaims(claims []resourcev1alpha2.ResourceClaim) []resourcev1alpha2.ResourceClaim { +func normalizeClaims(claims []resourceapi.ResourceClaim) []resourceapi.ResourceClaim { sort.Slice(claims, func(i, j int) bool { if claims[i].Namespace < claims[j].Namespace { return true @@ -709,15 +636,11 @@ func normalizeClaims(claims []resourcev1alpha2.ResourceClaim) []resourcev1alpha2 if len(claims[i].Status.ReservedFor) == 0 { claims[i].Status.ReservedFor = nil } - if claims[i].Spec.AllocationMode == "" { - // This emulates defaulting. - claims[i].Spec.AllocationMode = resourcev1alpha2.AllocationModeWaitForFirstConsumer - } } return claims } -func normalizeScheduling(scheduling []resourcev1alpha2.PodSchedulingContext) []resourcev1alpha2.PodSchedulingContext { +func normalizeScheduling(scheduling []resourceapi.PodSchedulingContext) []resourceapi.PodSchedulingContext { sort.Slice(scheduling, func(i, j int) bool { return scheduling[i].Namespace < scheduling[j].Namespace || scheduling[i].Name < scheduling[j].Name @@ -739,7 +662,7 @@ func createResourceClaimReactor() func(action k8stesting.Action) (handled bool, return func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { mutex.Lock() defer mutex.Unlock() - claim := action.(k8stesting.CreateAction).GetObject().(*resourcev1alpha2.ResourceClaim) + claim := action.(k8stesting.CreateAction).GetObject().(*resourceapi.ResourceClaim) if claim.Name == "" && claim.GenerateName != "" { claim.Name = fmt.Sprintf("%s-%d", claim.GenerateName, nameCounter) } diff --git a/pkg/controlplane/apiserver/aggregator.go b/pkg/controlplane/apiserver/aggregator.go index 61acedb4b734d..ef3b58871b8d5 100644 --- a/pkg/controlplane/apiserver/aggregator.go +++ b/pkg/controlplane/apiserver/aggregator.go @@ -292,7 +292,7 @@ func DefaultGenericAPIServicePriorities() map[schema.GroupVersion]APIServicePrio {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"}: {Group: 16100, Version: 12}, {Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"}: {Group: 16100, Version: 9}, {Group: "internal.apiserver.k8s.io", Version: "v1alpha1"}: {Group: 16000, Version: 9}, - {Group: "resource.k8s.io", Version: "v1alpha2"}: {Group: 15900, Version: 9}, + {Group: "resource.k8s.io", Version: "v1alpha3"}: {Group: 15900, Version: 9}, {Group: "storagemigration.k8s.io", Version: "v1alpha1"}: {Group: 15800, Version: 9}, // Append a new group to the end of the list if unsure. // You can use min(existing group)-100 as the initial value for a group. diff --git a/pkg/controlplane/instance.go b/pkg/controlplane/instance.go index 205162b2f35d3..e52b901a2c189 100644 --- a/pkg/controlplane/instance.go +++ b/pkg/controlplane/instance.go @@ -47,7 +47,7 @@ import ( nodev1 "k8s.io/api/node/v1" policyapiv1 "k8s.io/api/policy/v1" rbacv1 "k8s.io/api/rbac/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" schedulingapiv1 "k8s.io/api/scheduling/v1" storageapiv1 "k8s.io/api/storage/v1" storageapiv1alpha1 "k8s.io/api/storage/v1alpha1" @@ -475,7 +475,7 @@ var ( admissionregistrationv1alpha1.SchemeGroupVersion, apiserverinternalv1alpha1.SchemeGroupVersion, authenticationv1alpha1.SchemeGroupVersion, - resourcev1alpha2.SchemeGroupVersion, + resourceapi.SchemeGroupVersion, certificatesv1alpha1.SchemeGroupVersion, networkingapiv1alpha1.SchemeGroupVersion, storageapiv1alpha1.SchemeGroupVersion, diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 00b5b69cde1d2..fc4148ed5b695 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -882,50 +882,42 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/rbac/v1beta1.RoleList": schema_k8sio_api_rbac_v1beta1_RoleList(ref), "k8s.io/api/rbac/v1beta1.RoleRef": schema_k8sio_api_rbac_v1beta1_RoleRef(ref), "k8s.io/api/rbac/v1beta1.Subject": schema_k8sio_api_rbac_v1beta1_Subject(ref), - "k8s.io/api/resource/v1alpha2.AllocationResult": schema_k8sio_api_resource_v1alpha2_AllocationResult(ref), - "k8s.io/api/resource/v1alpha2.AllocationResultModel": schema_k8sio_api_resource_v1alpha2_AllocationResultModel(ref), - "k8s.io/api/resource/v1alpha2.DriverAllocationResult": schema_k8sio_api_resource_v1alpha2_DriverAllocationResult(ref), - "k8s.io/api/resource/v1alpha2.DriverRequests": schema_k8sio_api_resource_v1alpha2_DriverRequests(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesAllocationResult": schema_k8sio_api_resource_v1alpha2_NamedResourcesAllocationResult(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesAttribute": schema_k8sio_api_resource_v1alpha2_NamedResourcesAttribute(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesAttributeValue": schema_k8sio_api_resource_v1alpha2_NamedResourcesAttributeValue(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesFilter": schema_k8sio_api_resource_v1alpha2_NamedResourcesFilter(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesInstance": schema_k8sio_api_resource_v1alpha2_NamedResourcesInstance(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesIntSlice": schema_k8sio_api_resource_v1alpha2_NamedResourcesIntSlice(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesRequest": schema_k8sio_api_resource_v1alpha2_NamedResourcesRequest(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesResources": schema_k8sio_api_resource_v1alpha2_NamedResourcesResources(ref), - "k8s.io/api/resource/v1alpha2.NamedResourcesStringSlice": schema_k8sio_api_resource_v1alpha2_NamedResourcesStringSlice(ref), - "k8s.io/api/resource/v1alpha2.PodSchedulingContext": schema_k8sio_api_resource_v1alpha2_PodSchedulingContext(ref), - "k8s.io/api/resource/v1alpha2.PodSchedulingContextList": schema_k8sio_api_resource_v1alpha2_PodSchedulingContextList(ref), - "k8s.io/api/resource/v1alpha2.PodSchedulingContextSpec": schema_k8sio_api_resource_v1alpha2_PodSchedulingContextSpec(ref), - "k8s.io/api/resource/v1alpha2.PodSchedulingContextStatus": schema_k8sio_api_resource_v1alpha2_PodSchedulingContextStatus(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaim": schema_k8sio_api_resource_v1alpha2_ResourceClaim(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimConsumerReference": schema_k8sio_api_resource_v1alpha2_ResourceClaimConsumerReference(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimList": schema_k8sio_api_resource_v1alpha2_ResourceClaimList(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimParameters": schema_k8sio_api_resource_v1alpha2_ResourceClaimParameters(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimParametersList": schema_k8sio_api_resource_v1alpha2_ResourceClaimParametersList(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimParametersReference": schema_k8sio_api_resource_v1alpha2_ResourceClaimParametersReference(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimSchedulingStatus": schema_k8sio_api_resource_v1alpha2_ResourceClaimSchedulingStatus(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimSpec": schema_k8sio_api_resource_v1alpha2_ResourceClaimSpec(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimStatus": schema_k8sio_api_resource_v1alpha2_ResourceClaimStatus(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimTemplate": schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplate(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimTemplateList": schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplateList(ref), - "k8s.io/api/resource/v1alpha2.ResourceClaimTemplateSpec": schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplateSpec(ref), - "k8s.io/api/resource/v1alpha2.ResourceClass": schema_k8sio_api_resource_v1alpha2_ResourceClass(ref), - "k8s.io/api/resource/v1alpha2.ResourceClassList": schema_k8sio_api_resource_v1alpha2_ResourceClassList(ref), - "k8s.io/api/resource/v1alpha2.ResourceClassParameters": schema_k8sio_api_resource_v1alpha2_ResourceClassParameters(ref), - "k8s.io/api/resource/v1alpha2.ResourceClassParametersList": schema_k8sio_api_resource_v1alpha2_ResourceClassParametersList(ref), - "k8s.io/api/resource/v1alpha2.ResourceClassParametersReference": schema_k8sio_api_resource_v1alpha2_ResourceClassParametersReference(ref), - "k8s.io/api/resource/v1alpha2.ResourceFilter": schema_k8sio_api_resource_v1alpha2_ResourceFilter(ref), - "k8s.io/api/resource/v1alpha2.ResourceFilterModel": schema_k8sio_api_resource_v1alpha2_ResourceFilterModel(ref), - "k8s.io/api/resource/v1alpha2.ResourceHandle": schema_k8sio_api_resource_v1alpha2_ResourceHandle(ref), - "k8s.io/api/resource/v1alpha2.ResourceModel": schema_k8sio_api_resource_v1alpha2_ResourceModel(ref), - "k8s.io/api/resource/v1alpha2.ResourceRequest": schema_k8sio_api_resource_v1alpha2_ResourceRequest(ref), - "k8s.io/api/resource/v1alpha2.ResourceRequestModel": schema_k8sio_api_resource_v1alpha2_ResourceRequestModel(ref), - "k8s.io/api/resource/v1alpha2.ResourceSlice": schema_k8sio_api_resource_v1alpha2_ResourceSlice(ref), - "k8s.io/api/resource/v1alpha2.ResourceSliceList": schema_k8sio_api_resource_v1alpha2_ResourceSliceList(ref), - "k8s.io/api/resource/v1alpha2.StructuredResourceHandle": schema_k8sio_api_resource_v1alpha2_StructuredResourceHandle(ref), - "k8s.io/api/resource/v1alpha2.VendorParameters": schema_k8sio_api_resource_v1alpha2_VendorParameters(ref), + "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.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), + "k8s.io/api/resource/v1alpha3.DeviceAttribute": schema_k8sio_api_resource_v1alpha3_DeviceAttribute(ref), + "k8s.io/api/resource/v1alpha3.DeviceClaim": schema_k8sio_api_resource_v1alpha3_DeviceClaim(ref), + "k8s.io/api/resource/v1alpha3.DeviceClaimConfiguration": schema_k8sio_api_resource_v1alpha3_DeviceClaimConfiguration(ref), + "k8s.io/api/resource/v1alpha3.DeviceClass": schema_k8sio_api_resource_v1alpha3_DeviceClass(ref), + "k8s.io/api/resource/v1alpha3.DeviceClassConfiguration": schema_k8sio_api_resource_v1alpha3_DeviceClassConfiguration(ref), + "k8s.io/api/resource/v1alpha3.DeviceClassList": schema_k8sio_api_resource_v1alpha3_DeviceClassList(ref), + "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.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), + "k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration": schema_k8sio_api_resource_v1alpha3_OpaqueDeviceConfiguration(ref), + "k8s.io/api/resource/v1alpha3.PodSchedulingContext": schema_k8sio_api_resource_v1alpha3_PodSchedulingContext(ref), + "k8s.io/api/resource/v1alpha3.PodSchedulingContextList": schema_k8sio_api_resource_v1alpha3_PodSchedulingContextList(ref), + "k8s.io/api/resource/v1alpha3.PodSchedulingContextSpec": schema_k8sio_api_resource_v1alpha3_PodSchedulingContextSpec(ref), + "k8s.io/api/resource/v1alpha3.PodSchedulingContextStatus": schema_k8sio_api_resource_v1alpha3_PodSchedulingContextStatus(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaim": schema_k8sio_api_resource_v1alpha3_ResourceClaim(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimConsumerReference": schema_k8sio_api_resource_v1alpha3_ResourceClaimConsumerReference(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimList": schema_k8sio_api_resource_v1alpha3_ResourceClaimList(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimSchedulingStatus": schema_k8sio_api_resource_v1alpha3_ResourceClaimSchedulingStatus(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimSpec": schema_k8sio_api_resource_v1alpha3_ResourceClaimSpec(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimStatus": schema_k8sio_api_resource_v1alpha3_ResourceClaimStatus(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimTemplate": schema_k8sio_api_resource_v1alpha3_ResourceClaimTemplate(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimTemplateList": schema_k8sio_api_resource_v1alpha3_ResourceClaimTemplateList(ref), + "k8s.io/api/resource/v1alpha3.ResourceClaimTemplateSpec": schema_k8sio_api_resource_v1alpha3_ResourceClaimTemplateSpec(ref), + "k8s.io/api/resource/v1alpha3.ResourcePool": schema_k8sio_api_resource_v1alpha3_ResourcePool(ref), + "k8s.io/api/resource/v1alpha3.ResourceSlice": schema_k8sio_api_resource_v1alpha3_ResourceSlice(ref), + "k8s.io/api/resource/v1alpha3.ResourceSliceList": schema_k8sio_api_resource_v1alpha3_ResourceSliceList(ref), + "k8s.io/api/resource/v1alpha3.ResourceSliceSpec": schema_k8sio_api_resource_v1alpha3_ResourceSliceSpec(ref), "k8s.io/api/scheduling/v1.PriorityClass": schema_k8sio_api_scheduling_v1_PriorityClass(ref), "k8s.io/api/scheduling/v1.PriorityClassList": schema_k8sio_api_scheduling_v1_PriorityClassList(ref), "k8s.io/api/scheduling/v1alpha1.PriorityClass": schema_k8sio_api_scheduling_v1alpha1_PriorityClass(ref), @@ -29027,6 +29019,13 @@ func schema_k8sio_api_core_v1_ResourceClaim(ref common.ReferenceCallback) common Format: "", }, }, + "request": { + SchemaProps: spec.SchemaProps{ + Description: "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"name"}, }, @@ -45341,121 +45340,152 @@ func schema_k8sio_api_rbac_v1beta1_Subject(ref common.ReferenceCallback) common. } } -func schema_k8sio_api_resource_v1alpha2_AllocationResult(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_AllocationResult(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "AllocationResult contains attributes of an allocated resource.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "resourceHandles": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, + "devices": { + SchemaProps: spec.SchemaProps{ + Description: "Devices is the result of allocating devices.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceAllocationResult"), }, + }, + "nodeSelector": { SchemaProps: spec.SchemaProps{ - Description: "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Description: "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere.", + Ref: ref("k8s.io/api/core/v1.NodeSelector"), + }, + }, + "controller": { + SchemaProps: spec.SchemaProps{ + Description: "Controller is the name of the DRA driver which handled the allocation. That driver is also responsible for deallocating the claim. It is empty when the claim can be deallocated without involving a driver.\n\nA driver may allocate devices provided by other drivers, so this driver name here can be different from the driver names listed for the results.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha3.DeviceAllocationResult"}, + } +} + +func schema_k8sio_api_resource_v1alpha3_BasicDevice(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BasicDevice defines one device instance using fields that are supported by all clients which support DRA.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "attributes": { + SchemaProps: spec.SchemaProps{ + Description: "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.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceHandle"), + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceAttribute"), }, }, }, }, }, - "availableOnNodes": { - SchemaProps: spec.SchemaProps{ - Description: "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere.", - Ref: ref("k8s.io/api/core/v1.NodeSelector"), - }, - }, - "shareable": { + "capacity": { SchemaProps: spec.SchemaProps{ - Description: "Shareable determines whether the resource supports more than one consumer at a time.", - Type: []string{"boolean"}, - Format: "", + 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: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, }, }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha2.ResourceHandle"}, + "k8s.io/api/resource/v1alpha3.DeviceAttribute", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } -func schema_k8sio_api_resource_v1alpha2_AllocationResultModel(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_CELDeviceSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "AllocationResultModel must have one and only one field set.", + Description: "CELDeviceSelector contains a CEL expression for selecting a device.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "namedResources": { + "expression": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes the allocation result when using the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesAllocationResult"), + Description: "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)", + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, + Required: []string{"expression"}, }, }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesAllocationResult"}, } } -func schema_k8sio_api_resource_v1alpha2_DriverAllocationResult(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_Device(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DriverAllocationResult contains vendor parameters and the allocation result for one request.", + Description: "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "vendorRequestParameters": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "VendorRequestParameters are the per-request configuration parameters from the time that the claim was allocated.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Description: "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", + Default: "", + Type: []string{"string"}, + Format: "", }, }, - "namedResources": { + "basic": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes the allocation result when using the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesAllocationResult"), + Description: "Basic defines one device instance using fields that are supported by all clients which support DRA.", + Ref: ref("k8s.io/api/resource/v1alpha3.BasicDevice"), }, }, }, + Required: []string{"name"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesAllocationResult", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "k8s.io/api/resource/v1alpha3.BasicDevice"}, } } -func schema_k8sio_api_resource_v1alpha2_DriverRequests(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceAllocationConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DriverRequests describes all resources that are needed from one particular driver.", + Description: "DeviceAllocationConfiguration gets embedded in an AllocationResult.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "driverName": { + "source": { SchemaProps: spec.SchemaProps{ - Description: "DriverName is the name used by the DRA driver kubelet plugin.", + Description: "Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "vendorParameters": { - SchemaProps: spec.SchemaProps{ - Description: "VendorParameters are arbitrary setup parameters for all requests of the claim. They are ignored while allocating the claim.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, "requests": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -45463,129 +45493,99 @@ func schema_k8sio_api_resource_v1alpha2_DriverRequests(ref common.ReferenceCallb }, }, SchemaProps: spec.SchemaProps{ - Description: "Requests describes all resources that are needed from the driver.", + Description: "Requests lists the names of requests where the configuration applies. If empty, its applies to all requests.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceRequest"), + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceRequest", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_NamedResourcesAllocationResult(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesAllocationResult is used in AllocationResultModel.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { + "opaque": { SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the selected resource instance.", - Default: "", - Type: []string{"string"}, - Format: "", + Description: "Opaque provides driver-specific configuration parameters.", + Ref: ref("k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"), }, }, }, - Required: []string{"name"}, + Required: []string{"source"}, }, }, + Dependencies: []string{ + "k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"}, } } -func schema_k8sio_api_resource_v1alpha2_NamedResourcesAttribute(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceAllocationResult(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesAttribute is a combination of an attribute name and its value.", + Description: "DeviceAllocationResult is the result of allocating devices.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "quantity": { - SchemaProps: spec.SchemaProps{ - Description: "QuantityValue is a quantity.", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - "bool": { - SchemaProps: spec.SchemaProps{ - Description: "BoolValue is a true/false value.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "int": { - SchemaProps: spec.SchemaProps{ - Description: "IntValue is a 64-bit integer.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "intSlice": { - SchemaProps: spec.SchemaProps{ - Description: "IntSliceValue is an array of 64-bit integers.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesIntSlice"), + "results": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "string": { SchemaProps: spec.SchemaProps{ - Description: "StringValue is a string.", - Type: []string{"string"}, - Format: "", + Description: "Results lists all allocated devices.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceRequestAllocationResult"), + }, + }, + }, }, }, - "stringSlice": { - SchemaProps: spec.SchemaProps{ - Description: "StringSliceValue is an array of strings.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesStringSlice"), + "config": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "version": { SchemaProps: spec.SchemaProps{ - Description: "VersionValue is a semantic version according to semver.org spec 2.0.0.", - Type: []string{"string"}, - Format: "", + Description: "This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag.\n\nThis includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceAllocationConfiguration"), + }, + }, + }, }, }, }, - Required: []string{"name"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesIntSlice", "k8s.io/api/resource/v1alpha2.NamedResourcesStringSlice", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + "k8s.io/api/resource/v1alpha3.DeviceAllocationConfiguration", "k8s.io/api/resource/v1alpha3.DeviceRequestAllocationResult"}, } } -func schema_k8sio_api_resource_v1alpha2_NamedResourcesAttributeValue(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceAttribute(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesAttributeValue must have one and only one field set.", + Description: "DeviceAttribute must have exactly one field set.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "quantity": { + "int": { SchemaProps: spec.SchemaProps{ - Description: "QuantityValue is a quantity.", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Description: "IntValue is a number.", + Type: []string{"integer"}, + Format: "int64", }, }, "bool": { @@ -45595,35 +45595,16 @@ func schema_k8sio_api_resource_v1alpha2_NamedResourcesAttributeValue(ref common. Format: "", }, }, - "int": { - SchemaProps: spec.SchemaProps{ - Description: "IntValue is a 64-bit integer.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "intSlice": { - SchemaProps: spec.SchemaProps{ - Description: "IntSliceValue is an array of 64-bit integers.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesIntSlice"), - }, - }, "string": { SchemaProps: spec.SchemaProps{ - Description: "StringValue is a string.", + Description: "StringValue is a string. Must not be longer than 64 characters.", Type: []string{"string"}, Format: "", }, }, - "stringSlice": { - SchemaProps: spec.SchemaProps{ - Description: "StringSliceValue is an array of strings.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesStringSlice"), - }, - }, "version": { SchemaProps: spec.SchemaProps{ - Description: "VersionValue is a semantic version according to semver.org spec 2.0.0.", + Description: "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.", Type: []string{"string"}, Format: "", }, @@ -45631,182 +45612,96 @@ func schema_k8sio_api_resource_v1alpha2_NamedResourcesAttributeValue(ref common. }, }, }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesIntSlice", "k8s.io/api/resource/v1alpha2.NamedResourcesStringSlice", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } -func schema_k8sio_api_resource_v1alpha2_NamedResourcesFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesFilter is used in ResourceFilterModel.", + Description: "DeviceClaim defines how to request devices with a ResourceClaim.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type in NamedResourcesAttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"selector"}, - }, - }, - } -} - -func schema_k8sio_api_resource_v1alpha2_NamedResourcesInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesInstance represents one individual hardware instance that can be selected based on its attributes.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is unique identifier among all resource instances managed by the driver on the node. It must be a DNS subdomain.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "attributes": { + "requests": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "Attributes defines the attributes of this resource instance. The name of each attribute must be unique.", + Description: "Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesAttribute"), + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceRequest"), }, }, }, }, }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesAttribute"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_NamedResourcesIntSlice(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesIntSlice contains a slice of 64-bit integers.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ints": { + "constraints": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "Ints is the slice of 64-bit integers.", + Description: "These constraints must be satisfied by the set of devices that get allocated for the claim.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceConstraint"), }, }, }, }, }, - }, - Required: []string{"ints"}, - }, - }, - } -} - -func schema_k8sio_api_resource_v1alpha2_NamedResourcesRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesRequest is used in ResourceRequestModel.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Selector is a CEL expression which must evaluate to true if a resource instance is suitable. The language is as defined in https://kubernetes.io/docs/reference/using-api/cel/\n\nIn addition, for each type NamedResourcesin AttributeValue there is a map that resolves to the corresponding value of the instance under evaluation. For example:\n\n attributes.quantity[\"a\"].isGreaterThan(quantity(\"0\")) &&\n attributes.stringslice[\"b\"].isSorted()", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"selector"}, - }, - }, - } -} - -func schema_k8sio_api_resource_v1alpha2_NamedResourcesResources(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesResources is used in ResourceModel.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "instances": { + "config": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "The list of all individual resources instances currently available.", + Description: "This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesInstance"), + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceClaimConfiguration"), }, }, }, }, }, }, - Required: []string{"instances"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesInstance"}, + "k8s.io/api/resource/v1alpha3.DeviceClaimConfiguration", "k8s.io/api/resource/v1alpha3.DeviceConstraint", "k8s.io/api/resource/v1alpha3.DeviceRequest"}, } } -func schema_k8sio_api_resource_v1alpha2_NamedResourcesStringSlice(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceClaimConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NamedResourcesStringSlice contains a slice of strings.", + Description: "DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "strings": { + "requests": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "Strings is the slice of strings.", + Description: "Requests lists the names of requests where the configuration applies. If empty, it applies to all requests.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -45819,18 +45714,25 @@ func schema_k8sio_api_resource_v1alpha2_NamedResourcesStringSlice(ref common.Ref }, }, }, + "opaque": { + SchemaProps: spec.SchemaProps{ + Description: "Opaque provides driver-specific configuration parameters.", + Ref: ref("k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"), + }, + }, }, - Required: []string{"strings"}, }, }, + Dependencies: []string{ + "k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"}, } } -func schema_k8sio_api_resource_v1alpha2_PodSchedulingContext(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + Description: "DeviceClass is a vendor or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -45856,32 +45758,46 @@ func schema_k8sio_api_resource_v1alpha2_PodSchedulingContext(ref common.Referenc }, "spec": { SchemaProps: spec.SchemaProps{ - Description: "Spec describes where resources for the Pod are needed.", + Description: "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number.", Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.PodSchedulingContextSpec"), + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceClassSpec"), }, }, - "status": { + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/resource/v1alpha3.DeviceClassSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_k8sio_api_resource_v1alpha3_DeviceClassConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DeviceClassConfiguration is used in DeviceClass.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "opaque": { SchemaProps: spec.SchemaProps{ - Description: "Status describes where resources for the Pod can be allocated.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.PodSchedulingContextStatus"), + Description: "Opaque provides driver-specific configuration parameters.", + Ref: ref("k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"), }, }, }, - Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.PodSchedulingContextSpec", "k8s.io/api/resource/v1alpha2.PodSchedulingContextStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"}, } } -func schema_k8sio_api_resource_v1alpha2_PodSchedulingContextList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PodSchedulingContextList is a collection of Pod scheduling objects.", + Description: "DeviceClassList is a collection of classes.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -45907,13 +45823,13 @@ func schema_k8sio_api_resource_v1alpha2_PodSchedulingContextList(ref common.Refe }, "items": { SchemaProps: spec.SchemaProps{ - Description: "Items is the list of PodSchedulingContext objects.", + Description: "Items is the list of resource classes.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.PodSchedulingContext"), + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceClass"), }, }, }, @@ -45924,239 +45840,306 @@ func schema_k8sio_api_resource_v1alpha2_PodSchedulingContextList(ref common.Refe }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.PodSchedulingContext", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "k8s.io/api/resource/v1alpha3.DeviceClass", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_PodSchedulingContextSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceClassSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PodSchedulingContextSpec describes where resources for the Pod are needed.", + Description: "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "selectedNode": { + "selectors": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ - Description: "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", - Type: []string{"string"}, - Format: "", + Description: "Each selector must be satisfied by a device which is claimed via this class.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceSelector"), + }, + }, + }, }, }, - "potentialNodes": { + "config": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", + Description: "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceClassConfiguration"), }, }, }, }, }, + "suitableNodes": { + SchemaProps: spec.SchemaProps{ + Description: "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a claim that has not been allocated yet *and* that claim gets allocated through a control plane controller. It is ignored when the claim does not use a control plane controller for allocation.\n\nSetting this field is optional. If unset, all Nodes are candidates.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", + Ref: ref("k8s.io/api/core/v1.NodeSelector"), + }, + }, }, }, }, + Dependencies: []string{ + "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha3.DeviceClassConfiguration", "k8s.io/api/resource/v1alpha3.DeviceSelector"}, } } -func schema_k8sio_api_resource_v1alpha2_PodSchedulingContextStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", + Description: "DeviceConfiguration must have exactly one field set. It gets embedded inline in some other structs which have other fields, so field names must not conflict with those.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "resourceClaims": { + "opaque": { + SchemaProps: spec.SchemaProps{ + Description: "Opaque provides driver-specific configuration parameters.", + Ref: ref("k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/resource/v1alpha3.OpaqueDeviceConfiguration"}, + } +} + +func schema_k8sio_api_resource_v1alpha3_DeviceConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DeviceConstraint must have exactly one field set besides Requests.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "requests": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", + "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", + Description: "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimSchedulingStatus"), + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, + "matchAttribute": { + SchemaProps: spec.SchemaProps{ + Description: "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimSchedulingStatus"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + 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.\n\nA DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Description: "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.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "apiVersion": { + "deviceClassName": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Description: "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "metadata": { + "selectors": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ - Description: "Standard object metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + Description: "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceSelector"), + }, + }, + }, }, }, - "spec": { + "countMode": { SchemaProps: spec.SchemaProps{ - Description: "Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimSpec"), + Description: "CountMode and its related fields define how many devices are needed to satisfy this request. Supported values are:\n\n- Exact: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf countMode is not specified, the default countMode is Exact. If countMode is Exact and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + Type: []string{"string"}, + Format: "", }, }, - "status": { + "count": { SchemaProps: spec.SchemaProps{ - Description: "Status describes whether the resource is available and with which attributes.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimStatus"), + Description: "Count is used only when the count mode is \"Exact\". Must be greater than zero. If CountMode is Exact and this field is not specified, the default is one.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "adminAccess": { + SchemaProps: spec.SchemaProps{ + Description: "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.", + Default: false, + Type: []string{"boolean"}, + Format: "", }, }, }, - Required: []string{"spec"}, + Required: []string{"name", "deviceClassName"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimSpec", "k8s.io/api/resource/v1alpha2.ResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/api/resource/v1alpha3.DeviceSelector"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimConsumerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceRequestAllocationResult(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", + Description: "DeviceRequestAllocationResult contains the allocation result for one request.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "apiGroup": { + "request": { SchemaProps: spec.SchemaProps{ - Description: "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", + Description: "Request is the name of the request in the claim which caused this device to be allocated. Multiple devices may have been allocated per request.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "resource": { + "driver": { SchemaProps: spec.SchemaProps{ - Description: "Resource is the type of resource being referenced, for example \"pods\".", + Description: "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", Default: "", Type: []string{"string"}, Format: "", }, }, - "name": { + "pool": { SchemaProps: spec.SchemaProps{ - Description: "Name is the name of resource being referenced.", + Description: "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.", Default: "", Type: []string{"string"}, Format: "", }, }, - "uid": { + "device": { SchemaProps: spec.SchemaProps{ - Description: "UID identifies exactly one incarnation of the resource.", + Description: "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.", Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"resource", "name", "uid"}, + Required: []string{"request", "driver", "pool", "device"}, }, }, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_DeviceSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimList is a collection of claims.", + Description: "DeviceSelector must have exactly one field set.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "cel": { SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", + Description: "CEL contains a CEL expression for selecting a device.", + Ref: ref("k8s.io/api/resource/v1alpha3.CELDeviceSelector"), }, }, - "apiVersion": { + }, + Required: []string{"cel"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/resource/v1alpha3.CELDeviceSelector"}, + } +} + +func schema_k8sio_api_resource_v1alpha3_OpaqueDeviceConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "driver": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Description: "Driver is used to determine which kubelet plugin needs to be passed these configuration parameters.\n\nAn admission policy provided by the driver developer could use this to decide whether it needs to validate them.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { + "parameters": { SchemaProps: spec.SchemaProps{ - Description: "Items is the list of resource claims.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaim"), - }, - }, - }, + Description: "Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions.", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, }, - Required: []string{"items"}, + Required: []string{"driver", "parameters"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaim", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimParameters(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_PodSchedulingContext(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimParameters defines resource requests for a ResourceClaim in an in-tree format understood by Kubernetes.", + Description: "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DRAControlPlaneController feature gate.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -46180,51 +46163,34 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimParameters(ref common.Refer Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "generatedFrom": { - SchemaProps: spec.SchemaProps{ - Description: "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the claim parameters when the parameter reference of the claim refers to some unknown type.", - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimParametersReference"), - }, - }, - "shareable": { + "spec": { SchemaProps: spec.SchemaProps{ - Description: "Shareable indicates whether the allocated claim is meant to be shareable by multiple consumers at the same time.", - Type: []string{"boolean"}, - Format: "", + Description: "Spec describes where resources for the Pod are needed.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.PodSchedulingContextSpec"), }, }, - "driverRequests": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, + "status": { SchemaProps: spec.SchemaProps{ - Description: "DriverRequests describes all resources that are needed for the allocated claim. A single claim may use resources coming from different drivers. For each driver, this array has at most one entry which then may have one or more per-driver requests.\n\nMay be empty, in which case the claim can always be allocated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.DriverRequests"), - }, - }, - }, + Description: "Status describes where resources for the Pod can be allocated.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.PodSchedulingContextStatus"), }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.DriverRequests", "k8s.io/api/resource/v1alpha2.ResourceClaimParametersReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/api/resource/v1alpha3.PodSchedulingContextSpec", "k8s.io/api/resource/v1alpha3.PodSchedulingContextStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimParametersList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_PodSchedulingContextList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimParametersList is a collection of ResourceClaimParameters.", + Description: "PodSchedulingContextList is a collection of Pod scheduling objects.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -46250,13 +46216,13 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimParametersList(ref common.R }, "items": { SchemaProps: spec.SchemaProps{ - Description: "Items is the list of node resource capacity objects.", + Description: "Items is the list of PodSchedulingContext objects.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimParameters"), + Ref: ref("k8s.io/api/resource/v1alpha3.PodSchedulingContext"), }, }, }, @@ -46267,69 +46233,32 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimParametersList(ref common.R }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimParameters", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_ResourceClaimParametersReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimParametersReference contains enough information to let you locate the parameters for a ResourceClaim. The object must be in the same namespace as the ResourceClaim.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiGroup": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata, for example \"ConfigMap\".", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of resource being referenced.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"kind", "name"}, - }, - }, + "k8s.io/api/resource/v1alpha3.PodSchedulingContext", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimSchedulingStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_PodSchedulingContextSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.", + Description: "PodSchedulingContextSpec describes where resources for the Pod are needed.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "name": { + "selectedNode": { SchemaProps: spec.SchemaProps{ - Description: "Name matches the pod.spec.resourceClaims[*].Name field.", + Description: "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", Type: []string{"string"}, Format: "", }, }, - "unsuitableNodes": { + "potentialNodes": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for.\n\nThe size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced.", + Description: "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -46348,107 +46277,48 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimSchedulingStatus(ref common } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimSpec defines how a resource is to be allocated.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "resourceClassName": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceClassName references the driver and additional parameters via the name of a ResourceClass that was created as part of the driver deployment.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "parametersRef": { - SchemaProps: spec.SchemaProps{ - Description: "ParametersRef references a separate object with arbitrary parameters that will be used by the driver when allocating a resource for the claim.\n\nThe object must be in the same namespace as the ResourceClaim.", - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimParametersReference"), - }, - }, - "allocationMode": { - SchemaProps: spec.SchemaProps{ - Description: "Allocation can start immediately or when a Pod wants to use the resource. \"WaitForFirstConsumer\" is the default.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"resourceClassName"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimParametersReference"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_ResourceClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_PodSchedulingContextStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.", + Description: "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "driverName": { - SchemaProps: spec.SchemaProps{ - Description: "DriverName is a copy of the driver name from the ResourceClass at the time when allocation started.", - Type: []string{"string"}, - Format: "", - }, - }, - "allocation": { - SchemaProps: spec.SchemaProps{ - Description: "Allocation is set by the resource driver once a resource or set of resources has been allocated successfully. If this is not specified, the resources have not been allocated yet.", - Ref: ref("k8s.io/api/resource/v1alpha2.AllocationResult"), - }, - }, - "reservedFor": { + "resourceClaims": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-map-keys": []interface{}{ - "uid", + "name", }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "uid", - "x-kubernetes-patch-strategy": "merge", + "x-kubernetes-list-type": "map", }, }, SchemaProps: spec.SchemaProps{ - Description: "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", + Description: "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimConsumerReference"), + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimSchedulingStatus"), }, }, }, }, }, - "deallocationRequested": { - SchemaProps: spec.SchemaProps{ - Description: "DeallocationRequested indicates that a ResourceClaim is to be deallocated.\n\nThe driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nWhile DeallocationRequested is set, no new consumers may be added to ReservedFor.", - Type: []string{"boolean"}, - Format: "", - }, - }, }, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.AllocationResult", "k8s.io/api/resource/v1alpha2.ResourceClaimConsumerReference"}, + "k8s.io/api/resource/v1alpha3.ResourceClaimSchedulingStatus"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimTemplate is used to produce ResourceClaim objects.", + Description: "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -46474,90 +46344,16 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplate(ref common.Referen }, "spec": { SchemaProps: spec.SchemaProps{ - Description: "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.", + Description: "Spec describes what is being requested and how to configure it. The spec is immutable.", Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimTemplateSpec"), + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimSpec"), }, }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplateList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimTemplateList is a collection of claim templates.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the list of resource claim templates.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimTemplate"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "metadata": { + "status": { SchemaProps: spec.SchemaProps{ - Description: "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.", + Description: "Status describes whether the claim is ready to use and what has been allocated.", Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClaimSpec"), + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimStatus"), }, }, }, @@ -46565,79 +46361,60 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimTemplateSpec(ref common.Ref }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClaimSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/api/resource/v1alpha3.ResourceClaimSpec", "k8s.io/api/resource/v1alpha3.ResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimConsumerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClass is used by administrators to influence how resources are allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + Description: "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "apiGroup": { SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Description: "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", Type: []string{"string"}, Format: "", }, }, - "apiVersion": { + "resource": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Description: "Resource is the type of resource being referenced, for example \"pods\".", + Default: "", Type: []string{"string"}, Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "driverName": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.\n\nResource drivers have a unique name in forward domain order (acme.example.com).", + Description: "Name is the name of resource being referenced.", Default: "", Type: []string{"string"}, Format: "", }, }, - "parametersRef": { - SchemaProps: spec.SchemaProps{ - Description: "ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.", - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClassParametersReference"), - }, - }, - "suitableNodes": { - SchemaProps: spec.SchemaProps{ - Description: "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.\n\nSetting this field is optional. If null, all nodes are candidates.", - Ref: ref("k8s.io/api/core/v1.NodeSelector"), - }, - }, - "structuredParameters": { + "uid": { SchemaProps: spec.SchemaProps{ - Description: "If and only if allocation of claims using this class is handled via structured parameters, then StructuredParameters must be set to true.", - Type: []string{"boolean"}, + Description: "UID identifies exactly one incarnation of the resource.", + Default: "", + Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"driverName"}, + Required: []string{"resource", "name", "uid"}, }, }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha2.ResourceClassParametersReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClassList is a collection of classes.", + Description: "ResourceClaimList is a collection of claims.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -46663,13 +46440,13 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClassList(ref common.ReferenceCa }, "items": { SchemaProps: spec.SchemaProps{ - Description: "Items is the list of resource classes.", + Description: "Items is the list of resource claims.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClass"), + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaim"), }, }, }, @@ -46680,345 +46457,301 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClassList(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClass", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "k8s.io/api/resource/v1alpha3.ResourceClaim", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClassParameters(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimSchedulingStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClassParameters defines resource requests for a ResourceClass in an in-tree format understood by Kubernetes.", + Description: "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Description: "Name matches the pod.spec.resourceClaims[*].Name field.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "generatedFrom": { - SchemaProps: spec.SchemaProps{ - Description: "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the class parameters when the parameter reference of the class refers to some unknown type.", - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClassParametersReference"), - }, - }, - "vendorParameters": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "VendorParameters are arbitrary setup parameters for all claims using this class. They are ignored while allocating the claim. There must not be more than one entry per driver.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.VendorParameters"), - }, - }, - }, - }, - }, - "filters": { + "unsuitableNodes": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "Filters describes additional contraints that must be met when using the class.", + Description: "UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for.\n\nThe size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceFilter"), + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, }, + Required: []string{"name"}, }, }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClassParametersReference", "k8s.io/api/resource/v1alpha2.ResourceFilter", "k8s.io/api/resource/v1alpha2.VendorParameters", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClassParametersList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClassParametersList is a collection of ResourceClassParameters.", + Description: "ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "devices": { SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", + Description: "Devices defines how to request devices.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.DeviceClaim"), }, }, - "apiVersion": { + "controller": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Description: "Controller is the name of the DRA driver that is meant to handle allocation of this claim. If empty, allocation is handled by the scheduler while scheduling a pod.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", Type: []string{"string"}, Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the list of node resource capacity objects.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceClassParameters"), - }, - }, - }, - }, - }, }, - Required: []string{"items"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceClassParameters", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "k8s.io/api/resource/v1alpha3.DeviceClaim"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceClassParametersReference(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass.", + Description: "ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "apiGroup": { + "allocation": { SchemaProps: spec.SchemaProps{ - Description: "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - Type: []string{"string"}, - Format: "", + Description: "Allocation is set once the claim has been allocated successfully.", + Ref: ref("k8s.io/api/resource/v1alpha3.AllocationResult"), }, }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata.", - Default: "", - Type: []string{"string"}, - Format: "", + "reservedFor": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "uid", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "uid", + "x-kubernetes-patch-strategy": "merge", + }, }, - }, - "name": { SchemaProps: spec.SchemaProps{ - Description: "Name is the name of resource being referenced.", - Default: "", - Type: []string{"string"}, - Format: "", + Description: "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.\n\nIn a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.\n\nBoth schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimConsumerReference"), + }, + }, + }, }, }, - "namespace": { + "deallocationRequested": { SchemaProps: spec.SchemaProps{ - Description: "Namespace that contains the referenced resource. Must be empty for cluster-scoped resources and non-empty for namespaced resources.", - Type: []string{"string"}, + Description: "Indicates that a claim is to be deallocated. While this is set, no new consumers may be added to ReservedFor.\n\nThis is only used if the claim needs to be deallocated by a DRA driver. That driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", + Type: []string{"boolean"}, Format: "", }, }, }, - Required: []string{"kind", "name"}, }, }, + Dependencies: []string{ + "k8s.io/api/resource/v1alpha3.AllocationResult", "k8s.io/api/resource/v1alpha3.ResourceClaimConsumerReference"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceFilter is a filter for resources from one particular driver.", + Description: "ResourceClaimTemplate is used to produce ResourceClaim objects.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "driverName": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "DriverName is the name used by the DRA driver kubelet plugin.", + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", Type: []string{"string"}, Format: "", }, }, - "namedResources": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes a resource filter using the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesFilter"), + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", }, }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesFilter"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_ResourceFilterModel(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceFilterModel must have one and only one field set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namedResources": { + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes a resource filter using the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesFilter"), + Description: "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimTemplateSpec"), }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesFilter"}, + "k8s.io/api/resource/v1alpha3.ResourceClaimTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceHandle(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimTemplateList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.", + Description: "ResourceClaimTemplateList is a collection of claim templates.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "driverName": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "DriverName specifies the name of the resource driver whose kubelet plugin should be invoked to process this ResourceHandle's data once it lands on a node. This may differ from the DriverName set in ResourceClaimStatus this ResourceHandle is embedded in.", - Default: "", + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", Type: []string{"string"}, Format: "", }, }, - "data": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "Data contains the opaque data associated with this ResourceHandle. It is set by the controller component of the resource driver whose name matches the DriverName set in the ResourceClaimStatus this ResourceHandle is embedded in. It is set at allocation time and is intended for processing by the kubelet plugin whose name matches the DriverName set in this ResourceHandle.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.", + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", Type: []string{"string"}, Format: "", }, }, - "structuredData": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "If StructuredData is set, then it needs to be used instead of Data.", - Ref: ref("k8s.io/api/resource/v1alpha2.StructuredResourceHandle"), + Description: "Standard list metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, - }, - Required: []string{"driverName"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.StructuredResourceHandle"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_ResourceModel(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceModel must have one and only one field set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namedResources": { + "items": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes available resources using the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesResources"), + Description: "Items is the list of resource claim templates.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimTemplate"), + }, + }, + }, }, }, }, + Required: []string{"items"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesResources"}, + "k8s.io/api/resource/v1alpha3.ResourceClaimTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceClaimTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceRequest is a request for resources from one particular driver.", + Description: "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "vendorParameters": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "VendorParameters are arbitrary setup parameters for the requested resource. They are ignored while allocating a claim.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Description: "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "namedResources": { + "spec": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes a request for resources with the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesRequest"), + Description: "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceClaimSpec"), }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesRequest", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "k8s.io/api/resource/v1alpha3.ResourceClaimSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceRequestModel(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourcePool(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceRequestModel must have one and only one field set.", + Description: "ResourcePool describes the pool that ResourceSlices belong to.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "namedResources": { + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "generation": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes a request for resources with the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesRequest"), + Description: "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "resourceSliceCount": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be higher than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", }, }, }, + Required: []string{"name", "generation", "resourceSliceCount"}, }, }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesRequest"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceSlice(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceSlice(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ResourceSlice provides information about available resources on individual nodes.", + Description: "ResourceSlice represents one or more resources in a pool of similar resources, managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple , , .\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -47042,37 +46775,23 @@ func schema_k8sio_api_resource_v1alpha2_ResourceSlice(ref common.ReferenceCallba Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "nodeName": { - SchemaProps: spec.SchemaProps{ - Description: "NodeName identifies the node which provides the resources if they are local to a node.\n\nA field selector can be used to list only ResourceSlice objects with a certain node name.", - Type: []string{"string"}, - Format: "", - }, - }, - "driverName": { - SchemaProps: spec.SchemaProps{ - Description: "DriverName identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namedResources": { + "spec": { SchemaProps: spec.SchemaProps{ - Description: "NamedResources describes available resources using the named resources model.", - Ref: ref("k8s.io/api/resource/v1alpha2.NamedResourcesResources"), + Description: "Contains the information published by the driver.\n\nChanging the spec automatically increments the metadata.generation number.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceSliceSpec"), }, }, }, - Required: []string{"driverName"}, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.NamedResourcesResources", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/api/resource/v1alpha3.ResourceSliceSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_ResourceSliceList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceSliceList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -47093,7 +46812,7 @@ func schema_k8sio_api_resource_v1alpha2_ResourceSliceList(ref common.ReferenceCa Format: "", }, }, - "metadata": { + "listMeta": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata", Default: map[string]interface{}{}, @@ -47102,13 +46821,13 @@ func schema_k8sio_api_resource_v1alpha2_ResourceSliceList(ref common.ReferenceCa }, "items": { SchemaProps: spec.SchemaProps{ - Description: "Items is the list of node resource capacity objects.", + Description: "Items is the list of resource ResourceSlices.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.ResourceSlice"), + Ref: ref("k8s.io/api/resource/v1alpha3.ResourceSlice"), }, }, }, @@ -47119,89 +46838,77 @@ func schema_k8sio_api_resource_v1alpha2_ResourceSliceList(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.ResourceSlice", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "k8s.io/api/resource/v1alpha3.ResourceSlice", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_k8sio_api_resource_v1alpha2_StructuredResourceHandle(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_resource_v1alpha3_ResourceSliceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "StructuredResourceHandle is the in-tree representation of the allocation result.", + Description: "ResourceSliceSpec contains the information published by the driver in one ResourceSlice.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "vendorClassParameters": { + "driver": { SchemaProps: spec.SchemaProps{ - Description: "VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Description: "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.", + Default: "", + Type: []string{"string"}, + Format: "", }, }, - "vendorClaimParameters": { + "pool": { SchemaProps: spec.SchemaProps{ - Description: "VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Description: "Pool describes the pool that this ResourceSlice belongs to. This field is immutable.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/resource/v1alpha3.ResourcePool"), }, }, "nodeName": { SchemaProps: spec.SchemaProps{ - Description: "NodeName is the name of the node providing the necessary resources if the resources are local to a node.", + 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.", Type: []string{"string"}, Format: "", }, }, - "results": { + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector defines which nodes have access to the resources in the pool.\n\nExactly one of NodeName, NodeSelector and AllNodes 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.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "devices": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "atomic", }, }, SchemaProps: spec.SchemaProps{ - Description: "Results lists all allocated driver resources.", + Description: "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/resource/v1alpha2.DriverAllocationResult"), + Ref: ref("k8s.io/api/resource/v1alpha3.Device"), }, }, }, }, }, }, - Required: []string{"results"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/resource/v1alpha2.DriverAllocationResult", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_api_resource_v1alpha2_VendorParameters(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VendorParameters are opaque parameters for one particular driver.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driverName": { - SchemaProps: spec.SchemaProps{ - Description: "DriverName is the name used by the DRA driver kubelet plugin.", - Type: []string{"string"}, - Format: "", - }, - }, - "parameters": { - SchemaProps: spec.SchemaProps{ - Description: "Parameters can be arbitrary setup parameters. They are ignored while allocating a claim.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, + Required: []string{"driver", "pool"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/resource/v1alpha3.Device", "k8s.io/api/resource/v1alpha3.ResourcePool"}, } } diff --git a/pkg/kubeapiserver/authorizer/config.go b/pkg/kubeapiserver/authorizer/config.go index 5a74fa7c74813..e654ed317f69d 100644 --- a/pkg/kubeapiserver/authorizer/config.go +++ b/pkg/kubeapiserver/authorizer/config.go @@ -33,7 +33,7 @@ import ( "k8s.io/apiserver/pkg/authorization/authorizer" utilfeature "k8s.io/apiserver/pkg/util/feature" versionedinformers "k8s.io/client-go/informers" - resourcev1alpha2informers "k8s.io/client-go/informers/resource/v1alpha2" + resourceinformers "k8s.io/client-go/informers/resource/v1alpha3" "k8s.io/kubernetes/pkg/auth/authorizer/abac" "k8s.io/kubernetes/pkg/auth/nodeidentifier" "k8s.io/kubernetes/pkg/features" @@ -93,9 +93,9 @@ func (config Config) New(ctx context.Context, serverID string) (authorizer.Autho // Keep cases in sync with constant list in k8s.io/kubernetes/pkg/kubeapiserver/authorizer/modes/modes.go. switch configuredAuthorizer.Type { case authzconfig.AuthorizerType(modes.ModeNode): - var slices resourcev1alpha2informers.ResourceSliceInformer + var slices resourceinformers.ResourceSliceInformer if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - slices = config.VersionedInformerFactory.Resource().V1alpha2().ResourceSlices() + slices = config.VersionedInformerFactory.Resource().V1alpha3().ResourceSlices() } node.RegisterMetrics() graph := node.NewGraph() diff --git a/pkg/kubectl/.import-restrictions b/pkg/kubectl/.import-restrictions index da3f3c6f36242..67a3ce0ef8135 100644 --- a/pkg/kubectl/.import-restrictions +++ b/pkg/kubectl/.import-restrictions @@ -80,7 +80,7 @@ rules: - k8s.io/kubernetes/pkg/apis/rbac/v1beta1 - k8s.io/kubernetes/pkg/apis/resource - k8s.io/kubernetes/pkg/apis/resource/install - - k8s.io/kubernetes/pkg/apis/resource/v1alpha2 + - k8s.io/kubernetes/pkg/apis/resource/v1alpha3 - k8s.io/kubernetes/pkg/apis/scheduling - k8s.io/kubernetes/pkg/apis/scheduling/install - k8s.io/kubernetes/pkg/apis/scheduling/v1alpha1 diff --git a/pkg/kubelet/checkpointmanager/checksum/checksum.go b/pkg/kubelet/checkpointmanager/checksum/checksum.go index d5892b7be65db..5dcd4f24194d6 100644 --- a/pkg/kubelet/checkpointmanager/checksum/checksum.go +++ b/pkg/kubelet/checkpointmanager/checksum/checksum.go @@ -28,8 +28,9 @@ type Checksum uint64 // Verify verifies that passed checksum is same as calculated checksum func (cs Checksum) Verify(data interface{}) error { - if cs != New(data) { - return errors.ErrCorruptCheckpoint + actualCS := New(data) + if cs != actualCS { + return &errors.CorruptCheckpointError{ActualCS: uint64(actualCS), ExpectedCS: uint64(cs)} } return nil } diff --git a/pkg/kubelet/checkpointmanager/errors/errors.go b/pkg/kubelet/checkpointmanager/errors/errors.go index bb445f207ec23..b39fab9de5969 100644 --- a/pkg/kubelet/checkpointmanager/errors/errors.go +++ b/pkg/kubelet/checkpointmanager/errors/errors.go @@ -18,8 +18,18 @@ package errors import "fmt" -// ErrCorruptCheckpoint error is reported when checksum does not match -var ErrCorruptCheckpoint = fmt.Errorf("checkpoint is corrupted") +// ErrCorruptCheckpoint error is reported when checksum does not match. +// Check for it with: +// +// var csErr CorruptCheckpointError +// if errors.As(err, &csErr) { ... } +type CorruptCheckpointError struct { + ActualCS, ExpectedCS uint64 +} + +func (err CorruptCheckpointError) Error() string { + return "checkpoint is corrupted" +} // ErrCheckpointNotFound is reported when checkpoint is not found for a given key var ErrCheckpointNotFound = fmt.Errorf("checkpoint is not found") diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go index 1a884163b3a73..5c78e6b5eb4b3 100644 --- a/pkg/kubelet/cm/container_manager_linux.go +++ b/pkg/kubelet/cm/container_manager_linux.go @@ -661,10 +661,6 @@ func (cm *containerManagerImpl) GetResources(pod *v1.Pod, container *v1.Containe if err != nil { return nil, err } - // NOTE: Passing CDI device names as annotations is a temporary solution - // It will be removed after all runtimes are updated - // to get CDI device names from the ContainerConfig.CDIDevices field - opts.Annotations = append(opts.Annotations, resOpts.Annotations...) opts.CDIDevices = append(opts.CDIDevices, resOpts.CDIDevices...) } // Allocate should already be called during predicateAdmitHandler.Admit(), @@ -969,15 +965,19 @@ func (cm *containerManagerImpl) GetDynamicResources(pod *v1.Pod, container *v1.C // a set of CDIDevices from a different kubelet plugin. In the future we may want to // include the name of the kubelet plugin and/or other types of resources that are // not CDIDevices (assuming the DRAmanager supports this). - for _, klPluginCdiDevices := range containerClaimInfo.CDIDevices { + for /* driverName */ _, driverState := range containerClaimInfo.DriverState { var cdiDevices []*podresourcesapi.CDIDevice - for _, cdiDevice := range klPluginCdiDevices { - cdiDevices = append(cdiDevices, &podresourcesapi.CDIDevice{Name: cdiDevice}) + for _, device := range driverState.Devices { + for _, cdiDeviceID := range device.CDIDeviceIDs { + cdiDevices = append(cdiDevices, &podresourcesapi.CDIDevice{Name: cdiDeviceID}) + } + } + resources := &podresourcesapi.ClaimResource{ + CDIDevices: cdiDevices, } - claimResources = append(claimResources, &podresourcesapi.ClaimResource{CDIDevices: cdiDevices}) + claimResources = append(claimResources, resources) } containerDynamicResource := podresourcesapi.DynamicResource{ - ClassName: containerClaimInfo.ClassName, ClaimName: containerClaimInfo.ClaimName, ClaimNamespace: containerClaimInfo.Namespace, ClaimResources: claimResources, diff --git a/pkg/kubelet/cm/cpumanager/state/checkpoint.go b/pkg/kubelet/cm/cpumanager/state/checkpoint.go index eb2bfa27eaf14..e7bebf5be9f47 100644 --- a/pkg/kubelet/cm/cpumanager/state/checkpoint.go +++ b/pkg/kubelet/cm/cpumanager/state/checkpoint.go @@ -110,8 +110,9 @@ func (cp *CPUManagerCheckpointV1) VerifyChecksum() error { hash := fnv.New32a() fmt.Fprintf(hash, "%v", object) - if cp.Checksum != checksum.Checksum(hash.Sum32()) { - return errors.ErrCorruptCheckpoint + actualCS := checksum.Checksum(hash.Sum32()) + if cp.Checksum != actualCS { + return &errors.CorruptCheckpointError{ActualCS: uint64(actualCS), ExpectedCS: uint64(cp.Checksum)} } return nil diff --git a/pkg/kubelet/cm/dra/claiminfo.go b/pkg/kubelet/cm/dra/claiminfo.go index 5602707a0a4d3..59b17abfac1d8 100644 --- a/pkg/kubelet/cm/dra/claiminfo.go +++ b/pkg/kubelet/cm/dra/claiminfo.go @@ -17,15 +17,14 @@ limitations under the License. package dra import ( + "errors" "fmt" "sync" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/kubernetes/pkg/kubelet/cm/dra/state" - "k8s.io/kubernetes/pkg/kubelet/cm/util/cdi" - kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) // ClaimInfo holds information required @@ -33,10 +32,7 @@ import ( // +k8s:deepcopy-gen=true type ClaimInfo struct { state.ClaimInfoState - // annotations is a mapping of container annotations per DRA plugin associated with - // a prepared resource - annotations map[string][]kubecontainer.Annotation - prepared bool + prepared bool } // claimInfoCache is a cache of processed resource claims keyed by namespace/claimname. @@ -47,89 +43,45 @@ type claimInfoCache struct { } // newClaimInfoFromClaim creates a new claim info from a resource claim. -func newClaimInfoFromClaim(claim *resourcev1alpha2.ResourceClaim) *ClaimInfo { - // Grab the allocation.resourceHandles. If there are no - // allocation.resourceHandles, create a single resourceHandle with no - // content. This will trigger processing of this claim by a single - // kubelet plugin whose name matches resourceClaim.Status.DriverName. - resourceHandles := claim.Status.Allocation.ResourceHandles - if len(resourceHandles) == 0 { - resourceHandles = make([]resourcev1alpha2.ResourceHandle, 1) - } +// It verifies that the kubelet can handle the claim. +func newClaimInfoFromClaim(claim *resourceapi.ResourceClaim) (*ClaimInfo, error) { claimInfoState := state.ClaimInfoState{ - DriverName: claim.Status.DriverName, - ClassName: claim.Spec.ResourceClassName, - ClaimUID: claim.UID, - ClaimName: claim.Name, - Namespace: claim.Namespace, - PodUIDs: sets.New[string](), - ResourceHandles: resourceHandles, - CDIDevices: make(map[string][]string), + ClaimUID: claim.UID, + ClaimName: claim.Name, + Namespace: claim.Namespace, + PodUIDs: sets.New[string](), + DriverState: make(map[string]state.DriverState), + } + if claim.Status.Allocation == nil { + return nil, errors.New("not allocated") + } + for _, result := range claim.Status.Allocation.Devices.Results { + claimInfoState.DriverState[result.Driver] = state.DriverState{} } info := &ClaimInfo{ ClaimInfoState: claimInfoState, - annotations: make(map[string][]kubecontainer.Annotation), prepared: false, } - return info + return info, nil } // newClaimInfoFromClaim creates a new claim info from a checkpointed claim info state object. func newClaimInfoFromState(state *state.ClaimInfoState) *ClaimInfo { info := &ClaimInfo{ ClaimInfoState: *state.DeepCopy(), - annotations: make(map[string][]kubecontainer.Annotation), prepared: false, } - for pluginName, devices := range info.CDIDevices { - annotations, _ := cdi.GenerateAnnotations(info.ClaimUID, info.DriverName, devices) - info.annotations[pluginName] = append(info.annotations[pluginName], annotations...) - } return info } // setCDIDevices adds a set of CDI devices to the claim info. -func (info *ClaimInfo) setCDIDevices(pluginName string, cdiDevices []string) error { - // NOTE: Passing CDI device names as annotations is a temporary solution - // It will be removed after all runtimes are updated - // to get CDI device names from the ContainerConfig.CDIDevices field - annotations, err := cdi.GenerateAnnotations(info.ClaimUID, info.DriverName, cdiDevices) - if err != nil { - return fmt.Errorf("failed to generate container annotations, err: %+v", err) - } - - if info.CDIDevices == nil { - info.CDIDevices = make(map[string][]string) - } - - if info.annotations == nil { - info.annotations = make(map[string][]kubecontainer.Annotation) - } - - info.CDIDevices[pluginName] = cdiDevices - info.annotations[pluginName] = annotations - - return nil -} - -// annotationsAsList returns container annotations as a single list. -func (info *ClaimInfo) annotationsAsList() []kubecontainer.Annotation { - var lst []kubecontainer.Annotation - for _, v := range info.annotations { - lst = append(lst, v...) - } - return lst -} - -// cdiDevicesAsList returns a list of CDIDevices from the provided claim info. -func (info *ClaimInfo) cdiDevicesAsList() []kubecontainer.CDIDevice { - var cdiDevices []kubecontainer.CDIDevice - for _, devices := range info.CDIDevices { - for _, device := range devices { - cdiDevices = append(cdiDevices, kubecontainer.CDIDevice{Name: device}) - } +func (info *ClaimInfo) addDevice(driverName string, device state.Device) { + if info.DriverState == nil { + info.DriverState = make(map[string]state.DriverState) } - return cdiDevices + driverState := info.DriverState[driverName] + driverState.Devices = append(driverState.Devices, device) + info.DriverState[driverName] = driverState } // addPodReference adds a pod reference to the claim info. diff --git a/pkg/kubelet/cm/dra/claiminfo_test.go b/pkg/kubelet/cm/dra/claiminfo_test.go index ffa2ce74aa11a..139ecc8c9e2d1 100644 --- a/pkg/kubelet/cm/dra/claiminfo_test.go +++ b/pkg/kubelet/cm/dra/claiminfo_test.go @@ -18,104 +18,129 @@ package dra import ( "errors" - "fmt" "path" "reflect" - "sort" "testing" "github.com/stretchr/testify/assert" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/kubernetes/pkg/kubelet/cm/dra/state" - kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) // ClaimInfo test cases -func TestNewClaimInfoFromClaim(t *testing.T) { - namespace := "test-namespace" - className := "test-class" - driverName := "test-plugin" - claimUID := types.UID("claim-uid") - claimName := "test-claim" +const ( + namespace = "test-namespace" + className = "test-class" + driverName = "test-driver" + deviceName = "test-device" // name inside ResourceSlice + cdiDeviceName = "cdi-test-device" // name inside CDI spec + cdiID = "test-driver/test=cdi-test-device" // CDI device ID + poolName = "test-pool" + requestName = "test-request" + claimName = "test-claim" + claimUID = types.UID(claimName + "-uid") + podUID = "test-pod-uid" +) +var ( + device = state.Device{ + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{requestName}, + CDIDeviceIDs: []string{cdiID}, + } + devices = []state.Device{device} +) + +func TestNewClaimInfoFromClaim(t *testing.T) { for _, test := range []struct { description string - claim *resourcev1alpha2.ResourceClaim + claim *resourceapi.ResourceClaim expectedResult *ClaimInfo }{ { description: "successfully created object", - claim: &resourcev1alpha2.ResourceClaim{ + claim: &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ UID: claimUID, Name: claimName, Namespace: namespace, }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{}, + Status: resourceapi.ResourceClaimStatus{ + Allocation: &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: []resourceapi.DeviceRequestAllocationResult{ + { + Request: requestName, + Pool: poolName, + Device: deviceName, + Driver: driverName, + }, + }, + }, }, }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: className, + Spec: resourceapi.ResourceClaimSpec{ + Devices: resourceapi.DeviceClaim{ + Requests: []resourceapi.DeviceRequest{ + { + Name: requestName, + DeviceClassName: className, + }, + }, + }, }, }, expectedResult: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClassName: className, - ClaimUID: claimUID, - ClaimName: claimName, - Namespace: claimName, - PodUIDs: sets.New[string](), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {}, + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](), + DriverState: map[string]state.DriverState{ + driverName: {}, }, - CDIDevices: make(map[string][]string), }, + prepared: false, }, }, { description: "successfully created object with empty allocation", - claim: &resourcev1alpha2.ResourceClaim{ + claim: &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ UID: claimUID, Name: claimName, Namespace: namespace, }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{}, - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: className, + Status: resourceapi.ResourceClaimStatus{ + Allocation: &resourceapi.AllocationResult{}, }, + Spec: resourceapi.ResourceClaimSpec{}, }, expectedResult: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClassName: className, - ClaimUID: claimUID, - ClaimName: claimName, - Namespace: claimName, - PodUIDs: sets.New[string](), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {}, - }, - CDIDevices: make(map[string][]string), + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](), + DriverState: map[string]state.DriverState{}, }, + prepared: false, }, }, } { t.Run(test.description, func(t *testing.T) { - result := newClaimInfoFromClaim(test.claim) - if reflect.DeepEqual(result, test.expectedResult) { - t.Errorf("Expected %v, but got %v", test.expectedResult, result) + result, err := newClaimInfoFromClaim(test.claim) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if !reflect.DeepEqual(test.expectedResult, result) { + t.Errorf("Expected %+v, but got %+v", test.expectedResult, result) } }) } @@ -130,237 +155,95 @@ func TestNewClaimInfoFromState(t *testing.T) { { description: "successfully created object", state: &state.ClaimInfoState{ - DriverName: "test-driver", - ClassName: "test-class", - ClaimUID: "test-uid", - ClaimName: "test-claim", - Namespace: "test-namespace", - PodUIDs: sets.New[string]("test-pod-uid"), - ResourceHandles: []resourcev1alpha2.ResourceHandle{}, - CDIDevices: map[string][]string{}, - }, - }, - } { - t.Run(test.description, func(t *testing.T) { - result := newClaimInfoFromState(test.state) - if reflect.DeepEqual(result, test.expectedResult) { - t.Errorf("Expected %v, but got %v", test.expectedResult, result) - } - }) - } -} - -func TestClaimInfoSetCDIDevices(t *testing.T) { - claimUID := types.UID("claim-uid") - pluginName := "test-plugin" - device := "vendor.com/device=device1" - annotationName := fmt.Sprintf("cdi.k8s.io/%s_%s", pluginName, claimUID) - for _, test := range []struct { - description string - claimInfo *ClaimInfo - devices []string - expectedCDIDevices map[string][]string - expectedAnnotations map[string][]kubecontainer.Annotation - wantErr bool - }{ - { - description: "successfully add one device", - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: pluginName, - ClaimUID: claimUID, - }, - }, - devices: []string{device}, - expectedCDIDevices: map[string][]string{ - pluginName: {device}, - }, - expectedAnnotations: map[string][]kubecontainer.Annotation{ - pluginName: { - { - Name: annotationName, - Value: device, + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](podUID), + DriverState: map[string]state.DriverState{ + driverName: { + Devices: devices, }, }, }, - }, - { - description: "empty list of devices", - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: pluginName, - ClaimUID: claimUID, - }, - }, - devices: []string{}, - expectedCDIDevices: map[string][]string{pluginName: {}}, - expectedAnnotations: map[string][]kubecontainer.Annotation{pluginName: nil}, - }, - { - description: "incorrect device format", - claimInfo: &ClaimInfo{ + expectedResult: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - DriverName: pluginName, - ClaimUID: claimUID, - }, - }, - devices: []string{"incorrect"}, - wantErr: true, - }, - } { - t.Run(test.description, func(t *testing.T) { - err := test.claimInfo.setCDIDevices(pluginName, test.devices) - if test.wantErr { - assert.Error(t, err) - return - } - assert.NoError(t, err) - assert.Equal(t, test.expectedCDIDevices, test.claimInfo.CDIDevices) - assert.Equal(t, test.expectedAnnotations, test.claimInfo.annotations) - }) - } -} - -func TestClaimInfoAnnotationsAsList(t *testing.T) { - for _, test := range []struct { - description string - claimInfo *ClaimInfo - expectedResult []kubecontainer.Annotation - }{ - { - description: "empty annotations", - claimInfo: &ClaimInfo{ - annotations: map[string][]kubecontainer.Annotation{}, - }, - }, - { - description: "nil annotations", - claimInfo: &ClaimInfo{}, - }, - { - description: "valid annotations", - claimInfo: &ClaimInfo{ - annotations: map[string][]kubecontainer.Annotation{ - "test-plugin1": { - { - Name: "cdi.k8s.io/test-plugin1_claim-uid1", - Value: "vendor.com/device=device1", - }, - { - Name: "cdi.k8s.io/test-plugin1_claim-uid2", - Value: "vendor.com/device=device2", - }, - }, - "test-plugin2": { - { - Name: "cdi.k8s.io/test-plugin2_claim-uid1", - Value: "vendor.com/device=device1", - }, - { - Name: "cdi.k8s.io/test-plugin2_claim-uid2", - Value: "vendor.com/device=device2", + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](podUID), + DriverState: map[string]state.DriverState{ + driverName: { + Devices: devices, }, }, }, - }, - expectedResult: []kubecontainer.Annotation{ - { - Name: "cdi.k8s.io/test-plugin1_claim-uid1", - Value: "vendor.com/device=device1", - }, - { - Name: "cdi.k8s.io/test-plugin1_claim-uid2", - Value: "vendor.com/device=device2", - }, - { - Name: "cdi.k8s.io/test-plugin2_claim-uid1", - Value: "vendor.com/device=device1", - }, - { - Name: "cdi.k8s.io/test-plugin2_claim-uid2", - Value: "vendor.com/device=device2", - }, + prepared: false, }, }, } { t.Run(test.description, func(t *testing.T) { - result := test.claimInfo.annotationsAsList() - sort.Slice(result, func(i, j int) bool { - return result[i].Name < result[j].Name - }) - assert.Equal(t, test.expectedResult, result) + result := newClaimInfoFromState(test.state) + if !reflect.DeepEqual(result, test.expectedResult) { + t.Errorf("Expected %+v, but got %+v", test.expectedResult, result) + } }) } } -func TestClaimInfoCDIdevicesAsList(t *testing.T) { +func TestClaimInfoAddDevice(t *testing.T) { for _, test := range []struct { - description string - claimInfo *ClaimInfo - expectedResult []kubecontainer.CDIDevice + description string + claimInfo *ClaimInfo + device state.Device }{ { - description: "empty CDI devices", + description: "add new device", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - CDIDevices: map[string][]string{}, + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](podUID), }, + prepared: false, }, + device: device, }, { - description: "nil CDI devices", - claimInfo: &ClaimInfo{}, - }, - { - description: "valid CDI devices", + description: "other new device", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - CDIDevices: map[string][]string{ - "test-plugin1": { - "vendor.com/device=device1", - "vendor.com/device=device2", - }, - "test-plugin2": { - "vendor.com/device=device1", - "vendor.com/device=device2", - }, - }, - }, - }, - expectedResult: []kubecontainer.CDIDevice{ - { - Name: "vendor.com/device=device1", - }, - { - Name: "vendor.com/device=device1", - }, - { - Name: "vendor.com/device=device2", - }, - { - Name: "vendor.com/device=device2", + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](podUID), }, }, + device: func() state.Device { + device := device + device.PoolName += "-2" + device.DeviceName += "-2" + device.RequestNames = []string{device.RequestNames[0] + "-2"} + device.CDIDeviceIDs = []string{device.CDIDeviceIDs[0] + "-2"} + return device + }(), }, } { t.Run(test.description, func(t *testing.T) { - result := test.claimInfo.cdiDevicesAsList() - sort.Slice(result, func(i, j int) bool { - return result[i].Name < result[j].Name - }) - assert.Equal(t, test.expectedResult, result) + test.claimInfo.addDevice(driverName, test.device) + assert.Equal(t, []state.Device{test.device}, test.claimInfo.DriverState[driverName].Devices) }) } } + func TestClaimInfoAddPodReference(t *testing.T) { - podUID := types.UID("pod-uid") for _, test := range []struct { description string claimInfo *ClaimInfo expectedLen int }{ { - description: "successfully add pod reference", + description: "empty PodUIDs list", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ PodUIDs: sets.New[string](), @@ -369,16 +252,16 @@ func TestClaimInfoAddPodReference(t *testing.T) { expectedLen: 1, }, { - description: "duplicate pod reference", + description: "first pod reference", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - PodUIDs: sets.New[string](string(podUID)), + PodUIDs: sets.New[string](podUID), }, }, expectedLen: 1, }, { - description: "duplicate pod reference", + description: "second pod reference", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ PodUIDs: sets.New[string]("pod-uid1"), @@ -396,7 +279,6 @@ func TestClaimInfoAddPodReference(t *testing.T) { } func TestClaimInfoHasPodReference(t *testing.T) { - podUID := types.UID("pod-uid") for _, test := range []struct { description string claimInfo *ClaimInfo @@ -414,7 +296,7 @@ func TestClaimInfoHasPodReference(t *testing.T) { description: "claim references pod", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - PodUIDs: sets.New[string](string(podUID)), + PodUIDs: sets.New[string](podUID), }, }, expectedResult: true, @@ -431,7 +313,6 @@ func TestClaimInfoHasPodReference(t *testing.T) { } func TestClaimInfoDeletePodReference(t *testing.T) { - podUID := types.UID("pod-uid") for _, test := range []struct { description string claimInfo *ClaimInfo @@ -448,7 +329,7 @@ func TestClaimInfoDeletePodReference(t *testing.T) { description: "claim references pod", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - PodUIDs: sets.New[string](string(podUID)), + PodUIDs: sets.New[string](podUID), }, }, }, @@ -694,8 +575,8 @@ func TestClaimInfoCacheAdd(t *testing.T) { description: "claimInfo successfully added", claimInfo: &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{ - ClaimName: "test-claim", - Namespace: "test-namespace", + ClaimName: claimName, + Namespace: namespace, }, }, }, @@ -711,8 +592,6 @@ func TestClaimInfoCacheAdd(t *testing.T) { } func TestClaimInfoCacheContains(t *testing.T) { - claimName := "test-claim" - namespace := "test-namespace" for _, test := range []struct { description string claimInfo *ClaimInfo @@ -764,8 +643,6 @@ func TestClaimInfoCacheContains(t *testing.T) { } func TestClaimInfoCacheGet(t *testing.T) { - claimName := "test-claim" - namespace := "test-namespace" for _, test := range []struct { description string claimInfoCache *claimInfoCache @@ -801,8 +678,6 @@ func TestClaimInfoCacheGet(t *testing.T) { } func TestClaimInfoCacheDelete(t *testing.T) { - claimName := "test-claim" - namespace := "test-namespace" for _, test := range []struct { description string claimInfoCache *claimInfoCache @@ -833,9 +708,6 @@ func TestClaimInfoCacheDelete(t *testing.T) { } func TestClaimInfoCacheHasPodReference(t *testing.T) { - claimName := "test-claim" - namespace := "test-namespace" - uid := types.UID("test-uid") for _, test := range []struct { description string claimInfoCache *claimInfoCache @@ -849,7 +721,7 @@ func TestClaimInfoCacheHasPodReference(t *testing.T) { ClaimInfoState: state.ClaimInfoState{ ClaimName: claimName, Namespace: namespace, - PodUIDs: sets.New[string](string(uid)), + PodUIDs: sets.New[string](podUID), }, }, }, @@ -862,7 +734,7 @@ func TestClaimInfoCacheHasPodReference(t *testing.T) { }, } { t.Run(test.description, func(t *testing.T) { - assert.Equal(t, test.expectedResult, test.claimInfoCache.hasPodReference(uid)) + assert.Equal(t, test.expectedResult, test.claimInfoCache.hasPodReference(podUID)) }) } } diff --git a/pkg/kubelet/cm/dra/manager.go b/pkg/kubelet/cm/dra/manager.go index 188060060314b..acd925c6d3163 100644 --- a/pkg/kubelet/cm/dra/manager.go +++ b/pkg/kubelet/cm/dra/manager.go @@ -19,10 +19,11 @@ package dra import ( "context" "fmt" + "slices" "time" v1 "k8s.io/api/core/v1" - resourceapi "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" @@ -30,8 +31,9 @@ import ( clientset "k8s.io/client-go/kubernetes" "k8s.io/dynamic-resource-allocation/resourceclaim" "k8s.io/klog/v2" - drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha3" + drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha4" dra "k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin" + "k8s.io/kubernetes/pkg/kubelet/cm/dra/state" "k8s.io/kubernetes/pkg/kubelet/config" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) @@ -45,7 +47,7 @@ const defaultReconcilePeriod = 60 * time.Second // ActivePodsFunc is a function that returns a list of pods to reconcile. type ActivePodsFunc func() []*v1.Pod -// ManagerImpl is the structure in charge of managing DRA resource Plugins. +// ManagerImpl is the structure in charge of managing DRA drivers. type ManagerImpl struct { // cache contains cached claim info cache *claimInfoCache @@ -145,8 +147,8 @@ func (m *ManagerImpl) reconcileLoop() { } } -// PrepareResources attempts to prepare all of the required resource -// plugin resources for the input container, issue NodePrepareResources rpc requests +// PrepareResources attempts to prepare all of the required resources +// for the input container, issue NodePrepareResources rpc requests // for each new resource requirement, process their responses and update the cached // containerResources on success. func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { @@ -154,7 +156,7 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { resourceClaims := make(map[types.UID]*resourceapi.ResourceClaim) for i := range pod.Spec.ResourceClaims { podClaim := &pod.Spec.ResourceClaims[i] - klog.V(3).InfoS("Processing resource", "podClaim", podClaim.Name, "pod", pod.Name) + klog.V(3).InfoS("Processing resource", "pod", klog.KObj(pod), "podClaim", podClaim.Name) claimName, mustCheckOwner, err := resourceclaim.Name(pod, podClaim) if err != nil { return fmt.Errorf("prepare resource claim: %v", err) @@ -162,10 +164,11 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { if claimName == nil { // Nothing to do. + klog.V(5).InfoS("No need to prepare resources, no claim generated", "pod", klog.KObj(pod), "podClaim", podClaim.Name) continue } // Query claim object from the API server - resourceClaim, err := m.kubeClient.ResourceV1alpha2().ResourceClaims(pod.Namespace).Get( + resourceClaim, err := m.kubeClient.ResourceV1alpha3().ResourceClaims(pod.Namespace).Get( context.TODO(), *claimName, metav1.GetOptions{}) @@ -185,20 +188,20 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { pod.Name, pod.UID, *claimName, resourceClaim.UID) } - // If no container actually uses the claim, then we don't need - // to prepare it. - if !claimIsUsedByPod(podClaim, pod) { - klog.V(5).InfoS("Skipping unused resource", "claim", claimName, "pod", pod.Name) - continue - } - // Atomically perform some operations on the claimInfo cache. err = m.cache.withLock(func() error { // Get a reference to the claim info for this claim from the cache. // If there isn't one yet, then add it to the cache. claimInfo, exists := m.cache.get(resourceClaim.Name, resourceClaim.Namespace) if !exists { - claimInfo = m.cache.add(newClaimInfoFromClaim(resourceClaim)) + ci, err := newClaimInfoFromClaim(resourceClaim) + if err != nil { + return fmt.Errorf("claim %s: %w", klog.KObj(resourceClaim), err) + } + claimInfo = m.cache.add(ci) + klog.V(6).InfoS("Created new claim info cache entry", "pod", klog.KObj(pod), "podClaim", podClaim.Name, "claim", klog.KObj(resourceClaim), "claimInfoEntry", claimInfo) + } else { + klog.V(6).InfoS("Found existing claim info cache entry", "pod", klog.KObj(pod), "podClaim", podClaim.Name, "claim", klog.KObj(resourceClaim), "claimInfoEntry", claimInfo) } // Add a reference to the current pod in the claim info. @@ -214,6 +217,7 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { // If this claim is already prepared, there is no need to prepare it again. if claimInfo.isPrepared() { + klog.V(5).InfoS("Resources already prepared", "pod", klog.KObj(pod), "podClaim", podClaim.Name, "claim", klog.KObj(resourceClaim)) return nil } @@ -221,19 +225,14 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { // after NodePrepareResources GRPC succeeds resourceClaims[claimInfo.ClaimUID] = resourceClaim - // Loop through all plugins and prepare for calling NodePrepareResources. - for _, resourceHandle := range claimInfo.ResourceHandles { - claim := &drapb.Claim{ - Namespace: claimInfo.Namespace, - Uid: string(claimInfo.ClaimUID), - Name: claimInfo.ClaimName, - ResourceHandle: resourceHandle.Data, - } - if resourceHandle.StructuredData != nil { - claim.StructuredResourceHandle = []*resourceapi.StructuredResourceHandle{resourceHandle.StructuredData} - } - pluginName := resourceHandle.DriverName - batches[pluginName] = append(batches[pluginName], claim) + // Loop through all drivers and prepare for calling NodePrepareResources. + claim := &drapb.Claim{ + Namespace: claimInfo.Namespace, + Uid: string(claimInfo.ClaimUID), + Name: claimInfo.ClaimName, + } + for driverName := range claimInfo.DriverState { + batches[driverName] = append(batches[driverName], claim) } return nil @@ -246,16 +245,16 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { // Call NodePrepareResources for all claims in each batch. // If there is any error, processing gets aborted. // We could try to continue, but that would make the code more complex. - for pluginName, claims := range batches { + for driverName, claims := range batches { // Call NodePrepareResources RPC for all resource handles. - client, err := dra.NewDRAPluginClient(pluginName) + client, err := dra.NewDRAPluginClient(driverName) if err != nil { - return fmt.Errorf("failed to get DRA Plugin client for plugin name %s: %v", pluginName, err) + return fmt.Errorf("failed to get gRPC client for driver %s: %w", driverName, err) } response, err := client.NodePrepareResources(context.Background(), &drapb.NodePrepareResourcesRequest{Claims: claims}) if err != nil { // General error unrelated to any particular claim. - return fmt.Errorf("NodePrepareResources failed: %v", err) + return fmt.Errorf("NodePrepareResources failed: %w", err) } for claimUID, result := range response.Claims { reqClaim := lookupClaimRequest(claims, claimUID) @@ -274,8 +273,8 @@ func (m *ManagerImpl) PrepareResources(pod *v1.Pod) error { if !exists { return fmt.Errorf("unable to get claim info for claim %s in namespace %s", claim.Name, claim.Namespace) } - if err := info.setCDIDevices(pluginName, result.GetCDIDevices()); err != nil { - return fmt.Errorf("unable to add CDI devices for plugin %s of claim %s in namespace %s", pluginName, claim.Name, claim.Namespace) + for _, device := range result.GetDevices() { + info.addDevice(driverName, state.Device{PoolName: device.PoolName, DeviceName: device.DeviceName, RequestNames: device.RequestNames, CDIDeviceIDs: device.CDIDeviceIDs}) } return nil }) @@ -325,53 +324,26 @@ func lookupClaimRequest(claims []*drapb.Claim, claimUID string) *drapb.Claim { return nil } -func claimIsUsedByPod(podClaim *v1.PodResourceClaim, pod *v1.Pod) bool { - if claimIsUsedByContainers(podClaim, pod.Spec.InitContainers) { - return true - } - if claimIsUsedByContainers(podClaim, pod.Spec.Containers) { - return true - } - return false -} - -func claimIsUsedByContainers(podClaim *v1.PodResourceClaim, containers []v1.Container) bool { - for i := range containers { - if claimIsUsedByContainer(podClaim, &containers[i]) { - return true - } - } - return false -} - -func claimIsUsedByContainer(podClaim *v1.PodResourceClaim, container *v1.Container) bool { - for _, c := range container.Resources.Claims { - if c.Name == podClaim.Name { - return true - } - } - return false -} - // GetResources gets a ContainerInfo object from the claimInfo cache. // This information is used by the caller to update a container config. func (m *ManagerImpl) GetResources(pod *v1.Pod, container *v1.Container) (*ContainerInfo, error) { - annotations := []kubecontainer.Annotation{} cdiDevices := []kubecontainer.CDIDevice{} - for i, podResourceClaim := range pod.Spec.ResourceClaims { - claimName, _, err := resourceclaim.Name(pod, &pod.Spec.ResourceClaims[i]) + for i := range pod.Spec.ResourceClaims { + podClaim := &pod.Spec.ResourceClaims[i] + claimName, _, err := resourceclaim.Name(pod, podClaim) if err != nil { - return nil, fmt.Errorf("list resource claims: %v", err) + return nil, fmt.Errorf("list resource claims: %w", err) } // The claim name might be nil if no underlying resource claim // was generated for the referenced claim. There are valid use // cases when this might happen, so we simply skip it. if claimName == nil { + klog.V(5).InfoS("No CDI devices, no claim generated", "pod", klog.KObj(pod), "podClaimName", podClaim.Name) continue } for _, claim := range container.Resources.Claims { - if podResourceClaim.Name != claim.Name { + if podClaim.Name != claim.Name { continue } @@ -381,13 +353,17 @@ func (m *ManagerImpl) GetResources(pod *v1.Pod, container *v1.Container) (*Conta return fmt.Errorf("unable to get claim info for claim %s in namespace %s", *claimName, pod.Namespace) } - claimAnnotations := claimInfo.annotationsAsList() - klog.V(3).InfoS("Add resource annotations", "claim", *claimName, "annotations", claimAnnotations) - annotations = append(annotations, claimAnnotations...) - - devices := claimInfo.cdiDevicesAsList() - klog.V(3).InfoS("Add CDI devices", "claim", *claimName, "CDI devices", devices) - cdiDevices = append(cdiDevices, devices...) + // As of Kubernetes 1.31, CDI device IDs are not passed via annotations anymore. + for _, driverData := range claimInfo.DriverState { + for _, device := range driverData.Devices { + claimRequestName := claim.Request + if claimRequestName == "" || len(device.RequestNames) == 0 || slices.Contains(device.RequestNames, claimRequestName) { + for _, cdiDeviceID := range device.CDIDeviceIDs { + cdiDevices = append(cdiDevices, kubecontainer.CDIDevice{Name: cdiDeviceID}) + } + } + } + } return nil }) @@ -397,10 +373,11 @@ func (m *ManagerImpl) GetResources(pod *v1.Pod, container *v1.Container) (*Conta } } - return &ContainerInfo{Annotations: annotations, CDIDevices: cdiDevices}, nil + klog.V(5).InfoS("Determined CDI devices for pod", "pod", klog.KObj(pod), "cdiDevices", cdiDevices) + return &ContainerInfo{CDIDevices: cdiDevices}, nil } -// UnprepareResources calls a plugin's NodeUnprepareResource API for each resource claim owned by a pod. +// UnprepareResources calls a driver's NodeUnprepareResource API for each resource claim owned by a pod. // This function is idempotent and may be called multiple times against the same pod. // As such, calls to the underlying NodeUnprepareResource API are skipped for claims that have // already been successfully unprepared. @@ -409,7 +386,7 @@ func (m *ManagerImpl) UnprepareResources(pod *v1.Pod) error { for i := range pod.Spec.ResourceClaims { claimName, _, err := resourceclaim.Name(pod, &pod.Spec.ResourceClaims[i]) if err != nil { - return fmt.Errorf("unprepare resource claim: %v", err) + return fmt.Errorf("unprepare resource claim: %w", err) } // The claim name might be nil if no underlying resource claim // was generated for the referenced claim. There are valid use @@ -452,19 +429,14 @@ func (m *ManagerImpl) unprepareResources(podUID types.UID, namespace string, cla // after NodeUnprepareResources GRPC succeeds claimNamesMap[claimInfo.ClaimUID] = claimInfo.ClaimName - // Loop through all plugins and prepare for calling NodeUnprepareResources. - for _, resourceHandle := range claimInfo.ResourceHandles { - claim := &drapb.Claim{ - Namespace: claimInfo.Namespace, - Uid: string(claimInfo.ClaimUID), - Name: claimInfo.ClaimName, - ResourceHandle: resourceHandle.Data, - } - if resourceHandle.StructuredData != nil { - claim.StructuredResourceHandle = []*resourceapi.StructuredResourceHandle{resourceHandle.StructuredData} - } - pluginName := resourceHandle.DriverName - batches[pluginName] = append(batches[pluginName], claim) + // Loop through all drivers and prepare for calling NodeUnprepareResources. + claim := &drapb.Claim{ + Namespace: claimInfo.Namespace, + Uid: string(claimInfo.ClaimUID), + Name: claimInfo.ClaimName, + } + for driverName := range claimInfo.DriverState { + batches[driverName] = append(batches[driverName], claim) } return nil @@ -477,16 +449,16 @@ func (m *ManagerImpl) unprepareResources(podUID types.UID, namespace string, cla // Call NodeUnprepareResources for all claims in each batch. // If there is any error, processing gets aborted. // We could try to continue, but that would make the code more complex. - for pluginName, claims := range batches { + for driverName, claims := range batches { // Call NodeUnprepareResources RPC for all resource handles. - client, err := dra.NewDRAPluginClient(pluginName) + client, err := dra.NewDRAPluginClient(driverName) if err != nil { - return fmt.Errorf("failed to get DRA Plugin client for plugin name %s: %v", pluginName, err) + return fmt.Errorf("get gRPC client for DRA driver %s: %w", driverName, err) } response, err := client.NodeUnprepareResources(context.Background(), &drapb.NodeUnprepareResourcesRequest{Claims: claims}) if err != nil { // General error unrelated to any particular claim. - return fmt.Errorf("NodeUnprepareResources failed: %v", err) + return fmt.Errorf("NodeUnprepareResources failed: %w", err) } for claimUID, result := range response.Claims { @@ -509,7 +481,9 @@ func (m *ManagerImpl) unprepareResources(podUID types.UID, namespace string, cla err := m.cache.withLock(func() error { // Delete all claimInfos from the cache that have just been unprepared. for _, claimName := range claimNamesMap { + claimInfo, _ := m.cache.get(claimName, namespace) m.cache.delete(claimName, namespace) + klog.V(6).InfoS("Deleted claim info cache entry", "claim", klog.KRef(namespace, claimName), "claimInfoEntry", claimInfo) } // Atomically sync the cache back to the checkpoint. @@ -540,7 +514,7 @@ func (m *ManagerImpl) GetContainerClaimInfos(pod *v1.Pod, container *v1.Containe for i, podResourceClaim := range pod.Spec.ResourceClaims { claimName, _, err := resourceclaim.Name(pod, &pod.Spec.ResourceClaims[i]) if err != nil { - return nil, fmt.Errorf("determine resource claim information: %v", err) + return nil, fmt.Errorf("determine resource claim information: %w", err) } for _, claim := range container.Resources.Claims { diff --git a/pkg/kubelet/cm/dra/manager_test.go b/pkg/kubelet/cm/dra/manager_test.go index 6b878ed0d2ed0..7ca16a4ae5ccb 100644 --- a/pkg/kubelet/cm/dra/manager_test.go +++ b/pkg/kubelet/cm/dra/manager_test.go @@ -28,36 +28,38 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "google.golang.org/grpc" + v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/kubernetes/fake" "k8s.io/dynamic-resource-allocation/resourceclaim" - drapbv1 "k8s.io/kubelet/pkg/apis/dra/v1alpha3" + drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha4" "k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin" "k8s.io/kubernetes/pkg/kubelet/cm/dra/state" - kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) const ( - driverName = "test-cdi-device" driverClassName = "test" + podName = "test-pod" + containerName = "test-container" ) type fakeDRADriverGRPCServer struct { - drapbv1.UnimplementedNodeServer + drapb.UnimplementedNodeServer driverName string timeout *time.Duration prepareResourceCalls atomic.Uint32 unprepareResourceCalls atomic.Uint32 - prepareResourcesResponse *drapbv1.NodePrepareResourcesResponse - unprepareResourcesResponse *drapbv1.NodeUnprepareResourcesResponse + prepareResourcesResponse *drapb.NodePrepareResourcesResponse + unprepareResourcesResponse *drapb.NodeUnprepareResourcesResponse } -func (s *fakeDRADriverGRPCServer) NodePrepareResources(ctx context.Context, req *drapbv1.NodePrepareResourcesRequest) (*drapbv1.NodePrepareResourcesResponse, error) { +func (s *fakeDRADriverGRPCServer) NodePrepareResources(ctx context.Context, req *drapb.NodePrepareResourcesRequest) (*drapb.NodePrepareResourcesResponse, error) { s.prepareResourceCalls.Add(1) if s.timeout != nil { @@ -65,12 +67,19 @@ func (s *fakeDRADriverGRPCServer) NodePrepareResources(ctx context.Context, req } if s.prepareResourcesResponse == nil { - deviceName := "claim-" + req.Claims[0].Uid - result := s.driverName + "/" + driverClassName + "=" + deviceName - return &drapbv1.NodePrepareResourcesResponse{ - Claims: map[string]*drapbv1.NodePrepareResourceResponse{ + cdiDeviceName := "claim-" + req.Claims[0].Uid + cdiID := s.driverName + "/" + driverClassName + "=" + cdiDeviceName + return &drapb.NodePrepareResourcesResponse{ + Claims: map[string]*drapb.NodePrepareResourceResponse{ req.Claims[0].Uid: { - CDIDevices: []string{result}, + Devices: []*drapb.Device{ + { + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{req.Claims[0].Name}, + CDIDeviceIDs: []string{cdiID}, + }, + }, }, }, }, nil @@ -79,7 +88,7 @@ func (s *fakeDRADriverGRPCServer) NodePrepareResources(ctx context.Context, req return s.prepareResourcesResponse, nil } -func (s *fakeDRADriverGRPCServer) NodeUnprepareResources(ctx context.Context, req *drapbv1.NodeUnprepareResourcesRequest) (*drapbv1.NodeUnprepareResourcesResponse, error) { +func (s *fakeDRADriverGRPCServer) NodeUnprepareResources(ctx context.Context, req *drapb.NodeUnprepareResourcesRequest) (*drapb.NodeUnprepareResourcesResponse, error) { s.unprepareResourceCalls.Add(1) if s.timeout != nil { @@ -87,8 +96,8 @@ func (s *fakeDRADriverGRPCServer) NodeUnprepareResources(ctx context.Context, re } if s.unprepareResourcesResponse == nil { - return &drapbv1.NodeUnprepareResourcesResponse{ - Claims: map[string]*drapbv1.NodeUnprepareResourceResponse{ + return &drapb.NodeUnprepareResourcesResponse{ + Claims: map[string]*drapb.NodeUnprepareResourceResponse{ req.Claims[0].Uid: {}, }, }, nil @@ -108,7 +117,7 @@ type fakeDRAServerInfo struct { teardownFn tearDown } -func setupFakeDRADriverGRPCServer(shouldTimeout bool, pluginClientTimeout *time.Duration, prepareResourcesResponse *drapbv1.NodePrepareResourcesResponse, unprepareResourcesResponse *drapbv1.NodeUnprepareResourcesResponse) (fakeDRAServerInfo, error) { +func setupFakeDRADriverGRPCServer(shouldTimeout bool, pluginClientTimeout *time.Duration, prepareResourcesResponse *drapb.NodePrepareResourcesResponse, unprepareResourcesResponse *drapb.NodeUnprepareResourcesResponse) (fakeDRAServerInfo, error) { socketDir, err := os.MkdirTemp("", "dra") if err != nil { return fakeDRAServerInfo{ @@ -147,7 +156,7 @@ func setupFakeDRADriverGRPCServer(shouldTimeout bool, pluginClientTimeout *time. fakeDRADriverGRPCServer.timeout = &timeout } - drapbv1.RegisterNodeServer(s, fakeDRADriverGRPCServer) + drapb.RegisterNodeServer(s, fakeDRADriverGRPCServer) go func() { go s.Serve(l) @@ -193,122 +202,153 @@ func TestNewManagerImpl(t *testing.T) { } } -func TestGetResources(t *testing.T) { - kubeClient := fake.NewSimpleClientset() - resourceClaimName := "test-pod-claim-1" - - for _, test := range []struct { - description string - container *v1.Container - pod *v1.Pod - claimInfo *ClaimInfo - wantErr bool - }{ - { - description: "claim info with annotations", - container: &v1.Container{ - Name: "test-container", - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-1", +// genTestPod generates pod object +func genTestPod() *v1.Pod { + claimName := claimName + return &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: podName, + Namespace: namespace, + UID: podUID, + }, + Spec: v1.PodSpec{ + ResourceClaims: []v1.PodResourceClaim{ + { + Name: claimName, + ResourceClaimName: &claimName, + }, + }, + Containers: []v1.Container{ + { + Resources: v1.ResourceRequirements{ + Claims: []v1.ResourceClaim{ + { + Name: claimName, + }, }, }, }, }, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-1", - ResourceClaimName: &resourceClaimName, - }, + }, + } +} + +// getTestClaim generates resource claim object +func genTestClaim(name, driver, device, podUID string) *resourceapi.ResourceClaim { + return &resourceapi.ResourceClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + UID: types.UID(fmt.Sprintf("%s-uid", name)), + }, + Spec: resourceapi.ResourceClaimSpec{ + Devices: resourceapi.DeviceClaim{ + Requests: []resourceapi.DeviceRequest{ + { + Name: requestName, + DeviceClassName: className, }, }, }, - claimInfo: &ClaimInfo{ - annotations: map[string][]kubecontainer.Annotation{ - "test-plugin": { + }, + Status: resourceapi.ResourceClaimStatus{ + Allocation: &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: []resourceapi.DeviceRequestAllocationResult{ { - Name: "test-annotation", - Value: "123", + Request: requestName, + Pool: poolName, + Device: device, + Driver: driver, }, }, }, - ClaimInfoState: state.ClaimInfoState{ - ClaimName: "test-pod-claim-1", - CDIDevices: map[string][]string{ - driverName: {"123"}, - }, - Namespace: "test-namespace", + }, + ReservedFor: []resourceapi.ResourceClaimConsumerReference{ + {UID: types.UID(podUID)}, + }, + }, + } +} + +// genTestClaimInfo generates claim info object +func genTestClaimInfo(podUIDs []string, prepared bool) *ClaimInfo { + return &ClaimInfo{ + ClaimInfoState: state.ClaimInfoState{ + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](podUIDs...), + DriverState: map[string]state.DriverState{ + driverName: { + Devices: []state.Device{{ + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{requestName}, + CDIDeviceIDs: []string{cdiID}, + }}, }, }, }, + prepared: prepared, + } +} + +// genClaimInfoState generates claim info state object +func genClaimInfoState(cdiDeviceID string) state.ClaimInfoState { + s := state.ClaimInfoState{ + ClaimUID: claimUID, + ClaimName: claimName, + Namespace: namespace, + PodUIDs: sets.New[string](podUID), + DriverState: map[string]state.DriverState{ + driverName: {}, + }, + } + if cdiDeviceID != "" { + s.DriverState[driverName] = state.DriverState{Devices: []state.Device{{PoolName: poolName, DeviceName: deviceName, RequestNames: []string{requestName}, CDIDeviceIDs: []string{cdiDeviceID}}}} + } + return s +} + +func TestGetResources(t *testing.T) { + kubeClient := fake.NewSimpleClientset() + + for _, test := range []struct { + description string + container *v1.Container + pod *v1.Pod + claimInfo *ClaimInfo + wantErr bool + }{ { - description: "claim info without annotations", + description: "claim info with devices", container: &v1.Container{ - Name: "test-container", + Name: containerName, Resources: v1.ResourceRequirements{ Claims: []v1.ResourceClaim{ { - Name: "test-pod-claim-1", - }, - }, - }, - }, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-1", - ResourceClaimName: &resourceClaimName, + Name: claimName, }, }, }, }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - ClaimName: "test-pod-claim-1", - CDIDevices: map[string][]string{ - driverName: {"123"}, - }, - Namespace: "test-namespace", - }, - }, + pod: genTestPod(), + claimInfo: genTestClaimInfo(nil, false), }, { - description: "no claim info", + description: "nil claiminfo", container: &v1.Container{ - Name: "test-container", + Name: containerName, Resources: v1.ResourceRequirements{ Claims: []v1.ResourceClaim{ { - Name: "test-pod-claim-1", - }, - }, - }, - }, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-1", + Name: claimName, }, }, }, }, + pod: genTestPod(), wantErr: true, }, } { @@ -323,11 +363,10 @@ func TestGetResources(t *testing.T) { containerInfo, err := manager.GetResources(test.pod, test.container) if test.wantErr { assert.Error(t, err) - return + } else { + require.NoError(t, err) + assert.Equal(t, test.claimInfo.DriverState[driverName].Devices[0].CDIDeviceIDs[0], containerInfo.CDIDevices[0].Name) } - - assert.NoError(t, err) - assert.Equal(t, test.claimInfo.CDIDevices[driverName][0], containerInfo.CDIDevices[0].Name) }) } } @@ -337,560 +376,165 @@ func getFakeNode() (*v1.Node, error) { } func TestPrepareResources(t *testing.T) { + claimName := claimName fakeKubeClient := fake.NewSimpleClientset() for _, test := range []struct { - description string - driverName string - pod *v1.Pod - claimInfo *ClaimInfo - resourceClaim *resourcev1alpha2.ResourceClaim - resp *drapbv1.NodePrepareResourcesResponse - wantErr bool - wantTimeout bool - wantResourceSkipped bool - expectedCDIDevices []string - ExpectedPrepareCalls uint32 + description string + driverName string + pod *v1.Pod + claimInfo *ClaimInfo + claim *resourceapi.ResourceClaim + resp *drapb.NodePrepareResourcesResponse + wantTimeout bool + wantResourceSkipped bool + + expectedErrMsg string + expectedClaimInfoState state.ClaimInfoState + expectedPrepareCalls uint32 }{ { - description: "failed to fetch ResourceClaim", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-0", - - ResourceClaimName: func() *string { - s := "test-pod-claim-0" - return &s - }(), - }, - }, - }, - }, - wantErr: true, + description: "claim doesn't exist", + driverName: driverName, + pod: genTestPod(), + expectedErrMsg: "failed to fetch ResourceClaim ", }, { - description: "plugin does not exist", - driverName: "this-plugin-does-not-exist", - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-1", - ResourceClaimName: func() *string { - s := "test-pod-claim-1" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-1", - }, - }, - }, - }, - }, - }, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-1", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, - }, - }, - wantErr: true, + description: "unknown driver", + pod: genTestPod(), + claim: genTestClaim(claimName, "unknown driver", deviceName, podUID), + expectedErrMsg: "plugin name unknown driver not found in the list of registered DRA plugins", }, { - description: "should prepare resources, driver returns nil value", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-nil", - ResourceClaimName: func() *string { - s := "test-pod-claim-nil" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-nil", - }, - }, - }, - }, - }, - }, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-nil", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, - }, - }, - resp: &drapbv1.NodePrepareResourcesResponse{Claims: map[string]*drapbv1.NodePrepareResourceResponse{"test-reserved": nil}}, - expectedCDIDevices: []string{}, - ExpectedPrepareCalls: 1, + description: "should prepare resources, driver returns nil value", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + resp: &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{string(claimUID): nil}}, + expectedClaimInfoState: genClaimInfoState(""), + expectedPrepareCalls: 1, + }, + { + description: "driver returns empty result", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + resp: &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{}}, + expectedPrepareCalls: 1, + expectedErrMsg: "NodePrepareResources left out 1 claims", + }, + { + description: "pod is not allowed to use resource claim", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, ""), + expectedErrMsg: "is not allowed to use resource claim ", }, { - description: "should prepare resources, driver returns empty result", + description: "no container uses the claim", driverName: driverName, pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", + Name: podName, + Namespace: namespace, + UID: podUID, }, Spec: v1.PodSpec{ ResourceClaims: []v1.PodResourceClaim{ { - Name: "test-pod-claim-empty", - ResourceClaimName: func() *string { - s := "test-pod-claim-empty" - return &s - }(), + Name: claimName, + ResourceClaimName: &claimName, }, }, Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-empty", - }, - }, - }, - }, + {}, }, }, }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-empty", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, + claim: genTestClaim(claimName, driverName, deviceName, podUID), + expectedPrepareCalls: 1, + expectedClaimInfoState: genClaimInfoState(cdiID), + resp: &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{ + string(claimUID): { + Devices: []*drapb.Device{ + { + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{requestName}, + CDIDeviceIDs: []string{cdiID}, }, }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, }, - }, - resp: &drapbv1.NodePrepareResourcesResponse{Claims: map[string]*drapbv1.NodePrepareResourceResponse{"test-reserved": nil}}, - expectedCDIDevices: []string{}, - ExpectedPrepareCalls: 1, + }}, }, { - description: "pod is not allowed to use resource claim", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ + description: "resource already prepared", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + claimInfo: genTestClaimInfo([]string{podUID}, true), + expectedClaimInfoState: genClaimInfoState(cdiID), + resp: &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{ + string(claimUID): { + Devices: []*drapb.Device{ { - Name: "test-pod-claim-2", - ResourceClaimName: func() *string { - s := "test-pod-claim-2" - return &s - }(), - }, - }, - }, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-2", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{requestName}, + CDIDeviceIDs: []string{cdiID}, }, }, }, - }, - wantErr: true, + }}, }, { - description: "no container actually uses the claim", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ + description: "should timeout", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + wantTimeout: true, + expectedPrepareCalls: 1, + expectedErrMsg: "NodePrepareResources failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded", + }, + { + description: "should prepare resource, claim not in cache", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + expectedClaimInfoState: genClaimInfoState(cdiID), + resp: &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{ + string(claimUID): { + Devices: []*drapb.Device{ { - Name: "test-pod-claim-3", - ResourceClaimName: func() *string { - s := "test-pod-claim-3" - return &s - }(), - }, - }, - }, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-3", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{requestName}, + CDIDeviceIDs: []string{cdiID}, }, }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, }, - }, - wantResourceSkipped: true, + }}, + expectedPrepareCalls: 1, }, { - description: "resource already prepared", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-4", - ResourceClaimName: func() *string { - s := "test-pod-claim-4" - return &s - }(), - }, - }, - Containers: []v1.Container{ + description: "resource already prepared", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + claimInfo: genTestClaimInfo([]string{podUID}, true), + expectedClaimInfoState: genClaimInfoState(cdiID), + resp: &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{ + string(claimUID): { + Devices: []*drapb.Device{ { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-4", - }, - }, - }, + PoolName: poolName, + DeviceName: deviceName, + RequestNames: []string{requestName}, + CDIDeviceIDs: []string{cdiID}, }, }, }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "test-pod-claim-4", - Namespace: "test-namespace", - PodUIDs: sets.Set[string]{"test-another-pod-reserved": sets.Empty{}}, - }, - prepared: true, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-4", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, - }, - }, - expectedCDIDevices: []string{fmt.Sprintf("%s/%s=claim-test-reserved", driverName, driverClassName)}, - wantResourceSkipped: true, - }, - { - description: "should timeout", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-5", - ResourceClaimName: func() *string { - s := "test-pod-claim-5" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-5", - }, - }, - }, - }, - }, - }, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-5", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, - }, - }, - resp: &drapbv1.NodePrepareResourcesResponse{ - Claims: map[string]*drapbv1.NodePrepareResourceResponse{ - "test-reserved": {CDIDevices: []string{fmt.Sprintf("%s/%s=claim-test-reserved", driverName, driverClassName)}}, - }, - }, - wantErr: true, - wantTimeout: true, - ExpectedPrepareCalls: 1, - }, - { - description: "should prepare resource, claim not in cache", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-6", - ResourceClaimName: func() *string { - s := "test-pod-claim-6" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-6", - }, - }, - }, - }, - }, - }, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim-6", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, - }, - }, - resp: &drapbv1.NodePrepareResourcesResponse{ - Claims: map[string]*drapbv1.NodePrepareResourceResponse{ - "test-reserved": {CDIDevices: []string{fmt.Sprintf("%s/%s=claim-test-reserved", driverName, driverClassName)}}, - }, - }, - expectedCDIDevices: []string{fmt.Sprintf("%s/%s=claim-test-reserved", driverName, driverClassName)}, - ExpectedPrepareCalls: 1, - }, - { - description: "should prepare resource. claim in cache, manager did not prepare resource", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim", - ResourceClaimName: func() *string { - s := "test-pod-claim" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClassName: "test-class", - ClaimName: "test-pod-claim", - ClaimUID: "test-reserved", - Namespace: "test-namespace", - PodUIDs: sets.Set[string]{"test-reserved": sets.Empty{}}, - ResourceHandles: []resourcev1alpha2.ResourceHandle{{Data: "test-data", DriverName: driverName}}, - }, - annotations: make(map[string][]kubecontainer.Annotation), - prepared: false, - }, - resourceClaim: &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod-claim", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: "test-reserved"}, - }, - }, - }, - resp: &drapbv1.NodePrepareResourcesResponse{ - Claims: map[string]*drapbv1.NodePrepareResourceResponse{ - "test-reserved": {CDIDevices: []string{fmt.Sprintf("%s/%s=claim-test-reserved", driverName, driverClassName)}}, - }, - }, - expectedCDIDevices: []string{fmt.Sprintf("%s/%s=claim-test-reserved", driverName, driverClassName)}, - ExpectedPrepareCalls: 1, + }}, }, } { t.Run(test.description, func(t *testing.T) { @@ -904,10 +548,13 @@ func TestPrepareResources(t *testing.T) { cache: cache, } - if test.resourceClaim != nil { - if _, err := fakeKubeClient.ResourceV1alpha2().ResourceClaims(test.pod.Namespace).Create(context.Background(), test.resourceClaim, metav1.CreateOptions{}); err != nil { - t.Fatalf("failed to create ResourceClaim %s: %+v", test.resourceClaim.Name, err) + if test.claim != nil { + if _, err := fakeKubeClient.ResourceV1alpha3().ResourceClaims(test.pod.Namespace).Create(context.Background(), test.claim, metav1.CreateOptions{}); err != nil { + t.Fatalf("failed to create ResourceClaim %s: %+v", test.claim.Name, err) } + defer func() { + require.NoError(t, fakeKubeClient.ResourceV1alpha3().ResourceClaims(test.pod.Namespace).Delete(context.Background(), test.claim.Name, metav1.DeleteOptions{})) + }() } var pluginClientTimeout *time.Duration @@ -934,17 +581,22 @@ func TestPrepareResources(t *testing.T) { err = manager.PrepareResources(test.pod) - assert.Equal(t, test.ExpectedPrepareCalls, draServerInfo.server.prepareResourceCalls.Load()) + assert.Equal(t, test.expectedPrepareCalls, draServerInfo.server.prepareResourceCalls.Load()) - if test.wantErr { + if test.expectedErrMsg != "" { assert.Error(t, err) - return // PrepareResources returned an error so stopping the subtest here - } else if test.wantResourceSkipped { - assert.NoError(t, err) - return // resource skipped so no need to continue + if err != nil { + assert.Contains(t, err.Error(), test.expectedErrMsg) + } + return // PrepareResources returned an error so stopping the test case here } assert.NoError(t, err) + + if test.wantResourceSkipped { + return // resource skipped so no need to continue + } + // check the cache contains the expected claim info claimName, _, err := resourceclaim.Name(test.pod, &test.pod.Spec.ResourceClaims[0]) if err != nil { @@ -954,320 +606,84 @@ func TestPrepareResources(t *testing.T) { if !ok { t.Fatalf("claimInfo not found in cache for claim %s", *claimName) } - if claimInfo.DriverName != test.resourceClaim.Status.DriverName { - t.Fatalf("driverName mismatch: expected %s, got %s", test.resourceClaim.Status.DriverName, claimInfo.DriverName) - } - if claimInfo.ClassName != test.resourceClaim.Spec.ResourceClassName { - t.Fatalf("resourceClassName mismatch: expected %s, got %s", test.resourceClaim.Spec.ResourceClassName, claimInfo.ClassName) - } if len(claimInfo.PodUIDs) != 1 || !claimInfo.PodUIDs.Has(string(test.pod.UID)) { t.Fatalf("podUIDs mismatch: expected [%s], got %v", test.pod.UID, claimInfo.PodUIDs) } - assert.ElementsMatchf(t, claimInfo.CDIDevices[test.resourceClaim.Status.DriverName], test.expectedCDIDevices, - "cdiDevices mismatch: expected [%v], got %v", test.expectedCDIDevices, claimInfo.CDIDevices[test.resourceClaim.Status.DriverName]) + + assert.Equal(t, test.expectedClaimInfoState, claimInfo.ClaimInfoState) }) } } func TestUnprepareResources(t *testing.T) { fakeKubeClient := fake.NewSimpleClientset() - for _, test := range []struct { - description string - driverName string - pod *v1.Pod - claimInfo *ClaimInfo - resp *drapbv1.NodeUnprepareResourcesResponse - wantErr bool - wantTimeout bool - wantResourceSkipped bool + description string + driverName string + pod *v1.Pod + claimInfo *ClaimInfo + claim *resourceapi.ResourceClaim + resp *drapb.NodeUnprepareResourcesResponse + wantTimeout bool + wantResourceSkipped bool + expectedUnprepareCalls uint32 + expectedErrMsg string }{ { - description: "plugin does not exist", - driverName: "this-plugin-does-not-exist", - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "another-claim-test", - ResourceClaimName: func() *string { - s := "another-claim-test" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "another-claim-test", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "another-claim-test", - Namespace: "test-namespace", - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: driverName, - Data: "test data", - }, - }, - }, - }, - wantErr: true, + description: "unknown driver", + pod: genTestPod(), + claim: genTestClaim(claimName, "unknown driver", deviceName, podUID), + claimInfo: genTestClaimInfo([]string{podUID}, true), + expectedErrMsg: "plugin name test-driver not found in the list of registered DRA plugins", }, { - description: "resource claim referenced by other pod(s)", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-1", - ResourceClaimName: func() *string { - s := "test-pod-claim-1" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-1", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "test-pod-claim-1", - Namespace: "test-namespace", - PodUIDs: sets.Set[string]{"test-reserved": sets.Empty{}, "test-reserved-2": sets.Empty{}}, - }, - }, + description: "resource claim referenced by other pod(s)", + driverName: driverName, + pod: genTestPod(), + claimInfo: genTestClaimInfo([]string{podUID, "another-pod-uid"}, true), wantResourceSkipped: true, }, { - description: "should timeout", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-2", - ResourceClaimName: func() *string { - s := "test-pod-claim-2" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-2", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "test-pod-claim-2", - Namespace: "test-namespace", - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: driverName, - Data: "test data", - }, - }, - }, - }, - resp: &drapbv1.NodeUnprepareResourcesResponse{Claims: map[string]*drapbv1.NodeUnprepareResourceResponse{"test-reserved": {}}}, - wantErr: true, + description: "should timeout", + driverName: driverName, + pod: genTestPod(), + claimInfo: genTestClaimInfo([]string{podUID}, true), wantTimeout: true, expectedUnprepareCalls: 1, + expectedErrMsg: "context deadline exceeded", }, { - description: "should unprepare resource, claim previously prepared by currently running manager", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-3", - ResourceClaimName: func() *string { - s := "test-pod-claim-3" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-3", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "test-pod-claim-3", - Namespace: "test-namespace", - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: driverName, - Data: "test data", - }, - }, - }, - prepared: true, - }, - resp: &drapbv1.NodeUnprepareResourcesResponse{Claims: map[string]*drapbv1.NodeUnprepareResourceResponse{"": {}}}, + description: "should fail when driver returns empty response", + driverName: driverName, + pod: genTestPod(), + claimInfo: genTestClaimInfo([]string{podUID}, true), + resp: &drapb.NodeUnprepareResourcesResponse{Claims: map[string]*drapb.NodeUnprepareResourceResponse{}}, expectedUnprepareCalls: 1, + expectedErrMsg: "NodeUnprepareResources left out 1 claims", }, { - description: "should unprepare resource, claim previously was not prepared by currently running manager", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim", - ResourceClaimName: func() *string { - s := "test-pod-claim" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "test-pod-claim", - Namespace: "test-namespace", - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: driverName, - Data: "test data", - }, - }, - }, - prepared: false, - }, - resp: &drapbv1.NodeUnprepareResourcesResponse{Claims: map[string]*drapbv1.NodeUnprepareResourceResponse{"": {}}}, + description: "should unprepare resource", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + claimInfo: genTestClaimInfo([]string{podUID}, false), expectedUnprepareCalls: 1, }, { - description: "should unprepare resource, driver returns nil value", - driverName: driverName, - pod: &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - UID: "test-reserved", - }, - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "test-pod-claim-nil", - ResourceClaimName: func() *string { - s := "test-pod-claim-nil" - return &s - }(), - }, - }, - Containers: []v1.Container{ - { - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "test-pod-claim-nil", - }, - }, - }, - }, - }, - }, - }, - claimInfo: &ClaimInfo{ - ClaimInfoState: state.ClaimInfoState{ - DriverName: driverName, - ClaimName: "test-pod-claim-nil", - Namespace: "test-namespace", - ClaimUID: "test-reserved", - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: driverName, - Data: "test data", - }, - }, - }, - prepared: true, - }, - resp: &drapbv1.NodeUnprepareResourcesResponse{Claims: map[string]*drapbv1.NodeUnprepareResourceResponse{"test-reserved": nil}}, + description: "should unprepare already prepared resource", + driverName: driverName, + pod: genTestPod(), + claim: genTestClaim(claimName, driverName, deviceName, podUID), + claimInfo: genTestClaimInfo([]string{podUID}, true), + expectedUnprepareCalls: 1, + }, + { + description: "should unprepare resource when driver returns nil value", + driverName: driverName, + pod: genTestPod(), + claimInfo: genTestClaimInfo([]string{podUID}, true), + resp: &drapb.NodeUnprepareResourcesResponse{Claims: map[string]*drapb.NodeUnprepareResourceResponse{string(claimUID): nil}}, expectedUnprepareCalls: 1, }, } { @@ -1308,15 +724,20 @@ func TestUnprepareResources(t *testing.T) { assert.Equal(t, test.expectedUnprepareCalls, draServerInfo.server.unprepareResourceCalls.Load()) - if test.wantErr { + if test.expectedErrMsg != "" { assert.Error(t, err) - return // UnprepareResources returned an error so stopping the subtest here - } else if test.wantResourceSkipped { - assert.NoError(t, err) - return // resource skipped so no need to continue + if err != nil { + assert.Contains(t, err.Error(), test.expectedErrMsg) + } + return // PrepareResources returned an error so stopping the test case here } assert.NoError(t, err) + + if test.wantResourceSkipped { + return // resource skipped so no need to continue + } + // Check that the cache has been updated correctly claimName, _, err := resourceclaim.Name(test.pod, &test.pod.Spec.ResourceClaims[0]) if err != nil { @@ -1342,10 +763,6 @@ func TestPodMightNeedToUnprepareResources(t *testing.T) { cache: cache, } - claimName := "test-claim" - podUID := "test-pod-uid" - namespace := "test-namespace" - claimInfo := &ClaimInfo{ ClaimInfoState: state.ClaimInfoState{PodUIDs: sets.New(podUID), ClaimName: claimName, Namespace: namespace}, } @@ -1359,81 +776,89 @@ func TestPodMightNeedToUnprepareResources(t *testing.T) { } func TestGetContainerClaimInfos(t *testing.T) { - cache, err := newClaimInfoCache(t.TempDir(), draManagerStateFileName) - if err != nil { - t.Fatalf("error occur:%v", err) - } - manager := &ManagerImpl{ - cache: cache, - } - - resourceClaimName := "test-resource-claim-1" - resourceClaimName2 := "test-resource-claim-2" + for _, test := range []struct { + description string + pod *v1.Pod + claimInfo *ClaimInfo - for i, test := range []struct { expectedClaimName string - pod *v1.Pod - container *v1.Container - claimInfo *ClaimInfo + expectedErrMsg string }{ { - expectedClaimName: resourceClaimName, - pod: &v1.Pod{ - Spec: v1.PodSpec{ - ResourceClaims: []v1.PodResourceClaim{ - { - Name: "claim1", - ResourceClaimName: &resourceClaimName, - }, - }, - }, - }, - container: &v1.Container{ - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ - { - Name: "claim1", - }, - }, - }, - }, - claimInfo: &ClaimInfo{ClaimInfoState: state.ClaimInfoState{ClaimName: resourceClaimName}}, + description: "should get claim info", + expectedClaimName: claimName, + pod: genTestPod(), + claimInfo: genTestClaimInfo([]string{podUID}, false), + }, + { + description: "should fail when claim info not found", + pod: genTestPod(), + claimInfo: &ClaimInfo{}, + expectedErrMsg: "unable to get claim info for claim ", }, { - expectedClaimName: resourceClaimName2, + description: "should fail when none of the supported fields are set", pod: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: podName, + Namespace: namespace, + UID: podUID, + }, Spec: v1.PodSpec{ ResourceClaims: []v1.PodResourceClaim{ { - Name: "claim2", - ResourceClaimName: &resourceClaimName2, + Name: claimName, + // missing ResourceClaimName or ResourceClaimTemplateName }, }, - }, - }, - container: &v1.Container{ - Resources: v1.ResourceRequirements{ - Claims: []v1.ResourceClaim{ + Containers: []v1.Container{ { - Name: "claim2", + Resources: v1.ResourceRequirements{ + Claims: []v1.ResourceClaim{ + { + Name: claimName, + }, + }, + }, }, }, }, }, - claimInfo: &ClaimInfo{ClaimInfoState: state.ClaimInfoState{ClaimName: resourceClaimName2}}, + claimInfo: genTestClaimInfo([]string{podUID}, false), + expectedErrMsg: "none of the supported fields are set", + }, + { + description: "should fail when claim info is not cached", + pod: genTestPod(), + expectedErrMsg: "unable to get claim info for claim ", }, } { - t.Run(fmt.Sprintf("test-%d", i), func(t *testing.T) { - manager.cache.add(test.claimInfo) + t.Run(test.description, func(t *testing.T) { + cache, err := newClaimInfoCache(t.TempDir(), draManagerStateFileName) + if err != nil { + t.Fatalf("error occur:%v", err) + } + manager := &ManagerImpl{ + cache: cache, + } - fakeClaimInfos, err := manager.GetContainerClaimInfos(test.pod, test.container) - assert.NoError(t, err) - assert.Len(t, fakeClaimInfos, 1) - assert.Equal(t, test.expectedClaimName, fakeClaimInfos[0].ClaimInfoState.ClaimName) + if test.claimInfo != nil { + manager.cache.add(test.claimInfo) + } + + claimInfos, err := manager.GetContainerClaimInfos(test.pod, &test.pod.Spec.Containers[0]) + + if test.expectedErrMsg != "" { + assert.Error(t, err) + if err != nil { + assert.Contains(t, err.Error(), test.expectedErrMsg) + } + return + } - manager.cache.delete(test.pod.Spec.ResourceClaims[0].Name, "default") - _, err = manager.GetContainerClaimInfos(test.pod, test.container) assert.NoError(t, err) + assert.Len(t, claimInfos, 1) + assert.Equal(t, test.expectedClaimName, claimInfos[0].ClaimInfoState.ClaimName) }) } } @@ -1476,13 +901,12 @@ func TestParallelPrepareUnprepareResources(t *testing.T) { wgStart.Wait() // Wait to start all goroutines at the same time var err error - nameSpace := "test-namespace-parallel" claimName := fmt.Sprintf("test-pod-claim-%d", goRoutineNum) - podUID := types.UID(fmt.Sprintf("test-reserved-%d", goRoutineNum)) + podUID := types.UID(fmt.Sprintf("test-pod-uid-%d", goRoutineNum)) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("test-pod-%d", goRoutineNum), - Namespace: nameSpace, + Namespace: namespace, UID: podUID, }, Spec: v1.PodSpec{ @@ -1508,30 +932,10 @@ func TestParallelPrepareUnprepareResources(t *testing.T) { }, }, } - resourceClaim := &resourcev1alpha2.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: claimName, - Namespace: nameSpace, - UID: types.UID(fmt.Sprintf("claim-%d", goRoutineNum)), - }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: "test-class", - }, - Status: resourcev1alpha2.ResourceClaimStatus{ - DriverName: driverName, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - {Data: "test-data", DriverName: driverName}, - }, - }, - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ - {UID: podUID}, - }, - }, - } + claim := genTestClaim(claimName, driverName, deviceName, string(podUID)) - if _, err = fakeKubeClient.ResourceV1alpha2().ResourceClaims(pod.Namespace).Create(context.Background(), resourceClaim, metav1.CreateOptions{}); err != nil { - t.Errorf("failed to create ResourceClaim %s: %+v", resourceClaim.Name, err) + if _, err = fakeKubeClient.ResourceV1alpha3().ResourceClaims(pod.Namespace).Create(context.Background(), claim, metav1.CreateOptions{}); err != nil { + t.Errorf("failed to create ResourceClaim %s: %+v", claim.Name, err) return } diff --git a/pkg/kubelet/cm/dra/plugin/client.go b/pkg/kubelet/cm/dra/plugin/client.go index 5ec5c9d39878d..d79f1a51b045a 100644 --- a/pkg/kubelet/cm/dra/plugin/client.go +++ b/pkg/kubelet/cm/dra/plugin/client.go @@ -18,18 +18,28 @@ package plugin import ( "context" + "errors" "fmt" + "net" + "sync" "time" "google.golang.org/grpc" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials/insecure" + utilversion "k8s.io/apimachinery/pkg/util/version" "k8s.io/klog/v2" - drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha3" + drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha4" ) const PluginClientTimeout = 45 * time.Second -func NewDRAPluginClient(pluginName string) (drapb.NodeClient, error) { +// NewDRAPluginClient returns a wrapper around those gRPC methods of a DRA +// driver kubelet plugin which need to be called by kubelet. The wrapper +// handles gRPC connection management and logging. Connections are reused +// across different NewDRAPluginClient calls. +func NewDRAPluginClient(pluginName string) (*Plugin, error) { if pluginName == "" { return nil, fmt.Errorf("plugin name is empty") } @@ -42,35 +52,64 @@ func NewDRAPluginClient(pluginName string) (drapb.NodeClient, error) { return existingPlugin, nil } -func (p *plugin) NodePrepareResources( - ctx context.Context, - req *drapb.NodePrepareResourcesRequest, - opts ...grpc.CallOption, -) (*drapb.NodePrepareResourcesResponse, error) { +type Plugin struct { + backgroundCtx context.Context + cancel func(cause error) + + mutex sync.Mutex + conn *grpc.ClientConn + endpoint string + highestSupportedVersion *utilversion.Version + clientTimeout time.Duration +} + +func (p *Plugin) getOrCreateGRPCConn() (*grpc.ClientConn, error) { + p.mutex.Lock() + defer p.mutex.Unlock() + + if p.conn != nil { + return p.conn, nil + } + + ctx := p.backgroundCtx logger := klog.FromContext(ctx) - logger.V(4).Info(log("calling NodePrepareResources rpc"), "request", req) - conn, err := p.getOrCreateGRPCConn() + network := "unix" + logger.V(4).Info("Creating new gRPC connection", "protocol", network, "endpoint", p.endpoint) + // grpc.Dial is deprecated. grpc.NewClient should be used instead. + // For now this gets ignored because this function is meant to establish + // the connection, with the one second timeout below. Perhaps that + // approach should be reconsidered? + //nolint:staticcheck + conn, err := grpc.Dial( + p.endpoint, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(func(ctx context.Context, target string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, network, target) + }), + ) if err != nil { return nil, err } - ctx, cancel := context.WithTimeout(ctx, p.clientTimeout) + ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() - nodeClient := drapb.NewNodeClient(conn) - response, err := nodeClient.NodePrepareResources(ctx, req) - logger.V(4).Info(log("done calling NodePrepareResources rpc"), "response", response, "err", err) - return response, err + if ok := conn.WaitForStateChange(ctx, connectivity.Connecting); !ok { + return nil, errors.New("timed out waiting for gRPC connection to be ready") + } + + p.conn = conn + return p.conn, nil } -func (p *plugin) NodeUnprepareResources( +func (p *Plugin) NodePrepareResources( ctx context.Context, - req *drapb.NodeUnprepareResourcesRequest, + req *drapb.NodePrepareResourcesRequest, opts ...grpc.CallOption, -) (*drapb.NodeUnprepareResourcesResponse, error) { +) (*drapb.NodePrepareResourcesResponse, error) { logger := klog.FromContext(ctx) - logger.V(4).Info(log("calling NodeUnprepareResource rpc"), "request", req) + logger.V(4).Info("Calling NodePrepareResources rpc", "request", req) conn, err := p.getOrCreateGRPCConn() if err != nil { @@ -81,24 +120,29 @@ func (p *plugin) NodeUnprepareResources( defer cancel() nodeClient := drapb.NewNodeClient(conn) - response, err := nodeClient.NodeUnprepareResources(ctx, req) - logger.V(4).Info(log("done calling NodeUnprepareResources rpc"), "response", response, "err", err) + response, err := nodeClient.NodePrepareResources(ctx, req) + logger.V(4).Info("Done calling NodePrepareResources rpc", "response", response, "err", err) return response, err } -func (p *plugin) NodeListAndWatchResources( +func (p *Plugin) NodeUnprepareResources( ctx context.Context, - req *drapb.NodeListAndWatchResourcesRequest, + req *drapb.NodeUnprepareResourcesRequest, opts ...grpc.CallOption, -) (drapb.Node_NodeListAndWatchResourcesClient, error) { +) (*drapb.NodeUnprepareResourcesResponse, error) { logger := klog.FromContext(ctx) - logger.V(4).Info(log("calling NodeListAndWatchResources rpc"), "request", req) + logger.V(4).Info("Calling NodeUnprepareResource rpc", "request", req) conn, err := p.getOrCreateGRPCConn() if err != nil { return nil, err } + ctx, cancel := context.WithTimeout(ctx, p.clientTimeout) + defer cancel() + nodeClient := drapb.NewNodeClient(conn) - return nodeClient.NodeListAndWatchResources(ctx, req, opts...) + response, err := nodeClient.NodeUnprepareResources(ctx, req) + logger.V(4).Info("Done calling NodeUnprepareResources rpc", "response", response, "err", err) + return response, err } diff --git a/pkg/kubelet/cm/dra/plugin/client_test.go b/pkg/kubelet/cm/dra/plugin/client_test.go index 398f8ff60f94c..8858f077ff777 100644 --- a/pkg/kubelet/cm/dra/plugin/client_test.go +++ b/pkg/kubelet/cm/dra/plugin/client_test.go @@ -27,32 +27,34 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/grpc" - drapbv1alpha3 "k8s.io/kubelet/pkg/apis/dra/v1alpha3" + drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha4" + "k8s.io/kubernetes/test/utils/ktesting" ) -type fakeV1alpha3GRPCServer struct { - drapbv1alpha3.UnimplementedNodeServer -} - -var _ drapbv1alpha3.NodeServer = &fakeV1alpha3GRPCServer{} +const ( + v1alpha4Version = "v1alpha4" +) -func (f *fakeV1alpha3GRPCServer) NodePrepareResources(ctx context.Context, in *drapbv1alpha3.NodePrepareResourcesRequest) (*drapbv1alpha3.NodePrepareResourcesResponse, error) { - return &drapbv1alpha3.NodePrepareResourcesResponse{Claims: map[string]*drapbv1alpha3.NodePrepareResourceResponse{"dummy": {CDIDevices: []string{"dummy"}}}}, nil +type fakeV1alpha4GRPCServer struct { + drapb.UnimplementedNodeServer } -func (f *fakeV1alpha3GRPCServer) NodeUnprepareResources(ctx context.Context, in *drapbv1alpha3.NodeUnprepareResourcesRequest) (*drapbv1alpha3.NodeUnprepareResourcesResponse, error) { +var _ drapb.NodeServer = &fakeV1alpha4GRPCServer{} - return &drapbv1alpha3.NodeUnprepareResourcesResponse{}, nil +func (f *fakeV1alpha4GRPCServer) NodePrepareResources(ctx context.Context, in *drapb.NodePrepareResourcesRequest) (*drapb.NodePrepareResourcesResponse, error) { + return &drapb.NodePrepareResourcesResponse{Claims: map[string]*drapb.NodePrepareResourceResponse{"claim-uid": { + CDIDevices: []*drapb.Device{ + { + RequestName: "test-request", + CdiIds: []string{"test-cdi-id"}, + }, + }, + }}}, nil } -func (f *fakeV1alpha3GRPCServer) NodeListAndWatchResources(req *drapbv1alpha3.NodeListAndWatchResourcesRequest, srv drapbv1alpha3.Node_NodeListAndWatchResourcesServer) error { - if err := srv.Send(&drapbv1alpha3.NodeListAndWatchResourcesResponse{}); err != nil { - return err - } - if err := srv.Send(&drapbv1alpha3.NodeListAndWatchResourcesResponse{}); err != nil { - return err - } - return nil +func (f *fakeV1alpha4GRPCServer) NodeUnprepareResources(ctx context.Context, in *drapb.NodeUnprepareResourcesRequest) (*drapb.NodeUnprepareResourcesResponse, error) { + + return &drapb.NodeUnprepareResourcesResponse{}, nil } type tearDown func() @@ -78,9 +80,9 @@ func setupFakeGRPCServer(version string) (string, tearDown, error) { s := grpc.NewServer() switch version { - case v1alpha3Version: - fakeGRPCServer := &fakeV1alpha3GRPCServer{} - drapbv1alpha3.RegisterNodeServer(s, fakeGRPCServer) + case v1alpha4Version: + fakeGRPCServer := &fakeV1alpha4GRPCServer{} + drapb.RegisterNodeServer(s, fakeGRPCServer) default: return "", nil, fmt.Errorf("unsupported version: %s", version) } @@ -95,7 +97,8 @@ func setupFakeGRPCServer(version string) (string, tearDown, error) { } func TestGRPCConnIsReused(t *testing.T) { - addr, teardown, err := setupFakeGRPCServer(v1alpha3Version) + ctx := ktesting.Init(t) + addr, teardown, err := setupFakeGRPCServer(v1alpha4Version) if err != nil { t.Fatal(err) } @@ -105,8 +108,9 @@ func TestGRPCConnIsReused(t *testing.T) { wg := sync.WaitGroup{} m := sync.Mutex{} - p := &plugin{ - endpoint: addr, + p := &Plugin{ + backgroundCtx: ctx, + endpoint: addr, } conn, err := p.getOrCreateGRPCConn() @@ -135,21 +139,20 @@ func TestGRPCConnIsReused(t *testing.T) { return } - req := &drapbv1alpha3.NodePrepareResourcesRequest{ - Claims: []*drapbv1alpha3.Claim{ + req := &drapb.NodePrepareResourcesRequest{ + Claims: []*drapb.Claim{ { - Namespace: "dummy-namespace", - Uid: "dummy-uid", - Name: "dummy-claim", - ResourceHandle: "dummy-resource", + Namespace: "dummy-namespace", + Uid: "dummy-uid", + Name: "dummy-claim", }, }, } client.NodePrepareResources(context.TODO(), req) - client.(*plugin).Lock() - conn := client.(*plugin).conn - client.(*plugin).Unlock() + client.mutex.Lock() + conn := client.conn + client.mutex.Unlock() m.Lock() defer m.Unlock() @@ -193,7 +196,7 @@ func TestNewDRAPluginClient(t *testing.T) { { description: "plugin exists", setup: func(name string) tearDown { - draPlugins.add(name, &plugin{}) + draPlugins.add(name, &Plugin{}) return func() { draPlugins.delete(name) } @@ -222,23 +225,25 @@ func TestNodeUnprepareResources(t *testing.T) { description string serverSetup func(string) (string, tearDown, error) serverVersion string - request *drapbv1alpha3.NodeUnprepareResourcesRequest + request *drapb.NodeUnprepareResourcesRequest }{ { - description: "server supports v1alpha3", + description: "server supports v1alpha4", serverSetup: setupFakeGRPCServer, - serverVersion: v1alpha3Version, - request: &drapbv1alpha3.NodeUnprepareResourcesRequest{}, + serverVersion: v1alpha4Version, + request: &drapb.NodeUnprepareResourcesRequest{}, }, } { t.Run(test.description, func(t *testing.T) { + ctx := ktesting.Init(t) addr, teardown, err := setupFakeGRPCServer(test.serverVersion) if err != nil { t.Fatal(err) } defer teardown() - p := &plugin{ + p := &Plugin{ + backgroundCtx: ctx, endpoint: addr, clientTimeout: PluginClientTimeout, } @@ -269,74 +274,3 @@ func TestNodeUnprepareResources(t *testing.T) { }) } } - -func TestListAndWatchResources(t *testing.T) { - for _, test := range []struct { - description string - serverSetup func(string) (string, tearDown, error) - serverVersion string - request *drapbv1alpha3.NodeListAndWatchResourcesRequest - responses []*drapbv1alpha3.NodeListAndWatchResourcesResponse - expectError string - }{ - { - description: "server supports NodeResources API", - serverSetup: setupFakeGRPCServer, - serverVersion: v1alpha3Version, - request: &drapbv1alpha3.NodeListAndWatchResourcesRequest{}, - responses: []*drapbv1alpha3.NodeListAndWatchResourcesResponse{ - {}, - {}, - }, - expectError: "EOF", - }, - } { - t.Run(test.description, func(t *testing.T) { - addr, teardown, err := setupFakeGRPCServer(test.serverVersion) - if err != nil { - t.Fatal(err) - } - defer teardown() - - p := &plugin{ - endpoint: addr, - } - - conn, err := p.getOrCreateGRPCConn() - defer func() { - err := conn.Close() - if err != nil { - t.Error(err) - } - }() - if err != nil { - t.Fatal(err) - } - - draPlugins.add("dummy-plugin", p) - defer draPlugins.delete("dummy-plugin") - - client, err := NewDRAPluginClient("dummy-plugin") - if err != nil { - t.Fatal(err) - } - - stream, err := client.NodeListAndWatchResources(context.Background(), test.request) - if err != nil { - t.Fatal(err) - } - var actualResponses []*drapbv1alpha3.NodeListAndWatchResourcesResponse - var actualErr error - for { - resp, err := stream.Recv() - if err != nil { - actualErr = err - break - } - actualResponses = append(actualResponses, resp) - } - assert.Equal(t, test.responses, actualResponses) - assert.Contains(t, actualErr.Error(), test.expectError) - }) - } -} diff --git a/pkg/kubelet/cm/dra/plugin/noderesources.go b/pkg/kubelet/cm/dra/plugin/noderesources.go deleted file mode 100644 index 741eb17c89773..0000000000000 --- a/pkg/kubelet/cm/dra/plugin/noderesources.go +++ /dev/null @@ -1,520 +0,0 @@ -/* -Copyright 2024 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. -*/ - -package plugin - -import ( - "context" - "errors" - "fmt" - "io" - "sync" - "time" - - "github.com/google/go-cmp/cmp" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - v1 "k8s.io/api/core/v1" - resourceapi "k8s.io/api/resource/v1alpha2" - apiequality "k8s.io/apimachinery/pkg/api/equality" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - resourceinformers "k8s.io/client-go/informers/resource/v1alpha2" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/workqueue" - "k8s.io/klog/v2" - drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha3" - "k8s.io/utils/ptr" -) - -const ( - // resyncPeriod for informer - // TODO (https://github.com/kubernetes/kubernetes/issues/123688): disable? - resyncPeriod = time.Duration(10 * time.Minute) - retryPeriod = 5 * time.Second - maxRetryPeriod = 180 * time.Second - backoffFactor = 2.0 // Introduce a backoff multiplier as jitter factor -) - -// nodeResourcesController collects resource information from all registered -// plugins and synchronizes that information with ResourceSlice objects. -type nodeResourcesController struct { - ctx context.Context - kubeClient kubernetes.Interface - getNode func() (*v1.Node, error) - wg sync.WaitGroup - queue workqueue.TypedRateLimitingInterface[string] - sliceStore cache.Store - - mutex sync.RWMutex - activePlugins map[string]*activePlugin -} - -// activePlugin holds the resource information about one plugin -// and the gRPC stream that is used to retrieve that. The context -// used by that stream can be canceled separately to stop -// the monitoring. -type activePlugin struct { - // cancel is the function which cancels the monitorPlugin goroutine - // for this plugin. - cancel func(reason error) - - // resources is protected by the nodeResourcesController read/write lock. - // When receiving updates from the driver, the entire slice gets replaced, - // so it is okay to not do a deep copy of it. Only retrieving the slice - // must be protected by a read lock. - resources []*resourceapi.ResourceModel -} - -// startNodeResourcesController constructs a new controller and starts it. -// -// If a kubeClient is provided, then it synchronizes ResourceSlices -// with the resource information provided by plugins. Without it, -// the controller is inactive. This can happen when kubelet is run stand-alone -// without an apiserver. In that case we can't and don't need to publish -// ResourceSlices. -func startNodeResourcesController(ctx context.Context, kubeClient kubernetes.Interface, getNode func() (*v1.Node, error)) *nodeResourcesController { - if kubeClient == nil { - return nil - } - - logger := klog.FromContext(ctx) - logger = klog.LoggerWithName(logger, "node resources controller") - ctx = klog.NewContext(ctx, logger) - - c := &nodeResourcesController{ - ctx: ctx, - kubeClient: kubeClient, - getNode: getNode, - queue: workqueue.NewTypedRateLimitingQueueWithConfig( - workqueue.DefaultTypedControllerRateLimiter[string](), - workqueue.TypedRateLimitingQueueConfig[string]{Name: "node_resource_slices"}, - ), - activePlugins: make(map[string]*activePlugin), - } - - c.wg.Add(1) - go func() { - defer c.wg.Done() - c.run(ctx) - }() - - return c -} - -// waitForStop blocks until all background activity spawned by -// the controller has stopped. The context passed to start must -// be canceled for that to happen. -// -// Not needed at the moment, but if it was, this is what it would -// look like... -// func (c *nodeResourcesController) waitForStop() { -// if c == nil { -// return -// } -// -// c.wg.Wait() -// } - -// addPlugin is called whenever a plugin has been (re-)registered. -func (c *nodeResourcesController) addPlugin(driverName string, pluginInstance *plugin) { - if c == nil { - return - } - - klog.FromContext(c.ctx).V(2).Info("Adding plugin", "driverName", driverName) - c.mutex.Lock() - defer c.mutex.Unlock() - - if active := c.activePlugins[driverName]; active != nil { - active.cancel(errors.New("plugin has re-registered")) - } - active := &activePlugin{} - cancelCtx, cancel := context.WithCancelCause(c.ctx) - active.cancel = cancel - c.activePlugins[driverName] = active - c.queue.Add(driverName) - - c.wg.Add(1) - go func() { - defer c.wg.Done() - c.monitorPlugin(cancelCtx, active, driverName, pluginInstance) - }() -} - -// removePlugin is called whenever a plugin has been unregistered. -func (c *nodeResourcesController) removePlugin(driverName string) { - if c == nil { - return - } - - klog.FromContext(c.ctx).V(2).Info("Removing plugin", "driverName", driverName) - c.mutex.Lock() - defer c.mutex.Unlock() - if active, ok := c.activePlugins[driverName]; ok { - active.cancel(errors.New("plugin has unregistered")) - delete(c.activePlugins, driverName) - c.queue.Add(driverName) - } -} - -// monitorPlugin calls the plugin to retrieve resource information and caches -// all responses that it gets for processing in the sync method. It keeps -// retrying until an error or EOF response indicates that no further data is -// going to be sent, then watch resources of the plugin stops until it -// re-registers. -func (c *nodeResourcesController) monitorPlugin(ctx context.Context, active *activePlugin, driverName string, pluginInstance *plugin) { - logger := klog.FromContext(ctx) - logger = klog.LoggerWithValues(logger, "driverName", driverName) - logger.Info("Starting to monitor node resources of the plugin") - defer func() { - r := recover() - logger.Info("Stopping to monitor node resources of the plugin", "reason", context.Cause(ctx), "err", ctx.Err(), "recover", r) - }() - - backOff := flowcontrol.NewBackOffWithJitter(retryPeriod, maxRetryPeriod, backoffFactor) - backOffID := "retry" - - // Keep trying until canceled. - for ctx.Err() == nil { - logger.V(5).Info("Calling NodeListAndWatchResources") - stream, err := pluginInstance.NodeListAndWatchResources(ctx, new(drapb.NodeListAndWatchResourcesRequest)) - if err != nil { - switch { - case status.Convert(err).Code() == codes.Unimplemented: - // The plugin simply doesn't provide node resources. - active.cancel(errors.New("plugin does not support node resource reporting")) - default: - // This is a problem, report it and retry. - logger.Error(err, "Creating gRPC stream for node resources failed") - select { - case <-time.After(backOff.Get(backOffID)): - backOff.Next(backOffID, time.Now()) - case <-ctx.Done(): - } - } - continue - } - for { - response, err := stream.Recv() - if err != nil { - switch { - case errors.Is(err, io.EOF): - // This is okay. Some plugins might never change their - // resources after reporting them once. - active.cancel(errors.New("plugin has closed the stream")) - case status.Convert(err).Code() == codes.Unimplemented: - // The plugin has the method, does not really implement it. - active.cancel(errors.New("plugin does not support node resource reporting")) - case ctx.Err() == nil: - // This is a problem, report it and retry. - logger.Error(err, "Reading node resources from gRPC stream failed") - select { - case <-time.After(backOff.Get(backOffID)): - backOff.Next(backOffID, time.Now()) - case <-ctx.Done(): - } - } - break - } - - if loggerV := logger.V(6); loggerV.Enabled() { - loggerV.Info("Driver resources updated", "resources", response.Resources) - } else { - logger.V(5).Info("Driver resources updated", "numResources", len(response.Resources)) - } - - c.mutex.Lock() - active.resources = response.Resources - c.mutex.Unlock() - c.queue.Add(driverName) - } - } -} - -// run is running in the background. It handles blocking initialization (like -// syncing the informer) and then syncs the actual with the desired state. -func (c *nodeResourcesController) run(ctx context.Context) { - logger := klog.FromContext(ctx) - - // When kubelet starts, we have two choices: - // - Sync immediately, which in practice will delete all ResourceSlices - // because no plugin has registered yet. We could do a DeleteCollection - // to speed this up. - // - Wait a bit, then sync. If all plugins have re-registered in the meantime, - // we might not need to change any ResourceSlice. - // - // For now syncing starts immediately, with no DeleteCollection. This - // can be reconsidered later. - - // Wait until we're able to get a Node object. - // This means that the object is created on the API server, - // the kubeclient is functional and the node informer cache is populated with the node object. - // Without this it doesn't make sense to proceed further as we need a node name and - // a node UID for this controller to work. - var node *v1.Node - var err error - for { - node, err = c.getNode() - if err == nil { - break - } - logger.V(5).Info("Getting Node object failed, waiting", "err", err) - select { - case <-ctx.Done(): - return - case <-time.After(time.Second): - } - } - - // We could use an indexer on driver name, but that seems overkill. - informer := resourceinformers.NewFilteredResourceSliceInformer(c.kubeClient, resyncPeriod, nil, func(options *metav1.ListOptions) { - options.FieldSelector = "nodeName=" + node.Name - }) - c.sliceStore = informer.GetStore() - handler, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj any) { - slice, ok := obj.(*resourceapi.ResourceSlice) - if !ok { - return - } - logger.V(5).Info("ResourceSlice add", "slice", klog.KObj(slice)) - c.queue.Add(slice.DriverName) - }, - UpdateFunc: func(old, new any) { - oldSlice, ok := old.(*resourceapi.ResourceSlice) - if !ok { - return - } - newSlice, ok := new.(*resourceapi.ResourceSlice) - if !ok { - return - } - if loggerV := logger.V(6); loggerV.Enabled() { - loggerV.Info("ResourceSlice update", "slice", klog.KObj(newSlice), "diff", cmp.Diff(oldSlice, newSlice)) - } else { - logger.V(5).Info("ResourceSlice update", "slice", klog.KObj(newSlice)) - } - c.queue.Add(newSlice.DriverName) - }, - DeleteFunc: func(obj any) { - if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { - obj = tombstone.Obj - } - slice, ok := obj.(*resourceapi.ResourceSlice) - if !ok { - return - } - logger.V(5).Info("ResourceSlice delete", "slice", klog.KObj(slice)) - c.queue.Add(slice.DriverName) - }, - }) - if err != nil { - logger.Error(err, "Registering event handler on the ResourceSlice informer failed, disabling resource monitoring") - return - } - - // Start informer and wait for our cache to be populated. - c.wg.Add(1) - go func() { - defer c.wg.Done() - informer.Run(ctx.Done()) - }() - for !handler.HasSynced() { - select { - case <-time.After(time.Second): - case <-ctx.Done(): - return - } - } - logger.Info("ResourceSlice informer has synced") - - for c.processNextWorkItem(ctx) { - } -} - -func (c *nodeResourcesController) processNextWorkItem(ctx context.Context) bool { - key, shutdown := c.queue.Get() - if shutdown { - return false - } - defer c.queue.Done(key) - - driverName := key - - // Panics are caught and treated like errors. - var err error - func() { - defer func() { - if r := recover(); r != nil { - err = fmt.Errorf("internal error: %v", r) - } - }() - err = c.sync(ctx, driverName) - }() - - if err != nil { - // TODO (https://github.com/kubernetes/enhancements/issues/3077): contextual logging in utilruntime - utilruntime.HandleError(fmt.Errorf("processing driver %v: %v", driverName, err)) - c.queue.AddRateLimited(key) - - // Return without removing the work item from the queue. - // It will be retried. - return true - } - - c.queue.Forget(key) - return true -} - -func (c *nodeResourcesController) sync(ctx context.Context, driverName string) error { - logger := klog.FromContext(ctx) - - // Gather information about the actual and desired state. - slices := c.sliceStore.List() - var driverResources []*resourceapi.ResourceModel - c.mutex.RLock() - if active, ok := c.activePlugins[driverName]; ok { - // No need for a deep copy, the entire slice gets replaced on writes. - driverResources = active.resources - } - c.mutex.RUnlock() - - // Resources that are not yet stored in any slice need to be published. - // Here we track the indices of any resources that are already stored. - storedResourceIndices := sets.New[int]() - - // Slices that don't match any driver resource can either be updated (if there - // are new driver resources that need to be stored) or they need to be deleted. - obsoleteSlices := make([]*resourceapi.ResourceSlice, 0, len(slices)) - - // Match slices with resource information. - for _, obj := range slices { - slice := obj.(*resourceapi.ResourceSlice) - if slice.DriverName != driverName { - continue - } - - index := indexOfModel(driverResources, &slice.ResourceModel) - if index >= 0 { - storedResourceIndices.Insert(index) - continue - } - - obsoleteSlices = append(obsoleteSlices, slice) - } - - if loggerV := logger.V(6); loggerV.Enabled() { - // Dump entire resource information. - loggerV.Info("Syncing existing driver node resource slices with driver resources", "slices", klog.KObjSlice(slices), "resources", driverResources) - } else { - logger.V(5).Info("Syncing existing driver node resource slices with driver resources", "slices", klog.KObjSlice(slices), "numResources", len(driverResources)) - } - - // Update stale slices before removing what's left. - // - // We don't really know which of these slices might have - // been used for "the" driver resource because they don't - // have a unique ID. In practice, a driver is most likely - // to just give us one ResourceModel, in which case - // this isn't a problem at all. If we have more than one, - // then at least conceptually it currently doesn't matter - // where we publish it. - // - // The long-term goal is to move the handling of - // ResourceSlice objects into the driver, with kubelet - // just acting as a REST proxy. The advantage of that will - // be that kubelet won't need to support the same - // resource API version as the driver and the control plane. - // With that approach, the driver will be able to match - // up objects more intelligently. - numObsoleteSlices := len(obsoleteSlices) - for index, resource := range driverResources { - if storedResourceIndices.Has(index) { - // No need to do anything, it is already stored exactly - // like this in an existing slice. - continue - } - - if numObsoleteSlices > 0 { - // Update one existing slice. - slice := obsoleteSlices[numObsoleteSlices-1] - numObsoleteSlices-- - slice = slice.DeepCopy() - slice.ResourceModel = *resource - logger.V(5).Info("Reusing existing node resource slice", "slice", klog.KObj(slice)) - if _, err := c.kubeClient.ResourceV1alpha2().ResourceSlices().Update(ctx, slice, metav1.UpdateOptions{}); err != nil { - return fmt.Errorf("update node resource slice: %w", err) - } - continue - } - - // Although node name and UID are unlikely to change - // we're getting updated node object just to be on the safe side. - // It's a cheap operation as it gets an object from the node informer cache. - node, err := c.getNode() - if err != nil { - return fmt.Errorf("retrieve node object: %w", err) - } - - // Create a new slice. - slice := &resourceapi.ResourceSlice{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: node.Name + "-" + driverName + "-", - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: v1.SchemeGroupVersion.WithKind("Node").Version, - Kind: v1.SchemeGroupVersion.WithKind("Node").Kind, - Name: node.Name, - UID: node.UID, - Controller: ptr.To(true), - }, - }, - }, - NodeName: node.Name, - DriverName: driverName, - ResourceModel: *resource, - } - logger.V(5).Info("Creating new node resource slice", "slice", klog.KObj(slice)) - if _, err := c.kubeClient.ResourceV1alpha2().ResourceSlices().Create(ctx, slice, metav1.CreateOptions{}); err != nil { - return fmt.Errorf("create node resource slice: %w", err) - } - } - - // All remaining slices are truly orphaned. - for i := 0; i < numObsoleteSlices; i++ { - slice := obsoleteSlices[i] - logger.V(5).Info("Deleting obsolete node resource slice", "slice", klog.KObj(slice)) - if err := c.kubeClient.ResourceV1alpha2().ResourceSlices().Delete(ctx, slice.Name, metav1.DeleteOptions{}); err != nil { - return fmt.Errorf("delete node resource slice: %w", err) - } - } - - return nil -} - -func indexOfModel(models []*resourceapi.ResourceModel, model *resourceapi.ResourceModel) int { - for index, m := range models { - if apiequality.Semantic.DeepEqual(m, model) { - return index - } - } - return -1 -} diff --git a/pkg/kubelet/cm/dra/plugin/plugin.go b/pkg/kubelet/cm/dra/plugin/plugin.go index 2d3d0dc547200..9ccd8142f5711 100644 --- a/pkg/kubelet/cm/dra/plugin/plugin.go +++ b/pkg/kubelet/cm/dra/plugin/plugin.go @@ -20,94 +20,126 @@ import ( "context" "errors" "fmt" - "net" "strings" - "sync" "time" - "google.golang.org/grpc" - "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/credentials/insecure" v1 "k8s.io/api/core/v1" + resourceapi "k8s.io/api/resource/v1alpha3" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" utilversion "k8s.io/apimachinery/pkg/util/version" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache" ) -const ( - // DRAPluginName is the name of the in-tree DRA Plugin. - DRAPluginName = "kubernetes.io/dra" - v1alpha3Version = "v1alpha3" -) - -// Plugin is a description of a DRA Plugin, defined by an endpoint. -type plugin struct { - sync.Mutex - conn *grpc.ClientConn - endpoint string - highestSupportedVersion *utilversion.Version - clientTimeout time.Duration -} - -func (p *plugin) getOrCreateGRPCConn() (*grpc.ClientConn, error) { - p.Lock() - defer p.Unlock() - - if p.conn != nil { - return p.conn, nil - } - - network := "unix" - klog.V(4).InfoS(log("creating new gRPC connection"), "protocol", network, "endpoint", p.endpoint) - conn, err := grpc.Dial( - p.endpoint, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithContextDialer(func(ctx context.Context, target string) (net.Conn, error) { - return (&net.Dialer{}).DialContext(ctx, network, target) - }), - ) - if err != nil { - return nil, err - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - defer cancel() - - if ok := conn.WaitForStateChange(ctx, connectivity.Connecting); !ok { - return nil, errors.New("timed out waiting for gRPC connection to be ready") - } - - p.conn = conn - return p.conn, nil -} - // RegistrationHandler is the handler which is fed to the pluginwatcher API. type RegistrationHandler struct { - controller *nodeResourcesController + // backgroundCtx is used for all future activities of the handler. + // This is necessary because it implements APIs which don't + // provide a context. + backgroundCtx context.Context + kubeClient kubernetes.Interface + getNode func() (*v1.Node, error) } +var _ cache.PluginHandler = &RegistrationHandler{} + // NewPluginHandler returns new registration handler. // // Must only be called once per process because it manages global state. // If a kubeClient is provided, then it synchronizes ResourceSlices // with the resource information provided by plugins. func NewRegistrationHandler(kubeClient kubernetes.Interface, getNode func() (*v1.Node, error)) *RegistrationHandler { - handler := &RegistrationHandler{} + handler := &RegistrationHandler{ + // The context and thus logger should come from the caller. + backgroundCtx: klog.NewContext(context.TODO(), klog.LoggerWithName(klog.TODO(), "DRA registration handler")), + kubeClient: kubeClient, + getNode: getNode, + } - // If kubelet ever gets an API for stopping registration handlers, then - // that would need to be hooked up with stopping the controller. - handler.controller = startNodeResourcesController(context.TODO(), kubeClient, getNode) + // When kubelet starts up, no DRA driver has registered yet. None of + // the drivers are usable until they come back, which might not happen + // at all. Therefore it is better to not advertise any local resources + // because pods could get stuck on the node waiting for the driver + // to start up. + // + // This has to run in the background. + go handler.wipeResourceSlices("") return handler } +// wipeResourceSlices deletes ResourceSlices of the node, optionally just for a specific driver. +func (h *RegistrationHandler) wipeResourceSlices(driver string) { + if h.kubeClient == nil { + return + } + ctx := h.backgroundCtx + logger := klog.FromContext(ctx) + + backoff := wait.Backoff{ + Duration: time.Second, + Factor: 2, + Jitter: 0.2, + Cap: 5 * time.Minute, + Steps: 100, + } + + // Error logging is done inside the loop. Context cancellation doesn't get logged. + _ = wait.ExponentialBackoffWithContext(ctx, backoff, func(ctx context.Context) (bool, error) { + node, err := h.getNode() + if apierrors.IsNotFound(err) { + return false, nil + } + if err != nil { + logger.Error(err, "Unexpected error checking for node") + return false, nil + } + fieldSelector := fields.Set{resourceapi.ResourceSliceSelectorNodeName: node.Name} + if driver != "" { + fieldSelector[resourceapi.ResourceSliceSelectorDriver] = driver + } + + err = h.kubeClient.ResourceV1alpha3().ResourceSlices().DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{FieldSelector: fieldSelector.String()}) + switch { + case err == nil: + logger.V(3).Info("Deleted ResourceSlices", "fieldSelector", fieldSelector) + return true, nil + case apierrors.IsUnauthorized(err): + // This can happen while kubelet is still figuring out + // its credentials. + logger.V(5).Info("Deleting ResourceSlice failed, retrying", "fieldSelector", fieldSelector, "err", err) + return false, nil + default: + // Log and retry for other errors. + logger.V(3).Info("Deleting ResourceSlice failed, retrying", "fieldSelector", fieldSelector, "err", err) + return false, nil + } + }) +} + // RegisterPlugin is called when a plugin can be registered. func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, versions []string, pluginClientTimeout *time.Duration) error { - klog.InfoS("Register new DRA plugin", "name", pluginName, "endpoint", endpoint) - - highestSupportedVersion, err := h.validateVersions("RegisterPlugin", pluginName, versions) + // Prepare a context with its own logger for the plugin. + // + // The lifecycle of the plugin's background activities is tied to our + // root context, so canceling that will also cancel the plugin. + // + // The logger injects the plugin name as additional value + // into all log output related to the plugin. + ctx := h.backgroundCtx + logger := klog.FromContext(ctx) + logger = klog.LoggerWithValues(logger, "pluginName", pluginName) + ctx = klog.NewContext(ctx, logger) + + logger.V(3).Info("Register new DRA plugin", "endpoint", endpoint) + + highestSupportedVersion, err := h.validateVersions(pluginName, versions) if err != nil { - return err + return fmt.Errorf("version check of plugin %s failed: %w", pluginName, err) } var timeout time.Duration @@ -117,7 +149,11 @@ func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, timeout = *pluginClientTimeout } - pluginInstance := &plugin{ + ctx, cancel := context.WithCancelCause(ctx) + + pluginInstance := &Plugin{ + backgroundCtx: ctx, + cancel: cancel, conn: nil, endpoint: endpoint, highestSupportedVersion: highestSupportedVersion, @@ -126,40 +162,27 @@ func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, // Storing endpoint of newly registered DRA Plugin into the map, where plugin name will be the key // all other DRA components will be able to get the actual socket of DRA plugins by its name. - // By default we assume the supported plugin version is v1alpha3 - draPlugins.add(pluginName, pluginInstance) - h.controller.addPlugin(pluginName, pluginInstance) + if draPlugins.add(pluginName, pluginInstance) { + logger.V(1).Info("Already registered, previous plugin was replaced") + } return nil } func (h *RegistrationHandler) validateVersions( - callerName string, pluginName string, versions []string, ) (*utilversion.Version, error) { if len(versions) == 0 { - return nil, errors.New( - log( - "%s for DRA plugin %q failed. Plugin returned an empty list for supported versions", - callerName, - pluginName, - ), - ) + return nil, errors.New("empty list for supported versions") } // Validate version newPluginHighestVersion, err := utilversion.HighestSupportedVersion(versions) if err != nil { - return nil, errors.New( - log( - "%s for DRA plugin %q failed. None of the versions specified %q are supported. err=%v", - callerName, - pluginName, - versions, - err, - ), - ) + // HighestSupportedVersion includes the list of versions in its error + // if relevant, no need to repeat it here. + return nil, fmt.Errorf("none of the versions are supported: %w", err) } existingPlugin := draPlugins.get(pluginName) @@ -169,26 +192,26 @@ func (h *RegistrationHandler) validateVersions( if existingPlugin.highestSupportedVersion.LessThan(newPluginHighestVersion) { return newPluginHighestVersion, nil } - return nil, errors.New( - log( - "%s for DRA plugin %q failed. Another plugin with the same name is already registered with a higher supported version: %q", - callerName, - pluginName, - existingPlugin.highestSupportedVersion, - ), - ) -} - -func deregisterPlugin(pluginName string) { - draPlugins.delete(pluginName) + return nil, fmt.Errorf("another plugin instance is already registered with a higher supported version: %q < %q", newPluginHighestVersion, existingPlugin.highestSupportedVersion) } // DeRegisterPlugin is called when a plugin has removed its socket, // signaling it is no longer available. func (h *RegistrationHandler) DeRegisterPlugin(pluginName string) { - klog.InfoS("DeRegister DRA plugin", "name", pluginName) - deregisterPlugin(pluginName) - h.controller.removePlugin(pluginName) + if p := draPlugins.delete(pluginName); p != nil { + logger := klog.FromContext(p.backgroundCtx) + logger.V(3).Info("Deregister DRA plugin", "endpoint", p.endpoint) + + // Clean up the ResourceSlices for the deleted Plugin since it + // may have died without doing so itself and might never come + // back. + go h.wipeResourceSlices(pluginName) + + return + } + + logger := klog.FromContext(h.backgroundCtx) + logger.V(3).Info("Deregister DRA plugin not necessary, was already removed") } // ValidatePlugin is called by kubelet's plugin watcher upon detection @@ -196,15 +219,10 @@ func (h *RegistrationHandler) DeRegisterPlugin(pluginName string) { func (h *RegistrationHandler) ValidatePlugin(pluginName string, endpoint string, versions []string) error { klog.InfoS("Validate DRA plugin", "name", pluginName, "endpoint", endpoint, "versions", strings.Join(versions, ",")) - _, err := h.validateVersions("ValidatePlugin", pluginName, versions) + _, err := h.validateVersions(pluginName, versions) if err != nil { - return fmt.Errorf("validation failed for DRA plugin %s at endpoint %s: %+v", pluginName, endpoint, err) + return fmt.Errorf("invalid versions of plugin %s: %w", pluginName, err) } return err } - -// log prepends log string with `kubernetes.io/dra`. -func log(msg string, parts ...interface{}) string { - return fmt.Sprintf(fmt.Sprintf("%s: %s", DRAPluginName, msg), parts...) -} diff --git a/pkg/kubelet/cm/dra/plugin/plugins_store.go b/pkg/kubelet/cm/dra/plugin/plugins_store.go index aa1449e5913de..e172ac2545b34 100644 --- a/pkg/kubelet/cm/dra/plugin/plugins_store.go +++ b/pkg/kubelet/cm/dra/plugin/plugins_store.go @@ -17,15 +17,14 @@ limitations under the License. package plugin import ( + "errors" "sync" - - "k8s.io/klog/v2" ) // PluginsStore holds a list of DRA Plugins. type pluginsStore struct { sync.RWMutex - store map[string]*plugin + store map[string]*Plugin } // draPlugins map keeps track of all registered DRA plugins on the node @@ -34,7 +33,7 @@ var draPlugins = &pluginsStore{} // Get lets you retrieve a DRA Plugin by name. // This method is protected by a mutex. -func (s *pluginsStore) get(pluginName string) *plugin { +func (s *pluginsStore) get(pluginName string) *Plugin { s.RLock() defer s.RUnlock() @@ -43,26 +42,33 @@ func (s *pluginsStore) get(pluginName string) *plugin { // Set lets you save a DRA Plugin to the list and give it a specific name. // This method is protected by a mutex. -func (s *pluginsStore) add(pluginName string, p *plugin) { +func (s *pluginsStore) add(pluginName string, p *Plugin) (replaced bool) { s.Lock() defer s.Unlock() if s.store == nil { - s.store = make(map[string]*plugin) + s.store = make(map[string]*Plugin) } _, exists := s.store[pluginName] - if exists { - klog.V(1).InfoS(log("plugin: %s already registered, previous plugin will be overridden", pluginName)) - } s.store[pluginName] = p + return exists } // Delete lets you delete a DRA Plugin by name. // This method is protected by a mutex. -func (s *pluginsStore) delete(pluginName string) { +func (s *pluginsStore) delete(pluginName string) *Plugin { s.Lock() defer s.Unlock() + p, exists := s.store[pluginName] + if !exists { + return nil + } + if p.cancel != nil { + p.cancel(errors.New("plugin got removed")) + } delete(s.store, pluginName) + + return p } diff --git a/pkg/kubelet/cm/dra/state/checkpoint.go b/pkg/kubelet/cm/dra/state/checkpoint.go index 7c44f12eea9dd..7cce61181822c 100644 --- a/pkg/kubelet/cm/dra/state/checkpoint.go +++ b/pkg/kubelet/cm/dra/state/checkpoint.go @@ -18,14 +18,9 @@ package state import ( "encoding/json" - "fmt" - "hash/fnv" - "strings" - "k8s.io/apimachinery/pkg/util/dump" "k8s.io/kubernetes/pkg/kubelet/checkpointmanager" "k8s.io/kubernetes/pkg/kubelet/checkpointmanager/checksum" - "k8s.io/kubernetes/pkg/kubelet/checkpointmanager/errors" ) var _ checkpointmanager.Checkpoint = &DRAManagerCheckpoint{} @@ -39,20 +34,9 @@ type DRAManagerCheckpoint struct { Checksum checksum.Checksum `json:"checksum"` } -// DraManagerCheckpoint struct is an old implementation of the DraManagerCheckpoint -type DRAManagerCheckpointWithoutResourceHandles struct { - Version string `json:"version"` - Entries ClaimInfoStateListWithoutResourceHandles `json:"entries,omitempty"` - Checksum checksum.Checksum `json:"checksum"` -} - // List of claim info to store in checkpoint type ClaimInfoStateList []ClaimInfoState -// List of claim info to store in checkpoint -// TODO: remove in Beta -type ClaimInfoStateListWithoutResourceHandles []ClaimInfoStateWithoutResourceHandles - // NewDRAManagerCheckpoint returns an instance of Checkpoint func NewDRAManagerCheckpoint() *DRAManagerCheckpoint { return &DRAManagerCheckpoint{ @@ -79,44 +63,6 @@ func (dc *DRAManagerCheckpoint) VerifyChecksum() error { ck := dc.Checksum dc.Checksum = 0 err := ck.Verify(dc) - if err == errors.ErrCorruptCheckpoint { - // Verify with old structs without ResourceHandles field - // TODO: remove in Beta - err = verifyChecksumWithoutResourceHandles(dc, ck) - } dc.Checksum = ck return err } - -// verifyChecksumWithoutResourceHandles is a helper function that verifies checksum of the -// checkpoint in the old format, without ResourceHandles field. -// TODO: remove in Beta. -func verifyChecksumWithoutResourceHandles(dc *DRAManagerCheckpoint, checkSum checksum.Checksum) error { - entries := ClaimInfoStateListWithoutResourceHandles{} - for _, entry := range dc.Entries { - entries = append(entries, ClaimInfoStateWithoutResourceHandles{ - DriverName: entry.DriverName, - ClassName: entry.ClassName, - ClaimUID: entry.ClaimUID, - ClaimName: entry.ClaimName, - Namespace: entry.Namespace, - PodUIDs: entry.PodUIDs, - CDIDevices: entry.CDIDevices, - }) - } - oldcheckpoint := &DRAManagerCheckpointWithoutResourceHandles{ - Version: checkpointVersion, - Entries: entries, - Checksum: 0, - } - // Calculate checksum for old checkpoint - object := dump.ForHash(oldcheckpoint) - object = strings.Replace(object, "DRAManagerCheckpointWithoutResourceHandles", "DRAManagerCheckpoint", 1) - object = strings.Replace(object, "ClaimInfoStateListWithoutResourceHandles", "ClaimInfoStateList", 1) - hash := fnv.New32a() - fmt.Fprintf(hash, "%v", object) - if checkSum != checksum.Checksum(hash.Sum32()) { - return errors.ErrCorruptCheckpoint - } - return nil -} diff --git a/pkg/kubelet/cm/dra/state/state_checkpoint.go b/pkg/kubelet/cm/dra/state/state_checkpoint.go index a82f6b11bb433..ce20e1ffdf944 100644 --- a/pkg/kubelet/cm/dra/state/state_checkpoint.go +++ b/pkg/kubelet/cm/dra/state/state_checkpoint.go @@ -20,7 +20,6 @@ import ( "fmt" "sync" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/kubernetes/pkg/kubelet/checkpointmanager" @@ -38,12 +37,6 @@ type CheckpointState interface { // ClaimInfoState is used to store claim info state in a checkpoint // +k8s:deepcopy-gen=true type ClaimInfoState struct { - // Name of the DRA driver - DriverName string - - // ClassName is a resource class of the claim - ClassName string - // ClaimUID is an UID of the resource claim ClaimUID types.UID @@ -56,38 +49,25 @@ type ClaimInfoState struct { // PodUIDs is a set of pod UIDs that reference a resource PodUIDs sets.Set[string] - // ResourceHandles is a list of opaque resource data for processing by a specific kubelet plugin - ResourceHandles []resourcev1alpha2.ResourceHandle - - // CDIDevices is a map of DriverName --> CDI devices returned by the - // GRPC API call NodePrepareResource - CDIDevices map[string][]string + // DriverState contains information about all drivers which have allocation + // results in the claim, even if they don't provide devices for their results. + DriverState map[string]DriverState } -// ClaimInfoStateWithoutResourceHandles is an old implementation of the ClaimInfoState -// TODO: remove in Beta -type ClaimInfoStateWithoutResourceHandles struct { - // Name of the DRA driver - DriverName string - - // ClassName is a resource class of the claim - ClassName string - - // ClaimUID is an UID of the resource claim - ClaimUID types.UID - - // ClaimName is a name of the resource claim - ClaimName string - - // Namespace is a claim namespace - Namespace string - - // PodUIDs is a set of pod UIDs that reference a resource - PodUIDs sets.Set[string] +// DriverState is used to store per-device claim info state in a checkpoint +// +k8s:deepcopy-gen=true +type DriverState struct { + Devices []Device +} - // CDIDevices is a map of DriverName --> CDI devices returned by the - // GRPC API call NodePrepareResource - CDIDevices map[string][]string +// Device is how a DRA driver described an allocated device in a claim +// to kubelet. RequestName and CDI device IDs are optional. +// +k8s:deepcopy-gen=true +type Device struct { + PoolName string + DeviceName string + RequestNames []string + CDIDeviceIDs []string } type stateCheckpoint struct { @@ -126,7 +106,7 @@ func (sc *stateCheckpoint) GetOrCreate() (ClaimInfoStateList, error) { return ClaimInfoStateList{}, nil } if err != nil { - return nil, fmt.Errorf("failed to get checkpoint %v: %v", sc.checkpointName, err) + return nil, fmt.Errorf("failed to get checkpoint %v: %w", sc.checkpointName, err) } return checkpoint.Entries, nil diff --git a/pkg/kubelet/cm/dra/state/state_checkpoint_test.go b/pkg/kubelet/cm/dra/state/state_checkpoint_test.go index a5ff86eed17fd..c22cd630ea409 100644 --- a/pkg/kubelet/cm/dra/state/state_checkpoint_test.go +++ b/pkg/kubelet/cm/dra/state/state_checkpoint_test.go @@ -18,13 +18,12 @@ package state import ( "os" - "path" "strings" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/kubernetes/pkg/kubelet/checkpointmanager" testutil "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/testing" @@ -39,7 +38,7 @@ func assertStateEqual(t *testing.T, restoredState, expectedState ClaimInfoStateL // TODO (https://github.com/kubernetes/kubernetes/issues/123552): reconsider what data gets stored in checkpoints and whether that is really necessary. // -// As it stands now, a "v1" checkpoint contains data for types like the resourcev1alpha2.ResourceHandle +// As it stands now, a "v1" checkpoint contains data for types like the resourceapi.ResourceHandle // which may change over time as new fields get added in a backward-compatible way (not unusual // for API types). That breaks checksuming with pkg/util/hash because it is based on spew output. // That output includes those new fields. @@ -52,116 +51,120 @@ func TestCheckpointGetOrCreate(t *testing.T) { expectedState ClaimInfoStateList }{ { - "Create non-existing checkpoint", - "", - "", - []ClaimInfoState{}, + description: "Create non-existing checkpoint", + checkpointContent: "", + expectedError: "", + expectedState: []ClaimInfoState{}, }, { - "Restore checkpoint - single claim", - `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"ResourceHandles":[{"driverName":"test-driver.cdi.k8s.io","data":"{\"a\": \"b\"}"}],"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example"]}}],"checksum":113577689}`, - "", - []ClaimInfoState{ + description: "Restore checkpoint - single claim", + checkpointContent: `{"version":"v1","entries":[{"ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"DriverState":{"test-driver.cdi.k8s.io":{"Devices":[{"PoolName":"worker-1","DeviceName":"dev-1","RequestNames":["test request"],"CDIDeviceIDs":["example.com/example=cdi-example"]}]}}}],"checksum":1925941526}`, + expectedState: []ClaimInfoState{ { - DriverName: "test-driver.cdi.k8s.io", - ClassName: "class-name", - ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", - ClaimName: "example", - Namespace: "default", - PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: "test-driver.cdi.k8s.io", - Data: `{"a": "b"}`, + DriverState: map[string]DriverState{ + "test-driver.cdi.k8s.io": { + Devices: []Device{ + { + PoolName: "worker-1", + DeviceName: "dev-1", + RequestNames: []string{"test request"}, + CDIDeviceIDs: []string{"example.com/example=cdi-example"}, + }, + }, }, }, - CDIDevices: map[string][]string{ - "test-driver.cdi.k8s.io": {"example.com/example=cdi-example"}, - }, + ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", + ClaimName: "example", + Namespace: "default", + PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), }, }, }, { - "Restore checkpoint - single claim - multiple devices", - `{"version":"v1","entries":[{"DriverName":"meta-test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"ResourceHandles":[{"driverName":"test-driver-1.cdi.k8s.io","data":"{\"a\": \"b\"}"},{"driverName":"test-driver-2.cdi.k8s.io","data":"{\"c\": \"d\"}"}],"CDIDevices":{"test-driver-1.cdi.k8s.io":["example-1.com/example-1=cdi-example-1"],"test-driver-2.cdi.k8s.io":["example-2.com/example-2=cdi-example-2"]}}],"checksum":1466990255}`, - "", - []ClaimInfoState{ + description: "Restore checkpoint - single claim - multiple devices", + checkpointContent: `{"version":"v1","entries":[{"ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"DriverState":{"test-driver.cdi.k8s.io":{"Devices":[{"PoolName":"worker-1","DeviceName":"dev-1","RequestNames":["test request"],"CDIDeviceIDs":["example.com/example=cdi-example"]},{"PoolName":"worker-1","DeviceName":"dev-2","RequestNames":["test request2"],"CDIDeviceIDs":["example.com/example=cdi-example2"]}]}}}],"checksum":3560752542}`, + expectedError: "", + expectedState: []ClaimInfoState{ { - DriverName: "meta-test-driver.cdi.k8s.io", - ClassName: "class-name", - ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", - ClaimName: "example", - Namespace: "default", - PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: "test-driver-1.cdi.k8s.io", - Data: `{"a": "b"}`, - }, - { - DriverName: "test-driver-2.cdi.k8s.io", - Data: `{"c": "d"}`, + DriverState: map[string]DriverState{ + "test-driver.cdi.k8s.io": { + Devices: []Device{ + { + PoolName: "worker-1", + DeviceName: "dev-1", + RequestNames: []string{"test request"}, + CDIDeviceIDs: []string{"example.com/example=cdi-example"}, + }, + { + PoolName: "worker-1", + DeviceName: "dev-2", + RequestNames: []string{"test request2"}, + CDIDeviceIDs: []string{"example.com/example=cdi-example2"}, + }, + }, }, }, - CDIDevices: map[string][]string{ - "test-driver-1.cdi.k8s.io": {"example-1.com/example-1=cdi-example-1"}, - "test-driver-2.cdi.k8s.io": {"example-2.com/example-2=cdi-example-2"}, - }, + ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", + ClaimName: "example", + Namespace: "default", + PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), }, }, }, { - "Restore checkpoint - multiple claims", - `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name-1","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example-1","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"ResourceHandles":[{"driverName":"test-driver.cdi.k8s.io","data":"{\"a\": \"b\"}"}],"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example-1"]}},{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name-2","ClaimUID":"4cf8db2d-06c0-7d70-1a51-e59b25b2c16c","ClaimName":"example-2","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"ResourceHandles":[{"driverName":"test-driver.cdi.k8s.io","data":"{\"c\": \"d\"}"}],"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example-2"]}}],"checksum":471181742}`, - "", - []ClaimInfoState{ + description: "Restore checkpoint - multiple claims", + checkpointContent: `{"version":"v1","entries":[{"ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example-1","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"DriverState":{"test-driver.cdi.k8s.io":{"Devices":[{"PoolName":"worker-1","DeviceName":"dev-1","RequestNames":["test request"],"CDIDeviceIDs":["example.com/example=cdi-example"]}]}}},{"ClaimUID":"4cf8db2d-06c0-7d70-1a51-e59b25b2c16c","ClaimName":"example-2","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"DriverState":{"test-driver.cdi.k8s.io":{"Devices":[{"PoolName":"worker-1","DeviceName":"dev-1","RequestNames":["test request"],"CDIDeviceIDs":["example.com/example=cdi-example"]}]}}}],"checksum":351581974}`, + expectedError: "", + expectedState: []ClaimInfoState{ { - DriverName: "test-driver.cdi.k8s.io", - ClassName: "class-name-1", - ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", - ClaimName: "example-1", - Namespace: "default", - PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: "test-driver.cdi.k8s.io", - Data: `{"a": "b"}`, + DriverState: map[string]DriverState{ + "test-driver.cdi.k8s.io": { + Devices: []Device{ + { + PoolName: "worker-1", + DeviceName: "dev-1", + RequestNames: []string{"test request"}, + CDIDeviceIDs: []string{"example.com/example=cdi-example"}, + }, + }, }, }, - CDIDevices: map[string][]string{ - "test-driver.cdi.k8s.io": {"example.com/example=cdi-example-1"}, - }, + ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", + ClaimName: "example-1", + Namespace: "default", + PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), }, { - DriverName: "test-driver.cdi.k8s.io", - ClassName: "class-name-2", - ClaimUID: "4cf8db2d-06c0-7d70-1a51-e59b25b2c16c", - ClaimName: "example-2", - Namespace: "default", - PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: "test-driver.cdi.k8s.io", - Data: `{"c": "d"}`, + DriverState: map[string]DriverState{ + "test-driver.cdi.k8s.io": { + Devices: []Device{ + { + PoolName: "worker-1", + DeviceName: "dev-1", + RequestNames: []string{"test request"}, + CDIDeviceIDs: []string{"example.com/example=cdi-example"}, + }, + }, }, }, - CDIDevices: map[string][]string{ - "test-driver.cdi.k8s.io": {"example.com/example=cdi-example-2"}, - }, + ClaimUID: "4cf8db2d-06c0-7d70-1a51-e59b25b2c16c", + ClaimName: "example-2", + Namespace: "default", + PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), }, }, }, { - "Restore checkpoint - invalid checksum", - `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example"]}}],"checksum":1988120168}`, - "checkpoint is corrupted", - []ClaimInfoState{}, + description: "Restore checkpoint - invalid checksum", + checkpointContent: `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example"]}}],"checksum":1988120168}`, + expectedError: "checkpoint is corrupted", + expectedState: []ClaimInfoState{}, }, { - "Restore checkpoint with invalid JSON", - `{`, - "unexpected end of JSON input", - []ClaimInfoState{}, + description: "Restore checkpoint with invalid JSON", + checkpointContent: `{`, + expectedError: "unexpected end of JSON input", + expectedState: []ClaimInfoState{}, }, } @@ -195,10 +198,9 @@ func TestCheckpointGetOrCreate(t *testing.T) { state, err = checkpointState.GetOrCreate() } if strings.TrimSpace(tc.expectedError) != "" { - assert.Error(t, err) - assert.Contains(t, err.Error(), tc.expectedError) + assert.ErrorContains(t, err, tc.expectedError) } else { - assert.NoError(t, err, "unexpected error while creating checkpointState") + require.NoError(t, err, "unexpected error while creating checkpointState") // compare state after restoration with the one expected assertStateEqual(t, state, tc.expectedState) } @@ -207,25 +209,40 @@ func TestCheckpointGetOrCreate(t *testing.T) { } func TestCheckpointStateStore(t *testing.T) { - claimInfoState := ClaimInfoState{ - DriverName: "test-driver.cdi.k8s.io", - ClassName: "class-name", - ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", - ClaimName: "example", - Namespace: "default", - PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), - ResourceHandles: []resourcev1alpha2.ResourceHandle{ - { - DriverName: "test-driver.cdi.k8s.io", - Data: `{"a": "b"}`, + claimInfoStateList := ClaimInfoStateList{ + { + DriverState: map[string]DriverState{ + "test-driver.cdi.k8s.io": { + Devices: []Device{{ + PoolName: "worker-1", + DeviceName: "dev-1", + RequestNames: []string{"test request"}, + CDIDeviceIDs: []string{"example.com/example=cdi-example"}, + }}, + }, }, + ClaimUID: "067798be-454e-4be4-9047-1aa06aea63f7", + ClaimName: "example-1", + Namespace: "default", + PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), }, - CDIDevices: map[string][]string{ - "test-driver.cdi.k8s.io": {"example.com/example=cdi-example"}, + { + DriverState: map[string]DriverState{ + "test-driver.cdi.k8s.io": { + Devices: []Device{{ + PoolName: "worker-1", + DeviceName: "dev-2", + }}, + }, + }, + ClaimUID: "4cf8db2d-06c0-7d70-1a51-e59b25b2c16c", + ClaimName: "example-2", + Namespace: "default", + PodUIDs: sets.New("139cdb46-f989-4f17-9561-ca10cfb509a6"), }, } - expectedCheckpoint := `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"ResourceHandles":[{"driverName":"test-driver.cdi.k8s.io","data":"{\"a\": \"b\"}"}],"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example"]}}],"checksum":113577689}` + expectedCheckpoint := `{"version":"v1","entries":[{"ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example-1","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"DriverState":{"test-driver.cdi.k8s.io":{"Devices":[{"PoolName":"worker-1","DeviceName":"dev-1","RequestNames":["test request"],"CDIDeviceIDs":["example.com/example=cdi-example"]}]}}},{"ClaimUID":"4cf8db2d-06c0-7d70-1a51-e59b25b2c16c","ClaimName":"example-2","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"DriverState":{"test-driver.cdi.k8s.io":{"Devices":[{"PoolName":"worker-1","DeviceName":"dev-2","RequestNames":null,"CDIDeviceIDs":null}]}}}],"checksum":1191151426}` // Should return an error, stateDir cannot be an empty string if _, err := NewCheckpointState("", testingCheckpoint); err == nil { @@ -245,7 +262,7 @@ func TestCheckpointStateStore(t *testing.T) { cs, err := NewCheckpointState(testingDir, testingCheckpoint) assert.NoError(t, err, "could not create testing checkpointState instance") - err = cs.Store(ClaimInfoStateList{claimInfoState}) + err = cs.Store(claimInfoStateList) assert.NoError(t, err, "could not store ClaimInfoState") checkpoint := NewDRAManagerCheckpoint() cpm.GetCheckpoint(testingCheckpoint, checkpoint) @@ -258,23 +275,3 @@ func TestCheckpointStateStore(t *testing.T) { t.Fatal("expected error but got nil") } } - -func TestOldCheckpointRestore(t *testing.T) { - testingDir := t.TempDir() - cpm, err := checkpointmanager.NewCheckpointManager(testingDir) - assert.NoError(t, err, "could not create testing checkpoint manager") - - oldCheckpointData := `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example"]}}],"checksum":153446146}` - err = os.WriteFile(path.Join(testingDir, testingCheckpoint), []byte(oldCheckpointData), 0644) - assert.NoError(t, err, "could not store checkpoint data") - - checkpoint := NewDRAManagerCheckpoint() - err = cpm.GetCheckpoint(testingCheckpoint, checkpoint) - assert.NoError(t, err, "could not restore checkpoint") - - checkpointData, err := checkpoint.MarshalCheckpoint() - assert.NoError(t, err, "could not Marshal Checkpoint") - - expectedData := `{"version":"v1","entries":[{"DriverName":"test-driver.cdi.k8s.io","ClassName":"class-name","ClaimUID":"067798be-454e-4be4-9047-1aa06aea63f7","ClaimName":"example","Namespace":"default","PodUIDs":{"139cdb46-f989-4f17-9561-ca10cfb509a6":{}},"ResourceHandles":null,"CDIDevices":{"test-driver.cdi.k8s.io":["example.com/example=cdi-example"]}}],"checksum":453625682}` - assert.Equal(t, expectedData, string(checkpointData), "expected ClaimInfoState does not equal to restored one") -} diff --git a/pkg/kubelet/cm/dra/state/zz_generated.deepcopy.go b/pkg/kubelet/cm/dra/state/zz_generated.deepcopy.go index d27ecf6088351..6489dab7a513f 100644 --- a/pkg/kubelet/cm/dra/state/zz_generated.deepcopy.go +++ b/pkg/kubelet/cm/dra/state/zz_generated.deepcopy.go @@ -22,7 +22,6 @@ limitations under the License. package state import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" sets "k8s.io/apimachinery/pkg/util/sets" ) @@ -36,26 +35,11 @@ func (in *ClaimInfoState) DeepCopyInto(out *ClaimInfoState) { (*out)[key] = val } } - if in.ResourceHandles != nil { - in, out := &in.ResourceHandles, &out.ResourceHandles - *out = make([]v1alpha2.ResourceHandle, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.CDIDevices != nil { - in, out := &in.CDIDevices, &out.CDIDevices - *out = make(map[string][]string, len(*in)) + if in.DriverState != nil { + in, out := &in.DriverState, &out.DriverState + *out = make(map[string]DriverState, len(*in)) for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = make([]string, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal + (*out)[key] = *val.DeepCopy() } } return @@ -70,3 +54,52 @@ func (in *ClaimInfoState) DeepCopy() *ClaimInfoState { 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 + if in.RequestNames != nil { + in, out := &in.RequestNames, &out.RequestNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.CDIDeviceIDs != nil { + in, out := &in.CDIDeviceIDs, &out.CDIDeviceIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device. +func (in *Device) DeepCopy() *Device { + if in == nil { + return nil + } + out := new(Device) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DriverState) DeepCopyInto(out *DriverState) { + *out = *in + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]Device, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverState. +func (in *DriverState) DeepCopy() *DriverState { + if in == nil { + return nil + } + out := new(DriverState) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/kubelet/cm/dra/types.go b/pkg/kubelet/cm/dra/types.go index e009e952eb45b..6b37d5039b521 100644 --- a/pkg/kubelet/cm/dra/types.go +++ b/pkg/kubelet/cm/dra/types.go @@ -50,8 +50,6 @@ type Manager interface { // ContainerInfo contains information required by the runtime to consume prepared resources. type ContainerInfo struct { - // The Annotations for the container - Annotations []kubecontainer.Annotation // CDI Devices for the container CDIDevices []kubecontainer.CDIDevice } diff --git a/pkg/kubelet/cm/dra/zz_generated.deepcopy.go b/pkg/kubelet/cm/dra/zz_generated.deepcopy.go index cc10fdaf53efa..577fd431881ab 100644 --- a/pkg/kubelet/cm/dra/zz_generated.deepcopy.go +++ b/pkg/kubelet/cm/dra/zz_generated.deepcopy.go @@ -21,29 +21,10 @@ limitations under the License. package dra -import ( - container "k8s.io/kubernetes/pkg/kubelet/container" -) - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClaimInfo) DeepCopyInto(out *ClaimInfo) { *out = *in in.ClaimInfoState.DeepCopyInto(&out.ClaimInfoState) - if in.annotations != nil { - in, out := &in.annotations, &out.annotations - *out = make(map[string][]container.Annotation, len(*in)) - for key, val := range *in { - var outVal []container.Annotation - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = make([]container.Annotation, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } return } diff --git a/pkg/kubelet/container/runtime.go b/pkg/kubelet/container/runtime.go index b6c4ff6624d18..89121b0505b86 100644 --- a/pkg/kubelet/container/runtime.go +++ b/pkg/kubelet/container/runtime.go @@ -492,7 +492,8 @@ type DeviceInfo struct { // CDIDevice contains information about CDI device type CDIDevice struct { - // Name is a fully qualified device name + // Name is a fully qualified device name according to + // https://github.com/cncf-tags/container-device-interface/blob/e66544063aa7760c4ea6330ce9e6c757f8e61df2/README.md?plain=1#L9-L15 Name string } diff --git a/pkg/printers/internalversion/printers.go b/pkg/printers/internalversion/printers.go index e52a427cb14e2..4e64e2539c9e7 100644 --- a/pkg/printers/internalversion/printers.go +++ b/pkg/printers/internalversion/printers.go @@ -40,7 +40,7 @@ import ( flowcontrolv1 "k8s.io/api/flowcontrol/v1" networkingv1beta1 "k8s.io/api/networking/v1beta1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" @@ -623,18 +623,15 @@ func AddHandlers(h printers.PrintHandler) { } _ = h.TableHandler(scaleColumnDefinitions, printScale) - resourceClassColumnDefinitions := []metav1.TableColumnDefinition{ + deviceClassColumnDefinitions := []metav1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "DriverName", Type: "string", Description: resourcev1alpha2.ResourceClass{}.SwaggerDoc()["driverName"]}, {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, } - _ = h.TableHandler(resourceClassColumnDefinitions, printResourceClass) - _ = h.TableHandler(resourceClassColumnDefinitions, printResourceClassList) + _ = h.TableHandler(deviceClassColumnDefinitions, printDeviceClass) + _ = h.TableHandler(deviceClassColumnDefinitions, printDeviceClassList) resourceClaimColumnDefinitions := []metav1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "ResourceClassName", Type: "string", Description: resourcev1alpha2.ResourceClaimSpec{}.SwaggerDoc()["resourceClassName"]}, - {Name: "AllocationMode", Type: "string", Description: resourcev1alpha2.ResourceClaimSpec{}.SwaggerDoc()["allocationMode"]}, {Name: "State", Type: "string", Description: "A summary of the current state (allocated, pending, reserved, etc.)."}, {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, } @@ -643,8 +640,6 @@ func AddHandlers(h printers.PrintHandler) { resourceClaimTemplateColumnDefinitions := []metav1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "ResourceClassName", Type: "string", Description: resourcev1alpha2.ResourceClaimSpec{}.SwaggerDoc()["resourceClassName"]}, - {Name: "AllocationMode", Type: "string", Description: resourcev1alpha2.ResourceClaimSpec{}.SwaggerDoc()["allocationMode"]}, {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, } _ = h.TableHandler(resourceClaimTemplateColumnDefinitions, printResourceClaimTemplate) @@ -652,36 +647,21 @@ func AddHandlers(h printers.PrintHandler) { podSchedulingCtxColumnDefinitions := []metav1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "SelectedNode", Type: "string", Description: resourcev1alpha2.PodSchedulingContextSpec{}.SwaggerDoc()["selectedNode"]}, + {Name: "SelectedNode", Type: "string", Description: resourceapi.PodSchedulingContextSpec{}.SwaggerDoc()["selectedNode"]}, {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, } _ = h.TableHandler(podSchedulingCtxColumnDefinitions, printPodSchedulingContext) _ = h.TableHandler(podSchedulingCtxColumnDefinitions, printPodSchedulingContextList) - resourceClaimParametersColumnDefinitions := []metav1.TableColumnDefinition{ + nodeResourceSliceColumnDefinitions := []metav1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "GeneratedFrom", Type: "string", Description: resourcev1alpha2.ResourceClaimParameters{}.SwaggerDoc()["generatedFrom"]}, + {Name: "Node", Type: "string", Description: resourceapi.ResourceSliceSpec{}.SwaggerDoc()["nodeName"]}, + {Name: "Driver", Type: "string", Description: resourceapi.ResourceSliceSpec{}.SwaggerDoc()["driver"]}, + {Name: "Pool", Type: "string", Description: resourceapi.ResourcePool{}.SwaggerDoc()["name"]}, {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, } - _ = h.TableHandler(resourceClaimParametersColumnDefinitions, printResourceClaimParameters) - _ = h.TableHandler(resourceClaimParametersColumnDefinitions, printResourceClaimParametersList) - - resourceClassParametersColumnDefinitions := []metav1.TableColumnDefinition{ - {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "GeneratedFrom", Type: "string", Description: resourcev1alpha2.ResourceClassParameters{}.SwaggerDoc()["generatedFrom"]}, - {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, - } - _ = h.TableHandler(resourceClassParametersColumnDefinitions, printResourceClassParameters) - _ = h.TableHandler(resourceClassParametersColumnDefinitions, printResourceClassParametersList) - - nodeResourceCapacityColumnDefinitions := []metav1.TableColumnDefinition{ - {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, - {Name: "Node", Type: "string", Description: resourcev1alpha2.ResourceSlice{}.SwaggerDoc()["nodeName"]}, - {Name: "Driver", Type: "string", Description: resourcev1alpha2.ResourceSlice{}.SwaggerDoc()["driverName"]}, - {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, - } - _ = h.TableHandler(nodeResourceCapacityColumnDefinitions, printResourceSlice) - _ = h.TableHandler(nodeResourceCapacityColumnDefinitions, printResourceSliceList) + _ = h.TableHandler(nodeResourceSliceColumnDefinitions, printResourceSlice) + _ = h.TableHandler(nodeResourceSliceColumnDefinitions, printResourceSliceList) serviceCIDRColumnDefinitions := []metav1.TableColumnDefinition{ {Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, @@ -2981,19 +2961,19 @@ func printScale(obj *autoscaling.Scale, options printers.GenerateOptions) ([]met return []metav1.TableRow{row}, nil } -func printResourceClass(obj *resource.ResourceClass, options printers.GenerateOptions) ([]metav1.TableRow, error) { +func printDeviceClass(obj *resource.DeviceClass, options printers.GenerateOptions) ([]metav1.TableRow, error) { row := metav1.TableRow{ Object: runtime.RawExtension{Object: obj}, } - row.Cells = append(row.Cells, obj.Name, obj.DriverName, translateTimestampSince(obj.CreationTimestamp)) + row.Cells = append(row.Cells, obj.Name, translateTimestampSince(obj.CreationTimestamp)) return []metav1.TableRow{row}, nil } -func printResourceClassList(list *resource.ResourceClassList, options printers.GenerateOptions) ([]metav1.TableRow, error) { +func printDeviceClassList(list *resource.DeviceClassList, options printers.GenerateOptions) ([]metav1.TableRow, error) { rows := make([]metav1.TableRow, 0, len(list.Items)) for i := range list.Items { - r, err := printResourceClass(&list.Items[i], options) + r, err := printDeviceClass(&list.Items[i], options) if err != nil { return nil, err } @@ -3006,7 +2986,7 @@ func printResourceClaim(obj *resource.ResourceClaim, options printers.GenerateOp row := metav1.TableRow{ Object: runtime.RawExtension{Object: obj}, } - row.Cells = append(row.Cells, obj.Name, obj.Spec.ResourceClassName, string(obj.Spec.AllocationMode), resourceClaimState(obj), translateTimestampSince(obj.CreationTimestamp)) + row.Cells = append(row.Cells, obj.Name, resourceClaimState(obj), translateTimestampSince(obj.CreationTimestamp)) return []metav1.TableRow{row}, nil } @@ -3047,7 +3027,7 @@ func printResourceClaimTemplate(obj *resource.ResourceClaimTemplate, options pri row := metav1.TableRow{ Object: runtime.RawExtension{Object: obj}, } - row.Cells = append(row.Cells, obj.Name, obj.Spec.Spec.ResourceClassName, string(obj.Spec.Spec.AllocationMode), translateTimestampSince(obj.CreationTimestamp)) + row.Cells = append(row.Cells, obj.Name, translateTimestampSince(obj.CreationTimestamp)) return []metav1.TableRow{row}, nil } @@ -3085,61 +3065,11 @@ func printPodSchedulingContextList(list *resource.PodSchedulingContextList, opti return rows, nil } -func printResourceClaimParameters(obj *resource.ResourceClaimParameters, options printers.GenerateOptions) ([]metav1.TableRow, error) { - row := metav1.TableRow{ - Object: runtime.RawExtension{Object: obj}, - } - generatedFrom := "" - if obj.GeneratedFrom != nil { - generatedFrom = fmt.Sprintf("%s.%s %s", obj.GeneratedFrom.Kind, obj.GeneratedFrom.APIGroup, obj.GeneratedFrom.Name) - } - row.Cells = append(row.Cells, obj.Name, generatedFrom, translateTimestampSince(obj.CreationTimestamp)) - - return []metav1.TableRow{row}, nil -} - -func printResourceClaimParametersList(list *resource.ResourceClaimParametersList, options printers.GenerateOptions) ([]metav1.TableRow, error) { - rows := make([]metav1.TableRow, 0, len(list.Items)) - for i := range list.Items { - r, err := printResourceClaimParameters(&list.Items[i], options) - if err != nil { - return nil, err - } - rows = append(rows, r...) - } - return rows, nil -} - -func printResourceClassParameters(obj *resource.ResourceClassParameters, options printers.GenerateOptions) ([]metav1.TableRow, error) { - row := metav1.TableRow{ - Object: runtime.RawExtension{Object: obj}, - } - generatedFrom := "" - if obj.GeneratedFrom != nil { - generatedFrom = fmt.Sprintf("%s.%s %s", obj.GeneratedFrom.Kind, obj.GeneratedFrom.APIGroup, obj.GeneratedFrom.Name) - } - row.Cells = append(row.Cells, obj.Name, generatedFrom, translateTimestampSince(obj.CreationTimestamp)) - - return []metav1.TableRow{row}, nil -} - -func printResourceClassParametersList(list *resource.ResourceClassParametersList, options printers.GenerateOptions) ([]metav1.TableRow, error) { - rows := make([]metav1.TableRow, 0, len(list.Items)) - for i := range list.Items { - r, err := printResourceClassParameters(&list.Items[i], options) - if err != nil { - return nil, err - } - rows = append(rows, r...) - } - return rows, nil -} - func printResourceSlice(obj *resource.ResourceSlice, options printers.GenerateOptions) ([]metav1.TableRow, error) { row := metav1.TableRow{ Object: runtime.RawExtension{Object: obj}, } - row.Cells = append(row.Cells, obj.Name, obj.NodeName, obj.DriverName, translateTimestampSince(obj.CreationTimestamp)) + row.Cells = append(row.Cells, obj.Name, obj.Spec.NodeName, obj.Spec.Driver, obj.Spec.Pool.Name, translateTimestampSince(obj.CreationTimestamp)) return []metav1.TableRow{row}, nil } diff --git a/pkg/registry/resource/resourceclass/storage/storage.go b/pkg/registry/resource/deviceclass/storage/storage.go similarity index 75% rename from pkg/registry/resource/resourceclass/storage/storage.go rename to pkg/registry/resource/deviceclass/storage/storage.go index ad7d283b954af..875d61e018f18 100644 --- a/pkg/registry/resource/resourceclass/storage/storage.go +++ b/pkg/registry/resource/deviceclass/storage/storage.go @@ -24,25 +24,25 @@ import ( "k8s.io/kubernetes/pkg/printers" printersinternal "k8s.io/kubernetes/pkg/printers/internalversion" printerstorage "k8s.io/kubernetes/pkg/printers/storage" - "k8s.io/kubernetes/pkg/registry/resource/resourceclass" + "k8s.io/kubernetes/pkg/registry/resource/deviceclass" ) -// REST implements a RESTStorage for ResourceClass. +// REST implements a RESTStorage for DeviceClass. type REST struct { *genericregistry.Store } -// NewREST returns a RESTStorage object that will work against ResourceClass. +// NewREST returns a RESTStorage object that will work against DeviceClass. func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) { store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &resource.ResourceClass{} }, - NewListFunc: func() runtime.Object { return &resource.ResourceClassList{} }, - DefaultQualifiedResource: resource.Resource("resourceclasses"), - SingularQualifiedResource: resource.Resource("resourceclass"), - - CreateStrategy: resourceclass.Strategy, - UpdateStrategy: resourceclass.Strategy, - DeleteStrategy: resourceclass.Strategy, + NewFunc: func() runtime.Object { return &resource.DeviceClass{} }, + NewListFunc: func() runtime.Object { return &resource.DeviceClassList{} }, + DefaultQualifiedResource: resource.Resource("deviceclasses"), + SingularQualifiedResource: resource.Resource("deviceclass"), + + CreateStrategy: deviceclass.Strategy, + UpdateStrategy: deviceclass.Strategy, + DeleteStrategy: deviceclass.Strategy, ReturnDeletedObject: true, TableConvertor: printerstorage.TableConvertor{TableGenerator: printers.NewTableGenerator().With(printersinternal.AddHandlers)}, diff --git a/pkg/registry/resource/resourceclass/storage/storage_test.go b/pkg/registry/resource/deviceclass/storage/storage_test.go similarity index 83% rename from pkg/registry/resource/resourceclass/storage/storage_test.go rename to pkg/registry/resource/deviceclass/storage/storage_test.go index 817623e7acc80..01962571c010e 100644 --- a/pkg/registry/resource/resourceclass/storage/storage_test.go +++ b/pkg/registry/resource/deviceclass/storage/storage_test.go @@ -37,21 +37,20 @@ func newStorage(t *testing.T) (*REST, *etcd3testing.EtcdTestServer) { StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, - ResourcePrefix: "resourceclasses", + ResourcePrefix: "deviceclasses", } - resourceClassStorage, err := NewREST(restOptions) + deviceClassStorage, err := NewREST(restOptions) if err != nil { t.Fatalf("unexpected error from REST storage: %v", err) } - return resourceClassStorage, server + return deviceClassStorage, server } -func validNewClass(name string) *resource.ResourceClass { - return &resource.ResourceClass{ +func validNewClass(name string) *resource.DeviceClass { + return &resource.DeviceClass{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - DriverName: "cdi.example.com", } } @@ -60,13 +59,13 @@ func TestCreate(t *testing.T) { defer server.Terminate(t) defer storage.Store.DestroyFunc() test := genericregistrytest.New(t, storage.Store).ClusterScope() - resourceClass := validNewClass("foo") - resourceClass.ObjectMeta = metav1.ObjectMeta{GenerateName: "foo"} + deviceClass := validNewClass("foo") + deviceClass.ObjectMeta = metav1.ObjectMeta{GenerateName: "foo"} test.TestCreate( // valid - resourceClass, + deviceClass, // invalid - &resource.ResourceClass{ + &resource.DeviceClass{ ObjectMeta: metav1.ObjectMeta{Name: "*BadName!"}, }, ) @@ -82,14 +81,22 @@ func TestUpdate(t *testing.T) { validNewClass("foo"), // updateFunc func(obj runtime.Object) runtime.Object { - object := obj.(*resource.ResourceClass) - object.ParametersRef = &resource.ResourceClassParametersReference{Kind: "cdiexample", Name: "some-name"} + object := obj.(*resource.DeviceClass) + object.Spec.Selectors = []resource.DeviceSelector{{ + CEL: &resource.CELDeviceSelector{ + Expression: "true", + }, + }} return object }, //invalid update func(obj runtime.Object) runtime.Object { - object := obj.(*resource.ResourceClass) - object.DriverName = "" + object := obj.(*resource.DeviceClass) + object.Spec.Selectors = []resource.DeviceSelector{{ + CEL: &resource.CELDeviceSelector{ + Expression: "?!#$", + }, + }} return object }, ) diff --git a/pkg/registry/resource/deviceclass/strategy.go b/pkg/registry/resource/deviceclass/strategy.go new file mode 100644 index 0000000000000..fc6d3a38b6638 --- /dev/null +++ b/pkg/registry/resource/deviceclass/strategy.go @@ -0,0 +1,85 @@ +/* +Copyright 2024 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. +*/ + +package deviceclass + +import ( + "context" + + apiequality "k8s.io/apimachinery/pkg/api/equality" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/apiserver/pkg/storage/names" + "k8s.io/kubernetes/pkg/api/legacyscheme" + "k8s.io/kubernetes/pkg/apis/resource" + "k8s.io/kubernetes/pkg/apis/resource/validation" +) + +// deviceClassStrategy implements behavior for DeviceClass objects +type deviceClassStrategy struct { + runtime.ObjectTyper + names.NameGenerator +} + +var Strategy = deviceClassStrategy{legacyscheme.Scheme, names.SimpleNameGenerator} + +func (deviceClassStrategy) NamespaceScoped() bool { + return false +} + +func (deviceClassStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { + class := obj.(*resource.DeviceClass) + class.Generation = 1 +} + +func (deviceClassStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { + deviceClass := obj.(*resource.DeviceClass) + return validation.ValidateDeviceClass(deviceClass) +} + +func (deviceClassStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { + return nil +} + +func (deviceClassStrategy) Canonicalize(obj runtime.Object) { +} + +func (deviceClassStrategy) AllowCreateOnUpdate() bool { + return false +} + +func (deviceClassStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { + class := obj.(*resource.DeviceClass) + oldClass := old.(*resource.DeviceClass) + + // Any changes to the spec increment the generation number. + if !apiequality.Semantic.DeepEqual(oldClass.Spec, class.Spec) { + class.Generation = oldClass.Generation + 1 + } +} + +func (deviceClassStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { + errorList := validation.ValidateDeviceClass(obj.(*resource.DeviceClass)) + return append(errorList, validation.ValidateDeviceClassUpdate(obj.(*resource.DeviceClass), old.(*resource.DeviceClass))...) +} + +func (deviceClassStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { + return nil +} + +func (deviceClassStrategy) AllowUnconditionalUpdate() bool { + return true +} diff --git a/pkg/registry/resource/resourceclass/strategy_test.go b/pkg/registry/resource/deviceclass/strategy_test.go similarity index 67% rename from pkg/registry/resource/resourceclass/strategy_test.go rename to pkg/registry/resource/deviceclass/strategy_test.go index d55f806676924..468b11eac69d8 100644 --- a/pkg/registry/resource/resourceclass/strategy_test.go +++ b/pkg/registry/resource/deviceclass/strategy_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package resourceclass +package deviceclass import ( "testing" @@ -24,28 +24,27 @@ import ( "k8s.io/kubernetes/pkg/apis/resource" ) -var resourceClass = &resource.ResourceClass{ +var deviceClass = &resource.DeviceClass{ ObjectMeta: metav1.ObjectMeta{ Name: "valid-class", }, - DriverName: "resource-driver.example.com", } func TestClassStrategy(t *testing.T) { if Strategy.NamespaceScoped() { - t.Errorf("ResourceClass must not be namespace scoped") + t.Errorf("DeviceClass must not be namespace scoped") } if Strategy.AllowCreateOnUpdate() { - t.Errorf("ResourceClass should not allow create on update") + t.Errorf("DeviceClass should not allow create on update") } } func TestClassStrategyCreate(t *testing.T) { ctx := genericapirequest.NewDefaultContext() - resourceClass := resourceClass.DeepCopy() + deviceClass := deviceClass.DeepCopy() - Strategy.PrepareForCreate(ctx, resourceClass) - errs := Strategy.Validate(ctx, resourceClass) + Strategy.PrepareForCreate(ctx, deviceClass) + errs := Strategy.Validate(ctx, deviceClass) if len(errs) != 0 { t.Errorf("unexpected error validating for create %v", errs) } @@ -54,12 +53,12 @@ func TestClassStrategyCreate(t *testing.T) { func TestClassStrategyUpdate(t *testing.T) { t.Run("no-changes-okay", func(t *testing.T) { ctx := genericapirequest.NewDefaultContext() - resourceClass := resourceClass.DeepCopy() - newClass := resourceClass.DeepCopy() + deviceClass := deviceClass.DeepCopy() + newClass := deviceClass.DeepCopy() newClass.ResourceVersion = "4" - Strategy.PrepareForUpdate(ctx, newClass, resourceClass) - errs := Strategy.ValidateUpdate(ctx, newClass, resourceClass) + Strategy.PrepareForUpdate(ctx, newClass, deviceClass) + errs := Strategy.ValidateUpdate(ctx, newClass, deviceClass) if len(errs) != 0 { t.Errorf("unexpected validation errors: %v", errs) } @@ -67,13 +66,13 @@ func TestClassStrategyUpdate(t *testing.T) { t.Run("name-change-not-allowed", func(t *testing.T) { ctx := genericapirequest.NewDefaultContext() - resourceClass := resourceClass.DeepCopy() - newClass := resourceClass.DeepCopy() + deviceClass := deviceClass.DeepCopy() + newClass := deviceClass.DeepCopy() newClass.Name = "valid-class-2" newClass.ResourceVersion = "4" - Strategy.PrepareForUpdate(ctx, newClass, resourceClass) - errs := Strategy.ValidateUpdate(ctx, newClass, resourceClass) + Strategy.PrepareForUpdate(ctx, newClass, deviceClass) + errs := Strategy.ValidateUpdate(ctx, newClass, deviceClass) if len(errs) == 0 { t.Errorf("expected a validation error") } diff --git a/pkg/registry/resource/podschedulingcontext/strategy.go b/pkg/registry/resource/podschedulingcontext/strategy.go index 16d23baf628c2..5e26cafb47b6f 100644 --- a/pkg/registry/resource/podschedulingcontext/strategy.go +++ b/pkg/registry/resource/podschedulingcontext/strategy.go @@ -53,7 +53,7 @@ func (podSchedulingStrategy) NamespaceScoped() bool { // status. func (podSchedulingStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { fields := map[fieldpath.APIVersion]*fieldpath.Set{ - "resource.k8s.io/v1alpha2": fieldpath.NewSet( + "resource.k8s.io/v1alpha3": fieldpath.NewSet( fieldpath.MakePathOrDie("status"), ), } @@ -114,7 +114,7 @@ var StatusStrategy = podSchedulingStatusStrategy{Strategy} // should not be modified by the user. For a status update that is the spec. func (podSchedulingStatusStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { fields := map[fieldpath.APIVersion]*fieldpath.Set{ - "resource.k8s.io/v1alpha2": fieldpath.NewSet( + "resource.k8s.io/v1alpha3": fieldpath.NewSet( fieldpath.MakePathOrDie("spec"), ), } diff --git a/pkg/registry/resource/resourceclaim/storage/storage_test.go b/pkg/registry/resource/resourceclaim/storage/storage_test.go index 613d3c80467b7..031aa8c95e763 100644 --- a/pkg/registry/resource/resourceclaim/storage/storage_test.go +++ b/pkg/registry/resource/resourceclaim/storage/storage_test.go @@ -56,11 +56,6 @@ func validNewClaim(name, ns string) *resource.ResourceClaim { Name: name, Namespace: ns, }, - Spec: resource.ResourceClaimSpec{ - ResourceClassName: "example", - AllocationMode: resource.AllocationModeImmediate, - }, - Status: resource.ResourceClaimStatus{}, } return claim } @@ -99,6 +94,12 @@ func TestUpdate(t *testing.T) { object.Labels["foo"] = "bar" return object }, + // invalid update + func(obj runtime.Object) runtime.Object { + object := obj.(*resource.ResourceClaim) + object.Name = "^%$#@#%" + return object + }, ) } @@ -164,7 +165,6 @@ func TestUpdateStatus(t *testing.T) { } claim := claimStart.DeepCopy() - claim.Status.DriverName = "some-driver.example.com" claim.Status.Allocation = &resource.AllocationResult{} _, _, err = statusStorage.Update(ctx, claim.Name, rest.DefaultUpdatedObjectInfo(claim), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}) if err != nil { diff --git a/pkg/registry/resource/resourceclaim/strategy.go b/pkg/registry/resource/resourceclaim/strategy.go index 75f4c7be73ca8..f2a9eb821846a 100644 --- a/pkg/registry/resource/resourceclaim/strategy.go +++ b/pkg/registry/resource/resourceclaim/strategy.go @@ -53,7 +53,7 @@ func (resourceclaimStrategy) NamespaceScoped() bool { // status. func (resourceclaimStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { fields := map[fieldpath.APIVersion]*fieldpath.Set{ - "resource.k8s.io/v1alpha2": fieldpath.NewSet( + "resource.k8s.io/v1alpha3": fieldpath.NewSet( fieldpath.MakePathOrDie("status"), ), } @@ -69,7 +69,7 @@ func (resourceclaimStrategy) PrepareForCreate(ctx context.Context, obj runtime.O func (resourceclaimStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { claim := obj.(*resource.ResourceClaim) - return validation.ValidateClaim(claim) + return validation.ValidateResourceClaim(claim) } func (resourceclaimStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { @@ -92,8 +92,8 @@ func (resourceclaimStrategy) PrepareForUpdate(ctx context.Context, obj, old runt func (resourceclaimStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { newClaim := obj.(*resource.ResourceClaim) oldClaim := old.(*resource.ResourceClaim) - errorList := validation.ValidateClaim(newClaim) - return append(errorList, validation.ValidateClaimUpdate(newClaim, oldClaim)...) + errorList := validation.ValidateResourceClaim(newClaim) + return append(errorList, validation.ValidateResourceClaimUpdate(newClaim, oldClaim)...) } func (resourceclaimStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { @@ -114,7 +114,7 @@ var StatusStrategy = resourceclaimStatusStrategy{Strategy} // should not be modified by the user. For a status update that is the spec. func (resourceclaimStatusStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { fields := map[fieldpath.APIVersion]*fieldpath.Set{ - "resource.k8s.io/v1alpha2": fieldpath.NewSet( + "resource.k8s.io/v1alpha3": fieldpath.NewSet( fieldpath.MakePathOrDie("spec"), ), } @@ -132,7 +132,7 @@ func (resourceclaimStatusStrategy) PrepareForUpdate(ctx context.Context, obj, ol func (resourceclaimStatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { newClaim := obj.(*resource.ResourceClaim) oldClaim := old.(*resource.ResourceClaim) - return validation.ValidateClaimStatusUpdate(newClaim, oldClaim) + return validation.ValidateResourceClaimStatusUpdate(newClaim, oldClaim) } // WarningsOnUpdate returns warnings for the given update. diff --git a/pkg/registry/resource/resourceclaim/strategy_test.go b/pkg/registry/resource/resourceclaim/strategy_test.go index d4091893b5b2e..8b2d8c3e7139e 100644 --- a/pkg/registry/resource/resourceclaim/strategy_test.go +++ b/pkg/registry/resource/resourceclaim/strategy_test.go @@ -29,10 +29,6 @@ var resourceClaim = &resource.ResourceClaim{ Name: "valid-claim", Namespace: "default", }, - Spec: resource.ResourceClaimSpec{ - ResourceClassName: "valid-class", - AllocationMode: resource.AllocationModeImmediate, - }, } func TestClaimStrategy(t *testing.T) { diff --git a/pkg/registry/resource/resourceclaimparameters/storage/storage.go b/pkg/registry/resource/resourceclaimparameters/storage/storage.go deleted file mode 100644 index 820411fede946..0000000000000 --- a/pkg/registry/resource/resourceclaimparameters/storage/storage.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package storage - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/kubernetes/pkg/printers" - printersinternal "k8s.io/kubernetes/pkg/printers/internalversion" - printerstorage "k8s.io/kubernetes/pkg/printers/storage" - "k8s.io/kubernetes/pkg/registry/resource/resourceclaimparameters" -) - -// REST implements a RESTStorage for ResourceClaimParameters. -type REST struct { - *genericregistry.Store -} - -// NewREST returns a RESTStorage object that will work against ResourceClaimParameters. -func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) { - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &resource.ResourceClaimParameters{} }, - NewListFunc: func() runtime.Object { return &resource.ResourceClaimParametersList{} }, - PredicateFunc: resourceclaimparameters.Match, - DefaultQualifiedResource: resource.Resource("resourceclaimparameters"), - SingularQualifiedResource: resource.Resource("resourceclaimparameters"), - - CreateStrategy: resourceclaimparameters.Strategy, - UpdateStrategy: resourceclaimparameters.Strategy, - DeleteStrategy: resourceclaimparameters.Strategy, - ReturnDeletedObject: true, - - TableConvertor: printerstorage.TableConvertor{TableGenerator: printers.NewTableGenerator().With(printersinternal.AddHandlers)}, - } - options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: resourceclaimparameters.GetAttrs} - if err := store.CompleteWithOptions(options); err != nil { - return nil, err - } - - return &REST{store}, nil -} diff --git a/pkg/registry/resource/resourceclaimparameters/storage/storage_test.go b/pkg/registry/resource/resourceclaimparameters/storage/storage_test.go deleted file mode 100644 index c5ff63e9d5ff1..0000000000000 --- a/pkg/registry/resource/resourceclaimparameters/storage/storage_test.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package storage - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - genericregistrytest "k8s.io/apiserver/pkg/registry/generic/testing" - etcd3testing "k8s.io/apiserver/pkg/storage/etcd3/testing" - "k8s.io/kubernetes/pkg/apis/resource" - _ "k8s.io/kubernetes/pkg/apis/resource/install" - "k8s.io/kubernetes/pkg/registry/registrytest" -) - -func newStorage(t *testing.T) (*REST, *etcd3testing.EtcdTestServer) { - etcdStorage, server := registrytest.NewEtcdStorage(t, resource.GroupName) - restOptions := generic.RESTOptions{ - StorageConfig: etcdStorage, - Decorator: generic.UndecoratedStorage, - DeleteCollectionWorkers: 1, - ResourcePrefix: "resourceclaimparameters", - } - resourceClassStorage, err := NewREST(restOptions) - if err != nil { - t.Fatalf("unexpected error from REST storage: %v", err) - } - return resourceClassStorage, server -} - -func validNewResourceClaimParameters(name string) *resource.ResourceClaimParameters { - return &resource.ResourceClaimParameters{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - }, - } -} - -func TestCreate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - resourceClass := validNewResourceClaimParameters("foo") - resourceClass.ObjectMeta = metav1.ObjectMeta{} - test.TestCreate( - // valid - resourceClass, - // invalid - &resource.ResourceClaimParameters{ - ObjectMeta: metav1.ObjectMeta{Name: "*BadName!"}, - }, - ) -} - -func TestUpdate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestUpdate( - // valid - validNewResourceClaimParameters("foo"), - // updateFunc - func(obj runtime.Object) runtime.Object { - object := obj.(*resource.ResourceClaimParameters) - object.Labels = map[string]string{"foo": "bar"} - return object - }, - // invalid update - func(obj runtime.Object) runtime.Object { - object := obj.(*resource.ResourceClaimParameters) - object.Labels = map[string]string{"&$^^#%@": "1"} - return object - }, - ) - -} - -func TestDelete(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store).ReturnDeletedObject() - test.TestDelete(validNewResourceClaimParameters("foo")) -} - -func TestGet(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestGet(validNewResourceClaimParameters("foo")) -} - -func TestList(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestList(validNewResourceClaimParameters("foo")) -} - -func TestWatch(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestWatch( - validNewResourceClaimParameters("foo"), - // matching labels - []labels.Set{}, - // not matching labels - []labels.Set{ - {"foo": "bar"}, - }, - // matching fields - []fields.Set{ - {"metadata.name": "foo"}, - }, - // not matching fields - []fields.Set{ - {"metadata.name": "bar"}, - }, - ) -} diff --git a/pkg/registry/resource/resourceclaimparameters/strategy.go b/pkg/registry/resource/resourceclaimparameters/strategy.go deleted file mode 100644 index 9b17f14f2281d..0000000000000 --- a/pkg/registry/resource/resourceclaimparameters/strategy.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package resourceclaimparameters - -import ( - "context" - "errors" - - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/names" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/kubernetes/pkg/apis/resource/validation" -) - -// resourceClaimParametersStrategy implements behavior for ResourceClaimParameters objects -type resourceClaimParametersStrategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -var Strategy = resourceClaimParametersStrategy{legacyscheme.Scheme, names.SimpleNameGenerator} - -func (resourceClaimParametersStrategy) NamespaceScoped() bool { - return true -} - -func (resourceClaimParametersStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { -} - -func (resourceClaimParametersStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { - resourceClaimParameters := obj.(*resource.ResourceClaimParameters) - return validation.ValidateResourceClaimParameters(resourceClaimParameters) -} - -func (resourceClaimParametersStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { - return nil -} - -func (resourceClaimParametersStrategy) Canonicalize(obj runtime.Object) { -} - -func (resourceClaimParametersStrategy) AllowCreateOnUpdate() bool { - return false -} - -func (resourceClaimParametersStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { -} - -func (resourceClaimParametersStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - return validation.ValidateResourceClaimParametersUpdate(obj.(*resource.ResourceClaimParameters), old.(*resource.ResourceClaimParameters)) -} - -func (resourceClaimParametersStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { - return nil -} - -func (resourceClaimParametersStrategy) AllowUnconditionalUpdate() bool { - return true -} - -// Match returns a generic matcher for a given label and field selector. -func Match(label labels.Selector, field fields.Selector) storage.SelectionPredicate { - return storage.SelectionPredicate{ - Label: label, - Field: field, - GetAttrs: GetAttrs, - } -} - -// GetAttrs returns labels and fields of a given object for filtering purposes. -func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { - parameters, ok := obj.(*resource.ResourceClaimParameters) - if !ok { - return nil, nil, errors.New("not a resourceclaim") - } - return labels.Set(parameters.Labels), toSelectableFields(parameters), nil -} - -// toSelectableFields returns a field set that represents the object -func toSelectableFields(claim *resource.ResourceClaimParameters) fields.Set { - fields := generic.ObjectMetaFieldsSet(&claim.ObjectMeta, true) - return fields -} diff --git a/pkg/registry/resource/resourceclaimparameters/strategy_test.go b/pkg/registry/resource/resourceclaimparameters/strategy_test.go deleted file mode 100644 index 931b4a8316a9a..0000000000000 --- a/pkg/registry/resource/resourceclaimparameters/strategy_test.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package resourceclaimparameters - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/kubernetes/pkg/apis/resource" -) - -var resourceClaimParameters = &resource.ResourceClaimParameters{ - ObjectMeta: metav1.ObjectMeta{ - Name: "valid", - Namespace: "ns", - }, -} - -func TestClassStrategy(t *testing.T) { - if !Strategy.NamespaceScoped() { - t.Errorf("ResourceClaimParameters must be namespace scoped") - } - if Strategy.AllowCreateOnUpdate() { - t.Errorf("ResourceClaimParameters should not allow create on update") - } -} - -func TestClassStrategyCreate(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - resourceClaimParameters := resourceClaimParameters.DeepCopy() - - Strategy.PrepareForCreate(ctx, resourceClaimParameters) - errs := Strategy.Validate(ctx, resourceClaimParameters) - if len(errs) != 0 { - t.Errorf("unexpected error validating for create %v", errs) - } -} - -func TestClassStrategyUpdate(t *testing.T) { - t.Run("no-changes-okay", func(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - resourceClaimParameters := resourceClaimParameters.DeepCopy() - newObj := resourceClaimParameters.DeepCopy() - newObj.ResourceVersion = "4" - - Strategy.PrepareForUpdate(ctx, newObj, resourceClaimParameters) - errs := Strategy.ValidateUpdate(ctx, newObj, resourceClaimParameters) - if len(errs) != 0 { - t.Errorf("unexpected validation errors: %v", errs) - } - }) - - t.Run("name-change-not-allowed", func(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - resourceClaimParameters := resourceClaimParameters.DeepCopy() - newObj := resourceClaimParameters.DeepCopy() - newObj.Name += "-2" - newObj.ResourceVersion = "4" - - Strategy.PrepareForUpdate(ctx, newObj, resourceClaimParameters) - errs := Strategy.ValidateUpdate(ctx, newObj, resourceClaimParameters) - if len(errs) == 0 { - t.Errorf("expected a validation error") - } - }) -} diff --git a/pkg/registry/resource/resourceclaimtemplate/storage/storage_test.go b/pkg/registry/resource/resourceclaimtemplate/storage/storage_test.go index 642938b3bc2cb..ab10d139bdc90 100644 --- a/pkg/registry/resource/resourceclaimtemplate/storage/storage_test.go +++ b/pkg/registry/resource/resourceclaimtemplate/storage/storage_test.go @@ -52,12 +52,6 @@ func validNewClaimTemplate(name string) *resource.ResourceClaimTemplate { Name: name, Namespace: metav1.NamespaceDefault, }, - Spec: resource.ResourceClaimTemplateSpec{ - Spec: resource.ResourceClaimSpec{ - ResourceClassName: "valid-class", - AllocationMode: resource.AllocationModeImmediate, - }, - }, } } @@ -95,7 +89,7 @@ func TestUpdate(t *testing.T) { //invalid update func(obj runtime.Object) runtime.Object { object := obj.(*resource.ResourceClaimTemplate) - object.Spec.Spec.ResourceClassName = "" + object.Name = "^%$#@#%" return object }, ) diff --git a/pkg/registry/resource/resourceclaimtemplate/strategy.go b/pkg/registry/resource/resourceclaimtemplate/strategy.go index 8c625c94d4b6a..02cda68d89dea 100644 --- a/pkg/registry/resource/resourceclaimtemplate/strategy.go +++ b/pkg/registry/resource/resourceclaimtemplate/strategy.go @@ -48,7 +48,7 @@ func (resourceClaimTemplateStrategy) PrepareForCreate(ctx context.Context, obj r func (resourceClaimTemplateStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { resourceClaimTemplate := obj.(*resource.ResourceClaimTemplate) - return validation.ValidateClaimTemplate(resourceClaimTemplate) + return validation.ValidateResourceClaimTemplate(resourceClaimTemplate) } func (resourceClaimTemplateStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { @@ -66,8 +66,8 @@ func (resourceClaimTemplateStrategy) PrepareForUpdate(ctx context.Context, obj, } func (resourceClaimTemplateStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - errorList := validation.ValidateClaimTemplate(obj.(*resource.ResourceClaimTemplate)) - return append(errorList, validation.ValidateClaimTemplateUpdate(obj.(*resource.ResourceClaimTemplate), old.(*resource.ResourceClaimTemplate))...) + errorList := validation.ValidateResourceClaimTemplate(obj.(*resource.ResourceClaimTemplate)) + return append(errorList, validation.ValidateResourceClaimTemplateUpdate(obj.(*resource.ResourceClaimTemplate), old.(*resource.ResourceClaimTemplate))...) } func (resourceClaimTemplateStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { diff --git a/pkg/registry/resource/resourceclaimtemplate/strategy_test.go b/pkg/registry/resource/resourceclaimtemplate/strategy_test.go index 47e2537532160..14c9eddaeba4f 100644 --- a/pkg/registry/resource/resourceclaimtemplate/strategy_test.go +++ b/pkg/registry/resource/resourceclaimtemplate/strategy_test.go @@ -29,12 +29,6 @@ var resourceClaimTemplate = &resource.ResourceClaimTemplate{ Name: "valid-claim-template", Namespace: "default", }, - Spec: resource.ResourceClaimTemplateSpec{ - Spec: resource.ResourceClaimSpec{ - ResourceClassName: "valid-class", - AllocationMode: resource.AllocationModeImmediate, - }, - }, } func TestClaimTemplateStrategy(t *testing.T) { diff --git a/pkg/registry/resource/resourceclass/strategy.go b/pkg/registry/resource/resourceclass/strategy.go deleted file mode 100644 index 55f98fe4065e7..0000000000000 --- a/pkg/registry/resource/resourceclass/strategy.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package resourceclass - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/storage/names" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/kubernetes/pkg/apis/resource/validation" -) - -// resourceClassStrategy implements behavior for ResourceClass objects -type resourceClassStrategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -var Strategy = resourceClassStrategy{legacyscheme.Scheme, names.SimpleNameGenerator} - -func (resourceClassStrategy) NamespaceScoped() bool { - return false -} - -func (resourceClassStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { -} - -func (resourceClassStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { - resourceClass := obj.(*resource.ResourceClass) - return validation.ValidateClass(resourceClass) -} - -func (resourceClassStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { - return nil -} - -func (resourceClassStrategy) Canonicalize(obj runtime.Object) { -} - -func (resourceClassStrategy) AllowCreateOnUpdate() bool { - return false -} - -func (resourceClassStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { -} - -func (resourceClassStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - errorList := validation.ValidateClass(obj.(*resource.ResourceClass)) - return append(errorList, validation.ValidateClassUpdate(obj.(*resource.ResourceClass), old.(*resource.ResourceClass))...) -} - -func (resourceClassStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { - return nil -} - -func (resourceClassStrategy) AllowUnconditionalUpdate() bool { - return true -} diff --git a/pkg/registry/resource/resourceclassparameters/storage/storage.go b/pkg/registry/resource/resourceclassparameters/storage/storage.go deleted file mode 100644 index 1603b27c34abc..0000000000000 --- a/pkg/registry/resource/resourceclassparameters/storage/storage.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package storage - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/kubernetes/pkg/printers" - printersinternal "k8s.io/kubernetes/pkg/printers/internalversion" - printerstorage "k8s.io/kubernetes/pkg/printers/storage" - "k8s.io/kubernetes/pkg/registry/resource/resourceclassparameters" -) - -// REST implements a RESTStorage for ResourceClassParameters. -type REST struct { - *genericregistry.Store -} - -// NewREST returns a RESTStorage object that will work against ResourceClassParameters. -func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) { - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &resource.ResourceClassParameters{} }, - NewListFunc: func() runtime.Object { return &resource.ResourceClassParametersList{} }, - PredicateFunc: resourceclassparameters.Match, - DefaultQualifiedResource: resource.Resource("resourceclassparameters"), - SingularQualifiedResource: resource.Resource("resourceclassparameters"), - - CreateStrategy: resourceclassparameters.Strategy, - UpdateStrategy: resourceclassparameters.Strategy, - DeleteStrategy: resourceclassparameters.Strategy, - ReturnDeletedObject: true, - - TableConvertor: printerstorage.TableConvertor{TableGenerator: printers.NewTableGenerator().With(printersinternal.AddHandlers)}, - } - options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: resourceclassparameters.GetAttrs} - if err := store.CompleteWithOptions(options); err != nil { - return nil, err - } - - return &REST{store}, nil -} diff --git a/pkg/registry/resource/resourceclassparameters/storage/storage_test.go b/pkg/registry/resource/resourceclassparameters/storage/storage_test.go deleted file mode 100644 index 83e9544944180..0000000000000 --- a/pkg/registry/resource/resourceclassparameters/storage/storage_test.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package storage - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - genericregistrytest "k8s.io/apiserver/pkg/registry/generic/testing" - etcd3testing "k8s.io/apiserver/pkg/storage/etcd3/testing" - "k8s.io/kubernetes/pkg/apis/resource" - _ "k8s.io/kubernetes/pkg/apis/resource/install" - "k8s.io/kubernetes/pkg/registry/registrytest" -) - -func newStorage(t *testing.T) (*REST, *etcd3testing.EtcdTestServer) { - etcdStorage, server := registrytest.NewEtcdStorage(t, resource.GroupName) - restOptions := generic.RESTOptions{ - StorageConfig: etcdStorage, - Decorator: generic.UndecoratedStorage, - DeleteCollectionWorkers: 1, - ResourcePrefix: "resourceclassparameters", - } - resourceClassStorage, err := NewREST(restOptions) - if err != nil { - t.Fatalf("unexpected error from REST storage: %v", err) - } - return resourceClassStorage, server -} - -func validNewResourceClassParameters(name string) *resource.ResourceClassParameters { - return &resource.ResourceClassParameters{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - }, - } -} - -func TestCreate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - resourceClass := validNewResourceClassParameters("foo") - resourceClass.ObjectMeta = metav1.ObjectMeta{} - test.TestCreate( - // valid - resourceClass, - // invalid - &resource.ResourceClassParameters{ - ObjectMeta: metav1.ObjectMeta{Name: "*BadName!"}, - }, - ) -} - -func TestUpdate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestUpdate( - // valid - validNewResourceClassParameters("foo"), - // updateFunc - func(obj runtime.Object) runtime.Object { - object := obj.(*resource.ResourceClassParameters) - object.Labels = map[string]string{"foo": "bar"} - return object - }, - // invalid update - func(obj runtime.Object) runtime.Object { - object := obj.(*resource.ResourceClassParameters) - object.Labels = map[string]string{"&$^^#%@": "1"} - return object - }, - ) - -} - -func TestDelete(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store).ReturnDeletedObject() - test.TestDelete(validNewResourceClassParameters("foo")) -} - -func TestGet(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestGet(validNewResourceClassParameters("foo")) -} - -func TestList(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestList(validNewResourceClassParameters("foo")) -} - -func TestWatch(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.Store.DestroyFunc() - test := genericregistrytest.New(t, storage.Store) - test.TestWatch( - validNewResourceClassParameters("foo"), - // matching labels - []labels.Set{}, - // not matching labels - []labels.Set{ - {"foo": "bar"}, - }, - // matching fields - []fields.Set{ - {"metadata.name": "foo"}, - }, - // not matching fields - []fields.Set{ - {"metadata.name": "bar"}, - }, - ) -} diff --git a/pkg/registry/resource/resourceclassparameters/strategy.go b/pkg/registry/resource/resourceclassparameters/strategy.go deleted file mode 100644 index a1cd1b968cd41..0000000000000 --- a/pkg/registry/resource/resourceclassparameters/strategy.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package resourceclassparameters - -import ( - "context" - "errors" - - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/names" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/resource" - "k8s.io/kubernetes/pkg/apis/resource/validation" -) - -// resourceClassParametersStrategy implements behavior for ResourceClassParameters objects -type resourceClassParametersStrategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -var Strategy = resourceClassParametersStrategy{legacyscheme.Scheme, names.SimpleNameGenerator} - -func (resourceClassParametersStrategy) NamespaceScoped() bool { - return true -} - -func (resourceClassParametersStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { -} - -func (resourceClassParametersStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { - resourceClassParameters := obj.(*resource.ResourceClassParameters) - return validation.ValidateResourceClassParameters(resourceClassParameters) -} - -func (resourceClassParametersStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string { - return nil -} - -func (resourceClassParametersStrategy) Canonicalize(obj runtime.Object) { -} - -func (resourceClassParametersStrategy) AllowCreateOnUpdate() bool { - return false -} - -func (resourceClassParametersStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { -} - -func (resourceClassParametersStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - return validation.ValidateResourceClassParametersUpdate(obj.(*resource.ResourceClassParameters), old.(*resource.ResourceClassParameters)) -} - -func (resourceClassParametersStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string { - return nil -} - -func (resourceClassParametersStrategy) AllowUnconditionalUpdate() bool { - return true -} - -// Match returns a generic matcher for a given label and field selector. -func Match(label labels.Selector, field fields.Selector) storage.SelectionPredicate { - return storage.SelectionPredicate{ - Label: label, - Field: field, - GetAttrs: GetAttrs, - } -} - -// GetAttrs returns labels and fields of a given object for filtering purposes. -func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { - parameters, ok := obj.(*resource.ResourceClassParameters) - if !ok { - return nil, nil, errors.New("not a resourceclassparameters") - } - return labels.Set(parameters.Labels), toSelectableFields(parameters), nil -} - -// toSelectableFields returns a field set that represents the object -func toSelectableFields(class *resource.ResourceClassParameters) fields.Set { - fields := generic.ObjectMetaFieldsSet(&class.ObjectMeta, true) - return fields -} diff --git a/pkg/registry/resource/resourceclassparameters/strategy_test.go b/pkg/registry/resource/resourceclassparameters/strategy_test.go deleted file mode 100644 index 079f9279c9b64..0000000000000 --- a/pkg/registry/resource/resourceclassparameters/strategy_test.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package resourceclassparameters - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/kubernetes/pkg/apis/resource" -) - -var resourceClassParameters = &resource.ResourceClassParameters{ - ObjectMeta: metav1.ObjectMeta{ - Name: "valid", - Namespace: "ns", - }, -} - -func TestClassStrategy(t *testing.T) { - if !Strategy.NamespaceScoped() { - t.Errorf("ResourceClassParameters must be namespace scoped") - } - if Strategy.AllowCreateOnUpdate() { - t.Errorf("ResourceClassParameters should not allow create on update") - } -} - -func TestClassStrategyCreate(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - resourceClassParameters := resourceClassParameters.DeepCopy() - - Strategy.PrepareForCreate(ctx, resourceClassParameters) - errs := Strategy.Validate(ctx, resourceClassParameters) - if len(errs) != 0 { - t.Errorf("unexpected error validating for create %v", errs) - } -} - -func TestClassStrategyUpdate(t *testing.T) { - t.Run("no-changes-okay", func(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - resourceClassParameters := resourceClassParameters.DeepCopy() - newObj := resourceClassParameters.DeepCopy() - newObj.ResourceVersion = "4" - - Strategy.PrepareForUpdate(ctx, newObj, resourceClassParameters) - errs := Strategy.ValidateUpdate(ctx, newObj, resourceClassParameters) - if len(errs) != 0 { - t.Errorf("unexpected validation errors: %v", errs) - } - }) - - t.Run("name-change-not-allowed", func(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - resourceClassParameters := resourceClassParameters.DeepCopy() - newObj := resourceClassParameters.DeepCopy() - newObj.Name += "-2" - newObj.ResourceVersion = "4" - - Strategy.PrepareForUpdate(ctx, newObj, resourceClassParameters) - errs := Strategy.ValidateUpdate(ctx, newObj, resourceClassParameters) - if len(errs) == 0 { - t.Errorf("expected a validation error") - } - }) -} diff --git a/pkg/registry/resource/resourceslice/storage/storage_test.go b/pkg/registry/resource/resourceslice/storage/storage_test.go index 175cff4084f24..793a836303b7b 100644 --- a/pkg/registry/resource/resourceslice/storage/storage_test.go +++ b/pkg/registry/resource/resourceslice/storage/storage_test.go @@ -51,10 +51,13 @@ func validNewResourceSlice(name string) *resource.ResourceSlice { ObjectMeta: metav1.ObjectMeta{ Name: name, }, - NodeName: name, - DriverName: "cdi.example.com", - ResourceModel: resource.ResourceModel{ - NamedResources: &resource.NamedResourcesResources{}, + Spec: resource.ResourceSliceSpec{ + NodeName: name, + Driver: "cdi.example.com", + Pool: resource.ResourcePool{ + Name: "worker-1", + ResourceSliceCount: 1, + }, }, } } @@ -93,7 +96,7 @@ func TestUpdate(t *testing.T) { // invalid update func(obj runtime.Object) runtime.Object { object := obj.(*resource.ResourceSlice) - object.DriverName = "" + object.Spec.Driver = "" return object }, ) diff --git a/pkg/registry/resource/resourceslice/strategy.go b/pkg/registry/resource/resourceslice/strategy.go index e23b7d7ba3669..336de305c2f01 100644 --- a/pkg/registry/resource/resourceslice/strategy.go +++ b/pkg/registry/resource/resourceslice/strategy.go @@ -20,6 +20,7 @@ import ( "context" "fmt" + apiequality "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -46,6 +47,8 @@ func (resourceSliceStrategy) NamespaceScoped() bool { } func (resourceSliceStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { + slice := obj.(*resource.ResourceSlice) + slice.Generation = 1 } func (resourceSliceStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { @@ -65,6 +68,13 @@ func (resourceSliceStrategy) AllowCreateOnUpdate() bool { } func (resourceSliceStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { + slice := obj.(*resource.ResourceSlice) + oldSlice := old.(*resource.ResourceSlice) + + // Any changes to the spec increment the generation number. + if !apiequality.Semantic.DeepEqual(oldSlice.Spec, slice.Spec) { + slice.Generation = oldSlice.Generation + 1 + } } func (resourceSliceStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { @@ -82,17 +92,17 @@ func (resourceSliceStrategy) AllowUnconditionalUpdate() bool { var TriggerFunc = map[string]storage.IndexerFunc{ // Only one index is supported: // https://github.com/kubernetes/kubernetes/blob/3aa8c59fec0bf339e67ca80ea7905c817baeca85/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go#L346-L350 - "nodeName": nodeNameTriggerFunc, + resource.ResourceSliceSelectorNodeName: nodeNameTriggerFunc, } func nodeNameTriggerFunc(obj runtime.Object) string { - return obj.(*resource.ResourceSlice).NodeName + return obj.(*resource.ResourceSlice).Spec.NodeName } // Indexers returns the indexers for ResourceSlice. func Indexers() *cache.Indexers { return &cache.Indexers{ - storage.FieldIndex("nodeName"): nodeNameIndexFunc, + storage.FieldIndex(resource.ResourceSliceSelectorNodeName): nodeNameIndexFunc, } } @@ -101,7 +111,7 @@ func nodeNameIndexFunc(obj interface{}) ([]string, error) { if !ok { return nil, fmt.Errorf("not a ResourceSlice") } - return []string{slice.NodeName}, nil + return []string{slice.Spec.NodeName}, nil } // GetAttrs returns labels and fields of a given object for filtering purposes. @@ -119,7 +129,7 @@ func Match(label labels.Selector, field fields.Selector) storage.SelectionPredic Label: label, Field: field, GetAttrs: GetAttrs, - IndexFields: []string{"nodeName"}, + IndexFields: []string{resource.ResourceSliceSelectorNodeName}, } } @@ -131,8 +141,8 @@ func toSelectableFields(slice *resource.ResourceSlice) fields.Set { // field here or the number of object-meta related fields changes, this should // be adjusted. fields := make(fields.Set, 3) - fields["nodeName"] = slice.NodeName - fields["driverName"] = slice.DriverName + fields[resource.ResourceSliceSelectorNodeName] = slice.Spec.NodeName + fields[resource.ResourceSliceSelectorDriver] = slice.Spec.Driver // Adds one field. return generic.AddObjectMetaFieldsSet(fields, &slice.ObjectMeta, false) diff --git a/pkg/registry/resource/resourceslice/strategy_test.go b/pkg/registry/resource/resourceslice/strategy_test.go index 923c5dfc2d5a2..0ee366655b029 100644 --- a/pkg/registry/resource/resourceslice/strategy_test.go +++ b/pkg/registry/resource/resourceslice/strategy_test.go @@ -28,14 +28,17 @@ var slice = &resource.ResourceSlice{ ObjectMeta: metav1.ObjectMeta{ Name: "valid-class", }, - NodeName: "valid-node-name", - DriverName: "testdriver.example.com", - ResourceModel: resource.ResourceModel{ - NamedResources: &resource.NamedResourcesResources{}, + Spec: resource.ResourceSliceSpec{ + NodeName: "valid-node-name", + Driver: "testdriver.example.com", + Pool: resource.ResourcePool{ + Name: "valid-pool-name", + ResourceSliceCount: 1, + }, }, } -func TestClassStrategy(t *testing.T) { +func TestResourceSliceStrategy(t *testing.T) { if Strategy.NamespaceScoped() { t.Errorf("ResourceSlice must not be namespace scoped") } @@ -44,7 +47,7 @@ func TestClassStrategy(t *testing.T) { } } -func TestClassStrategyCreate(t *testing.T) { +func TestResourceSliceStrategyCreate(t *testing.T) { ctx := genericapirequest.NewDefaultContext() slice := slice.DeepCopy() @@ -55,15 +58,15 @@ func TestClassStrategyCreate(t *testing.T) { } } -func TestClassStrategyUpdate(t *testing.T) { +func TestResourceSliceStrategyUpdate(t *testing.T) { t.Run("no-changes-okay", func(t *testing.T) { ctx := genericapirequest.NewDefaultContext() slice := slice.DeepCopy() - newClass := slice.DeepCopy() - newClass.ResourceVersion = "4" + newSlice := slice.DeepCopy() + newSlice.ResourceVersion = "4" - Strategy.PrepareForUpdate(ctx, newClass, slice) - errs := Strategy.ValidateUpdate(ctx, newClass, slice) + Strategy.PrepareForUpdate(ctx, newSlice, slice) + errs := Strategy.ValidateUpdate(ctx, newSlice, slice) if len(errs) != 0 { t.Errorf("unexpected validation errors: %v", errs) } @@ -72,12 +75,12 @@ func TestClassStrategyUpdate(t *testing.T) { t.Run("name-change-not-allowed", func(t *testing.T) { ctx := genericapirequest.NewDefaultContext() slice := slice.DeepCopy() - newClass := slice.DeepCopy() - newClass.Name = "valid-class-2" - newClass.ResourceVersion = "4" + newSlice := slice.DeepCopy() + newSlice.Name = "valid-slice-2" + newSlice.ResourceVersion = "4" - Strategy.PrepareForUpdate(ctx, newClass, slice) - errs := Strategy.ValidateUpdate(ctx, newClass, slice) + Strategy.PrepareForUpdate(ctx, newSlice, slice) + errs := Strategy.ValidateUpdate(ctx, newSlice, slice) if len(errs) == 0 { t.Errorf("expected a validation error") } diff --git a/pkg/registry/resource/rest/storage_resource.go b/pkg/registry/resource/rest/storage_resource.go index b13e7f0227bf9..3be89acf4994f 100644 --- a/pkg/registry/resource/rest/storage_resource.go +++ b/pkg/registry/resource/rest/storage_resource.go @@ -17,19 +17,17 @@ limitations under the License. package rest import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apiserver/pkg/registry/generic" "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" serverstorage "k8s.io/apiserver/pkg/server/storage" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/resource" + deviceclassstore "k8s.io/kubernetes/pkg/registry/resource/deviceclass/storage" podschedulingcontextsstore "k8s.io/kubernetes/pkg/registry/resource/podschedulingcontext/storage" resourceclaimstore "k8s.io/kubernetes/pkg/registry/resource/resourceclaim/storage" - resourceclaimparametersstore "k8s.io/kubernetes/pkg/registry/resource/resourceclaimparameters/storage" resourceclaimtemplatestore "k8s.io/kubernetes/pkg/registry/resource/resourceclaimtemplate/storage" - resourceclassstore "k8s.io/kubernetes/pkg/registry/resource/resourceclass/storage" - resourceclassparametersstore "k8s.io/kubernetes/pkg/registry/resource/resourceclassparameters/storage" resourceslicestore "k8s.io/kubernetes/pkg/registry/resource/resourceslice/storage" ) @@ -40,27 +38,27 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag // If you add a version here, be sure to add an entry in `k8s.io/kubernetes/cmd/kube-apiserver/app/aggregator.go with specific priorities. // TODO refactor the plumbing to provide the information in the APIGroupInfo - if storageMap, err := p.v1alpha2Storage(apiResourceConfigSource, restOptionsGetter); err != nil { + if storageMap, err := p.v1alpha3Storage(apiResourceConfigSource, restOptionsGetter); err != nil { return genericapiserver.APIGroupInfo{}, err } else if len(storageMap) > 0 { - apiGroupInfo.VersionedResourcesStorageMap[resourcev1alpha2.SchemeGroupVersion.Version] = storageMap + apiGroupInfo.VersionedResourcesStorageMap[resourcev1alpha3.SchemeGroupVersion.Version] = storageMap } return apiGroupInfo, nil } -func (p RESTStorageProvider) v1alpha2Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) { +func (p RESTStorageProvider) v1alpha3Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) { storage := map[string]rest.Storage{} - if resource := "resourceclasses"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { - resourceClassStorage, err := resourceclassstore.NewREST(restOptionsGetter) + if resource := "deviceclasses"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha3.SchemeGroupVersion.WithResource(resource)) { + deviceclassStorage, err := deviceclassstore.NewREST(restOptionsGetter) if err != nil { return nil, err } - storage[resource] = resourceClassStorage + storage[resource] = deviceclassStorage } - if resource := "resourceclaims"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { + if resource := "resourceclaims"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha3.SchemeGroupVersion.WithResource(resource)) { resourceClaimStorage, resourceClaimStatusStorage, err := resourceclaimstore.NewREST(restOptionsGetter) if err != nil { return nil, err @@ -69,7 +67,7 @@ func (p RESTStorageProvider) v1alpha2Storage(apiResourceConfigSource serverstora storage[resource+"/status"] = resourceClaimStatusStorage } - if resource := "resourceclaimtemplates"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { + if resource := "resourceclaimtemplates"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha3.SchemeGroupVersion.WithResource(resource)) { resourceClaimTemplateStorage, err := resourceclaimtemplatestore.NewREST(restOptionsGetter) if err != nil { return nil, err @@ -77,7 +75,7 @@ func (p RESTStorageProvider) v1alpha2Storage(apiResourceConfigSource serverstora storage[resource] = resourceClaimTemplateStorage } - if resource := "podschedulingcontexts"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { + if resource := "podschedulingcontexts"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha3.SchemeGroupVersion.WithResource(resource)) { podSchedulingStorage, podSchedulingStatusStorage, err := podschedulingcontextsstore.NewREST(restOptionsGetter) if err != nil { return nil, err @@ -86,23 +84,7 @@ func (p RESTStorageProvider) v1alpha2Storage(apiResourceConfigSource serverstora storage[resource+"/status"] = podSchedulingStatusStorage } - if resource := "resourceclaimparameters"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { - resourceClaimParametersStorage, err := resourceclaimparametersstore.NewREST(restOptionsGetter) - if err != nil { - return nil, err - } - storage[resource] = resourceClaimParametersStorage - } - - if resource := "resourceclassparameters"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { - resourceClassParametersStorage, err := resourceclassparametersstore.NewREST(restOptionsGetter) - if err != nil { - return nil, err - } - storage[resource] = resourceClassParametersStorage - } - - if resource := "resourceslices"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha2.SchemeGroupVersion.WithResource(resource)) { + if resource := "resourceslices"; apiResourceConfigSource.ResourceEnabled(resourcev1alpha3.SchemeGroupVersion.WithResource(resource)) { resourceSliceStorage, err := resourceslicestore.NewREST(restOptionsGetter) if err != nil { return nil, err diff --git a/pkg/scheduler/eventhandlers.go b/pkg/scheduler/eventhandlers.go index 2001b9ed91e3b..3f03f4e531730 100644 --- a/pkg/scheduler/eventhandlers.go +++ b/pkg/scheduler/eventhandlers.go @@ -475,7 +475,7 @@ func addAllEventHandlers( handlers = append(handlers, handlerRegistration) case framework.PodSchedulingContext: if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - if handlerRegistration, err = informerFactory.Resource().V1alpha2().PodSchedulingContexts().Informer().AddEventHandler( + if handlerRegistration, err = informerFactory.Resource().V1alpha3().PodSchedulingContexts().Informer().AddEventHandler( buildEvtResHandler(at, framework.PodSchedulingContext, "PodSchedulingContext"), ); err != nil { return err @@ -489,28 +489,10 @@ func addAllEventHandlers( ) handlers = append(handlers, handlerRegistration) } - case framework.ResourceClass: + case framework.DeviceClass: if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - if handlerRegistration, err = informerFactory.Resource().V1alpha2().ResourceClasses().Informer().AddEventHandler( - buildEvtResHandler(at, framework.ResourceClass, "ResourceClass"), - ); err != nil { - return err - } - handlers = append(handlers, handlerRegistration) - } - case framework.ResourceClaimParameters: - if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - if handlerRegistration, err = informerFactory.Resource().V1alpha2().ResourceClaimParameters().Informer().AddEventHandler( - buildEvtResHandler(at, framework.ResourceClaimParameters, "ResourceClaimParameters"), - ); err != nil { - return err - } - handlers = append(handlers, handlerRegistration) - } - case framework.ResourceClassParameters: - if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - if handlerRegistration, err = informerFactory.Resource().V1alpha2().ResourceClassParameters().Informer().AddEventHandler( - buildEvtResHandler(at, framework.ResourceClassParameters, "ResourceClassParameters"), + if handlerRegistration, err = informerFactory.Resource().V1alpha3().DeviceClasses().Informer().AddEventHandler( + buildEvtResHandler(at, framework.DeviceClass, "DeviceClass"), ); err != nil { return err } diff --git a/pkg/scheduler/eventhandlers_test.go b/pkg/scheduler/eventhandlers_test.go index a99146cf567fc..b8cd9be73a9c5 100644 --- a/pkg/scheduler/eventhandlers_test.go +++ b/pkg/scheduler/eventhandlers_test.go @@ -26,7 +26,7 @@ import ( appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -384,11 +384,9 @@ func TestAddAllEventHandlers(t *testing.T) { { name: "DRA events disabled", gvkMap: map[framework.GVK]framework.ActionType{ - framework.PodSchedulingContext: framework.Add, - framework.ResourceClaim: framework.Add, - framework.ResourceClass: framework.Add, - framework.ResourceClaimParameters: framework.Add, - framework.ResourceClassParameters: framework.Add, + framework.PodSchedulingContext: framework.Add, + framework.ResourceClaim: framework.Add, + framework.DeviceClass: framework.Add, }, expectStaticInformers: map[reflect.Type]bool{ reflect.TypeOf(&v1.Pod{}): true, @@ -400,22 +398,18 @@ func TestAddAllEventHandlers(t *testing.T) { { name: "DRA events enabled", gvkMap: map[framework.GVK]framework.ActionType{ - framework.PodSchedulingContext: framework.Add, - framework.ResourceClaim: framework.Add, - framework.ResourceClass: framework.Add, - framework.ResourceClaimParameters: framework.Add, - framework.ResourceClassParameters: framework.Add, + framework.PodSchedulingContext: framework.Add, + framework.ResourceClaim: framework.Add, + framework.DeviceClass: framework.Add, }, enableDRA: true, expectStaticInformers: map[reflect.Type]bool{ - reflect.TypeOf(&v1.Pod{}): true, - reflect.TypeOf(&v1.Node{}): true, - reflect.TypeOf(&v1.Namespace{}): true, - reflect.TypeOf(&resourcev1alpha2.PodSchedulingContext{}): true, - reflect.TypeOf(&resourcev1alpha2.ResourceClaim{}): true, - reflect.TypeOf(&resourcev1alpha2.ResourceClaimParameters{}): true, - reflect.TypeOf(&resourcev1alpha2.ResourceClass{}): true, - reflect.TypeOf(&resourcev1alpha2.ResourceClassParameters{}): true, + reflect.TypeOf(&v1.Pod{}): true, + reflect.TypeOf(&v1.Node{}): true, + reflect.TypeOf(&v1.Namespace{}): true, + reflect.TypeOf(&resourceapi.PodSchedulingContext{}): true, + reflect.TypeOf(&resourceapi.ResourceClaim{}): true, + reflect.TypeOf(&resourceapi.DeviceClass{}): true, }, expectDynamicInformers: map[schema.GroupVersionResource]bool{}, }, @@ -494,7 +488,7 @@ func TestAddAllEventHandlers(t *testing.T) { dynInformerFactory := dynamicinformer.NewDynamicSharedInformerFactory(dynclient, 0) var resourceClaimCache *assumecache.AssumeCache if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - resourceClaimInformer := informerFactory.Resource().V1alpha2().ResourceClaims().Informer() + resourceClaimInformer := informerFactory.Resource().V1alpha3().ResourceClaims().Informer() resourceClaimCache = assumecache.NewAssumeCache(logger, resourceClaimInformer, "ResourceClaim", "", nil) } diff --git a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go index 90039854a1471..16135247dcd55 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go @@ -27,7 +27,7 @@ import ( "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" apiequality "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,13 +35,13 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" - resourcev1alpha2apply "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourceapiapply "k8s.io/client-go/applyconfigurations/resource/v1alpha3" "k8s.io/client-go/kubernetes" - resourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" - "k8s.io/client-go/tools/cache" + resourcelisters "k8s.io/client-go/listers/resource/v1alpha3" "k8s.io/client-go/util/retry" "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" "k8s.io/dynamic-resource-allocation/resourceclaim" + "k8s.io/dynamic-resource-allocation/structured" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" @@ -56,10 +56,6 @@ const ( Name = names.DynamicResources stateKey framework.StateKey = Name - - // generatedFromIndex is the lookup name for the index function - // which indexes by other resource which generated the parameters object. - generatedFromIndex = "generated-from-index" ) // The state is initialized in PreFilter phase. Because we save the pointer in @@ -76,15 +72,14 @@ type stateData struct { // the plugin itself successfully does an Update. // // Empty if the Pod has no claims. - claims []*resourcev1alpha2.ResourceClaim + claims []*resourceapi.ResourceClaim // podSchedulingState keeps track of the PodSchedulingContext // (if one exists) and the changes made to it. podSchedulingState podSchedulingState - // resourceModel contains the information about available and allocated resources when using - // structured parameters and the pod needs this information. - resources resources + // Allocator handles claims with structured parameters. + allocator *structured.Allocator // mutex must be locked while accessing any of the fields below. mutex sync.Mutex @@ -99,6 +94,18 @@ type stateData struct { unavailableClaims sets.Set[int] informationsForClaim []informationForClaim + + // nodeAllocations caches the result of Filter for the nodes. + nodeAllocations map[string][]*resourceapi.AllocationResult + + // filterErr is set by Filter if a CEL runtime error is encountered + // for at least one node. Such an error indicates that something is + // wrong with the input (class or claim) and thus scheduling should not + // proceed, even if the error did not occur on all nodes. + // + // This error gets returned by PostFilter as-is and thus should + // contain all relevant details. + filterErr error } func (d *stateData) Clone() framework.StateData { @@ -106,24 +113,20 @@ func (d *stateData) Clone() framework.StateData { } type informationForClaim struct { - // The availableOnNode node filter of the claim converted from the - // v1 API to nodeaffinity.NodeSelector by PreFilter for repeated - // evaluation in Filter. Nil for claim which don't have it. - availableOnNode *nodeaffinity.NodeSelector + // Node selectors based on the claim status (single entry, key is empty) if allocated, + // otherwise the device class AvailableOnNodes selectors (potentially multiple entries, + // key is the device class name). + availableOnNodes map[string]*nodeaffinity.NodeSelector // The status of the claim got from the // schedulingCtx by PreFilter for repeated // evaluation in Filter. Nil for claim which don't have it. - status *resourcev1alpha2.ResourceClaimSchedulingStatus + status *resourceapi.ResourceClaimSchedulingStatus - // structuredParameters is true if the claim is handled via the builtin - // controller. structuredParameters bool - controller *claimController // Set by Reserved, published by PreBind. - allocation *resourcev1alpha2.AllocationResult - allocationDriverName string + allocation *resourceapi.AllocationResult } type podSchedulingState struct { @@ -134,7 +137,7 @@ type podSchedulingState struct { // where it might get shared by different plugins. But in practice, // it is currently only used by dynamic provisioning and thus // managed entirely here. - schedulingCtx *resourcev1alpha2.PodSchedulingContext + schedulingCtx *resourceapi.PodSchedulingContext // selectedNode is set if (and only if) a node has been selected. selectedNode *string @@ -151,7 +154,7 @@ func (p *podSchedulingState) isDirty() bool { // init checks whether there is already a PodSchedulingContext object. // Must not be called concurrently, -func (p *podSchedulingState) init(ctx context.Context, pod *v1.Pod, podSchedulingContextLister resourcev1alpha2listers.PodSchedulingContextLister) error { +func (p *podSchedulingState) init(ctx context.Context, pod *v1.Pod, podSchedulingContextLister resourcelisters.PodSchedulingContextLister) error { schedulingCtx, err := podSchedulingContextLister.PodSchedulingContexts(pod.Namespace).Get(pod.Name) switch { case apierrors.IsNotFound(err): @@ -192,7 +195,7 @@ func (p *podSchedulingState) publish(ctx context.Context, pod *v1.Pod, clientset } else { logger.V(5).Info("Updating PodSchedulingContext", "podSchedulingCtx", klog.KObj(schedulingCtx)) } - _, err = clientset.ResourceV1alpha2().PodSchedulingContexts(schedulingCtx.Namespace).Update(ctx, schedulingCtx, metav1.UpdateOptions{}) + _, err = clientset.ResourceV1alpha3().PodSchedulingContexts(schedulingCtx.Namespace).Update(ctx, schedulingCtx, metav1.UpdateOptions{}) if apierrors.IsConflict(err) { // We don't use SSA by default for performance reasons // (https://github.com/kubernetes/kubernetes/issues/113700#issuecomment-1698563918) @@ -207,7 +210,7 @@ func (p *podSchedulingState) publish(ctx context.Context, pod *v1.Pod, clientset // Using SSA instead of Get+Update has the advantage that // there is no delay for the Get. SSA is safe because only // the scheduler updates these fields. - spec := resourcev1alpha2apply.PodSchedulingContextSpec() + spec := resourceapiapply.PodSchedulingContextSpec() spec.SelectedNode = p.selectedNode if p.potentialNodes != nil { spec.PotentialNodes = *p.potentialNodes @@ -217,7 +220,7 @@ func (p *podSchedulingState) publish(ctx context.Context, pod *v1.Pod, clientset // the list would clear it. spec.PotentialNodes = p.schedulingCtx.Spec.PotentialNodes } - schedulingCtxApply := resourcev1alpha2apply.PodSchedulingContext(pod.Name, pod.Namespace).WithSpec(spec) + schedulingCtxApply := resourceapiapply.PodSchedulingContext(pod.Name, pod.Namespace).WithSpec(spec) if loggerV := logger.V(6); loggerV.Enabled() { // At a high enough log level, dump the entire object. @@ -225,12 +228,12 @@ func (p *podSchedulingState) publish(ctx context.Context, pod *v1.Pod, clientset } else { logger.V(5).Info("Patching PodSchedulingContext", "podSchedulingCtx", klog.KObj(pod)) } - _, err = clientset.ResourceV1alpha2().PodSchedulingContexts(pod.Namespace).Apply(ctx, schedulingCtxApply, metav1.ApplyOptions{FieldManager: "kube-scheduler", Force: true}) + _, err = clientset.ResourceV1alpha3().PodSchedulingContexts(pod.Namespace).Apply(ctx, schedulingCtxApply, metav1.ApplyOptions{FieldManager: "kube-scheduler", Force: true}) } } else { // Create it. - schedulingCtx := &resourcev1alpha2.PodSchedulingContext{ + schedulingCtx := &resourceapi.PodSchedulingContext{ ObjectMeta: metav1.ObjectMeta{ Name: pod.Name, Namespace: pod.Namespace, @@ -249,7 +252,7 @@ func (p *podSchedulingState) publish(ctx context.Context, pod *v1.Pod, clientset } else { logger.V(5).Info("Creating PodSchedulingContext", "podSchedulingCtx", klog.KObj(schedulingCtx)) } - _, err = clientset.ResourceV1alpha2().PodSchedulingContexts(schedulingCtx.Namespace).Create(ctx, schedulingCtx, metav1.CreateOptions{}) + _, err = clientset.ResourceV1alpha3().PodSchedulingContexts(schedulingCtx.Namespace).Create(ctx, schedulingCtx, metav1.CreateOptions{}) } if err != nil { return err @@ -259,7 +262,7 @@ func (p *podSchedulingState) publish(ctx context.Context, pod *v1.Pod, clientset return nil } -func statusForClaim(schedulingCtx *resourcev1alpha2.PodSchedulingContext, podClaimName string) *resourcev1alpha2.ResourceClaimSchedulingStatus { +func statusForClaim(schedulingCtx *resourceapi.PodSchedulingContext, podClaimName string) *resourceapi.ResourceClaimSchedulingStatus { if schedulingCtx == nil { return nil } @@ -276,19 +279,9 @@ type dynamicResources struct { enabled bool fh framework.Handle clientset kubernetes.Interface - classLister resourcev1alpha2listers.ResourceClassLister - podSchedulingContextLister resourcev1alpha2listers.PodSchedulingContextLister - claimParametersLister resourcev1alpha2listers.ResourceClaimParametersLister - classParametersLister resourcev1alpha2listers.ResourceClassParametersLister - resourceSliceLister resourcev1alpha2listers.ResourceSliceLister - claimNameLookup *resourceclaim.Lookup - - // claimParametersIndexer has the common claimParametersGeneratedFrom indexer installed to - // limit iteration over claimParameters to those of interest. - claimParametersIndexer cache.Indexer - // classParametersIndexer has the common classParametersGeneratedFrom indexer installed to - // limit iteration over classParameters to those of interest. - classParametersIndexer cache.Indexer + classLister resourcelisters.DeviceClassLister + podSchedulingContextLister resourcelisters.PodSchedulingContextLister + sliceLister resourcelisters.ResourceSliceLister // claimAssumeCache enables temporarily storing a newer claim object // while the scheduler has allocated it and the corresponding object @@ -357,61 +350,15 @@ func New(ctx context.Context, plArgs runtime.Object, fh framework.Handle, fts fe enabled: true, fh: fh, clientset: fh.ClientSet(), - classLister: fh.SharedInformerFactory().Resource().V1alpha2().ResourceClasses().Lister(), - podSchedulingContextLister: fh.SharedInformerFactory().Resource().V1alpha2().PodSchedulingContexts().Lister(), - claimParametersLister: fh.SharedInformerFactory().Resource().V1alpha2().ResourceClaimParameters().Lister(), - claimParametersIndexer: fh.SharedInformerFactory().Resource().V1alpha2().ResourceClaimParameters().Informer().GetIndexer(), - classParametersLister: fh.SharedInformerFactory().Resource().V1alpha2().ResourceClassParameters().Lister(), - classParametersIndexer: fh.SharedInformerFactory().Resource().V1alpha2().ResourceClassParameters().Informer().GetIndexer(), - resourceSliceLister: fh.SharedInformerFactory().Resource().V1alpha2().ResourceSlices().Lister(), - claimNameLookup: resourceclaim.NewNameLookup(fh.ClientSet()), + classLister: fh.SharedInformerFactory().Resource().V1alpha3().DeviceClasses().Lister(), + podSchedulingContextLister: fh.SharedInformerFactory().Resource().V1alpha3().PodSchedulingContexts().Lister(), + sliceLister: fh.SharedInformerFactory().Resource().V1alpha3().ResourceSlices().Lister(), claimAssumeCache: fh.ResourceClaimCache(), } - if err := pl.claimParametersIndexer.AddIndexers(cache.Indexers{generatedFromIndex: claimParametersGeneratedFromIndexFunc}); err != nil { - return nil, fmt.Errorf("add claim parameters cache indexer: %w", err) - } - if err := pl.classParametersIndexer.AddIndexers(cache.Indexers{generatedFromIndex: classParametersGeneratedFromIndexFunc}); err != nil { - return nil, fmt.Errorf("add class parameters cache indexer: %w", err) - } - return pl, nil } -func claimParametersReferenceKeyFunc(namespace string, ref *resourcev1alpha2.ResourceClaimParametersReference) string { - return ref.APIGroup + "/" + ref.Kind + "/" + namespace + "/" + ref.Name -} - -// claimParametersGeneratedFromIndexFunc is an index function that returns other resource keys -// (= apiGroup/kind/namespace/name) for ResourceClaimParametersReference in a given claim parameters. -func claimParametersGeneratedFromIndexFunc(obj interface{}) ([]string, error) { - parameters, ok := obj.(*resourcev1alpha2.ResourceClaimParameters) - if !ok { - return nil, nil - } - if parameters.GeneratedFrom == nil { - return nil, nil - } - return []string{claimParametersReferenceKeyFunc(parameters.Namespace, parameters.GeneratedFrom)}, nil -} - -func classParametersReferenceKeyFunc(ref *resourcev1alpha2.ResourceClassParametersReference) string { - return ref.APIGroup + "/" + ref.Kind + "/" + ref.Namespace + "/" + ref.Name -} - -// classParametersGeneratedFromIndexFunc is an index function that returns other resource keys -// (= apiGroup/kind/namespace/name) for ResourceClassParametersReference in a given class parameters. -func classParametersGeneratedFromIndexFunc(obj interface{}) ([]string, error) { - parameters, ok := obj.(*resourcev1alpha2.ResourceClassParameters) - if !ok { - return nil, nil - } - if parameters.GeneratedFrom == nil { - return nil, nil - } - return []string{classParametersReferenceKeyFunc(parameters.GeneratedFrom)}, nil -} - var _ framework.PreEnqueuePlugin = &dynamicResources{} var _ framework.PreFilterPlugin = &dynamicResources{} var _ framework.FilterPlugin = &dynamicResources{} @@ -435,11 +382,6 @@ func (pl *dynamicResources) EventsToRegister() []framework.ClusterEventWithHint } events := []framework.ClusterEventWithHint{ - // Changes for claim or class parameters creation may make pods - // schedulable which depend on claims using those parameters. - {Event: framework.ClusterEvent{Resource: framework.ResourceClaimParameters, ActionType: framework.Add | framework.Update}, QueueingHintFn: pl.isSchedulableAfterClaimParametersChange}, - {Event: framework.ClusterEvent{Resource: framework.ResourceClassParameters, ActionType: framework.Add | framework.Update}, QueueingHintFn: pl.isSchedulableAfterClassParametersChange}, - // Allocation is tracked in ResourceClaims, so any changes may make the pods schedulable. {Event: framework.ClusterEvent{Resource: framework.ResourceClaim, ActionType: framework.Add | framework.Update}, QueueingHintFn: pl.isSchedulableAfterClaimChange}, // When a driver has provided additional information, a pod waiting for that information @@ -458,7 +400,7 @@ func (pl *dynamicResources) EventsToRegister() []framework.ClusterEventWithHint // See: https://github.com/kubernetes/kubernetes/issues/110175 {Event: framework.ClusterEvent{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel | framework.UpdateNodeTaint}}, // A pod might be waiting for a class to get created or modified. - {Event: framework.ClusterEvent{Resource: framework.ResourceClass, ActionType: framework.Add | framework.Update}}, + {Event: framework.ClusterEvent{Resource: framework.DeviceClass, ActionType: framework.Add | framework.Update}}, } return events } @@ -473,162 +415,19 @@ func (pl *dynamicResources) PreEnqueue(ctx context.Context, pod *v1.Pod) (status return nil } -// isSchedulableAfterClaimParametersChange is invoked for add and update claim parameters events reported by -// an informer. It checks whether that change made a previously unschedulable -// pod schedulable. It errs on the side of letting a pod scheduling attempt -// happen. The delete claim event will not invoke it, so newObj will never be nil. -func (pl *dynamicResources) isSchedulableAfterClaimParametersChange(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { - originalParameters, modifiedParameters, err := schedutil.As[*resourcev1alpha2.ResourceClaimParameters](oldObj, newObj) - if err != nil { - // Shouldn't happen. - return framework.Queue, fmt.Errorf("unexpected object in isSchedulableAfterClaimParametersChange: %w", err) - } - - usesParameters := false - if err := pl.foreachPodResourceClaim(pod, func(_ string, claim *resourcev1alpha2.ResourceClaim) { - ref := claim.Spec.ParametersRef - if ref == nil { - return - } - - // Using in-tree parameters directly? - if ref.APIGroup == resourcev1alpha2.SchemeGroupVersion.Group && - ref.Kind == "ResourceClaimParameters" { - if modifiedParameters.Name == ref.Name { - usesParameters = true - } - return - } - - // Need to look for translated parameters. - generatedFrom := modifiedParameters.GeneratedFrom - if generatedFrom == nil { - return - } - if generatedFrom.APIGroup == ref.APIGroup && - generatedFrom.Kind == ref.Kind && - generatedFrom.Name == ref.Name { - usesParameters = true - } - }); err != nil { - // This is not an unexpected error: we know that - // foreachPodResourceClaim only returns errors for "not - // schedulable". - logger.V(4).Info("pod is not schedulable", "pod", klog.KObj(pod), "claim", klog.KObj(modifiedParameters), "reason", err.Error()) - return framework.QueueSkip, nil - } - - if !usesParameters { - // This were not the parameters the pod was waiting for. - logger.V(6).Info("unrelated claim parameters got modified", "pod", klog.KObj(pod), "claimParameters", klog.KObj(modifiedParameters)) - return framework.QueueSkip, nil - } - - if originalParameters == nil { - logger.V(4).Info("claim parameters for pod got created", "pod", klog.KObj(pod), "claimParameters", klog.KObj(modifiedParameters)) - return framework.Queue, nil - } - - // Modifications may or may not be relevant. If the entire - // requests are as before, then something else must have changed - // and we don't care. - if apiequality.Semantic.DeepEqual(&originalParameters.DriverRequests, &modifiedParameters.DriverRequests) { - logger.V(6).Info("claim parameters for pod got modified where the pod doesn't care", "pod", klog.KObj(pod), "claimParameters", klog.KObj(modifiedParameters)) - return framework.QueueSkip, nil - } - - logger.V(4).Info("requests in claim parameters for pod got updated", "pod", klog.KObj(pod), "claimParameters", klog.KObj(modifiedParameters)) - return framework.Queue, nil -} - -// isSchedulableAfterClassParametersChange is invoked for add and update class parameters events reported by -// an informer. It checks whether that change made a previously unschedulable -// pod schedulable. It errs on the side of letting a pod scheduling attempt -// happen. The delete class event will not invoke it, so newObj will never be nil. -func (pl *dynamicResources) isSchedulableAfterClassParametersChange(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { - originalParameters, modifiedParameters, err := schedutil.As[*resourcev1alpha2.ResourceClassParameters](oldObj, newObj) - if err != nil { - // Shouldn't happen. - return framework.Queue, fmt.Errorf("unexpected object in isSchedulableAfterClassParametersChange: %w", err) - } - - usesParameters := false - if err := pl.foreachPodResourceClaim(pod, func(_ string, claim *resourcev1alpha2.ResourceClaim) { - class, err := pl.classLister.Get(claim.Spec.ResourceClassName) - if err != nil { - if !apierrors.IsNotFound(err) { - logger.Error(err, "look up resource class") - } - return - } - ref := class.ParametersRef - if ref == nil { - return - } - - // Using in-tree parameters directly? - if ref.APIGroup == resourcev1alpha2.SchemeGroupVersion.Group && - ref.Kind == "ResourceClassParameters" { - if modifiedParameters.Name == ref.Name { - usesParameters = true - } - return - } - - // Need to look for translated parameters. - generatedFrom := modifiedParameters.GeneratedFrom - if generatedFrom == nil { - return - } - if generatedFrom.APIGroup == ref.APIGroup && - generatedFrom.Kind == ref.Kind && - generatedFrom.Name == ref.Name { - usesParameters = true - } - }); err != nil { - // This is not an unexpected error: we know that - // foreachPodResourceClaim only returns errors for "not - // schedulable". - logger.V(4).Info("pod is not schedulable", "pod", klog.KObj(pod), "classParameters", klog.KObj(modifiedParameters), "reason", err.Error()) - return framework.QueueSkip, nil - } - - if !usesParameters { - // This were not the parameters the pod was waiting for. - logger.V(6).Info("unrelated class parameters got modified", "pod", klog.KObj(pod), "classParameters", klog.KObj(modifiedParameters)) - return framework.QueueSkip, nil - } - - if originalParameters == nil { - logger.V(4).Info("class parameters for pod got created", "pod", klog.KObj(pod), "class", klog.KObj(modifiedParameters)) - return framework.Queue, nil - } - - // Modifications may or may not be relevant. If the entire - // requests are as before, then something else must have changed - // and we don't care. - if apiequality.Semantic.DeepEqual(&originalParameters.Filters, &modifiedParameters.Filters) { - logger.V(6).Info("class parameters for pod got modified where the pod doesn't care", "pod", klog.KObj(pod), "classParameters", klog.KObj(modifiedParameters)) - return framework.QueueSkip, nil - } - - logger.V(4).Info("filters in class parameters for pod got updated", "pod", klog.KObj(pod), "classParameters", klog.KObj(modifiedParameters)) - return framework.Queue, nil -} - // isSchedulableAfterClaimChange is invoked for add and update claim events reported by // an informer. It checks whether that change made a previously unschedulable // pod schedulable. It errs on the side of letting a pod scheduling attempt // happen. The delete claim event will not invoke it, so newObj will never be nil. func (pl *dynamicResources) isSchedulableAfterClaimChange(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { - originalClaim, modifiedClaim, err := schedutil.As[*resourcev1alpha2.ResourceClaim](oldObj, newObj) + originalClaim, modifiedClaim, err := schedutil.As[*resourceapi.ResourceClaim](oldObj, newObj) if err != nil { // Shouldn't happen. return framework.Queue, fmt.Errorf("unexpected object in isSchedulableAfterClaimChange: %w", err) } usesClaim := false - if err := pl.foreachPodResourceClaim(pod, func(_ string, claim *resourcev1alpha2.ResourceClaim) { + if err := pl.foreachPodResourceClaim(pod, func(_ string, claim *resourceapi.ResourceClaim) { if claim.UID == modifiedClaim.UID { usesClaim = true } @@ -641,7 +440,8 @@ func (pl *dynamicResources) isSchedulableAfterClaimChange(logger klog.Logger, po } if originalClaim != nil && - resourceclaim.IsAllocatedWithStructuredParameters(originalClaim) && + originalClaim.Status.Allocation != nil && + originalClaim.Status.Allocation.Controller == "" && modifiedClaim.Status.Allocation == nil { // A claim with structured parameters was deallocated. This might have made // resources available for other pods. @@ -694,7 +494,7 @@ func (pl *dynamicResources) isSchedulableAfterPodSchedulingContextChange(logger return framework.QueueSkip, nil } - oldPodScheduling, newPodScheduling, err := schedutil.As[*resourcev1alpha2.PodSchedulingContext](oldObj, newObj) + oldPodScheduling, newPodScheduling, err := schedutil.As[*resourceapi.PodSchedulingContext](oldObj, newObj) if err != nil { // Shouldn't happen. return framework.Queue, fmt.Errorf("unexpected object in isSchedulableAfterPodSchedulingContextChange: %w", err) @@ -712,9 +512,8 @@ func (pl *dynamicResources) isSchedulableAfterPodSchedulingContextChange(logger // immediately if this occurred for the first time, otherwise // we allow backoff. pendingDelayedClaims := 0 - if err := pl.foreachPodResourceClaim(pod, func(podResourceName string, claim *resourcev1alpha2.ResourceClaim) { - if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer && - claim.Status.Allocation == nil && + if err := pl.foreachPodResourceClaim(pod, func(podResourceName string, claim *resourceapi.ResourceClaim) { + if claim.Status.Allocation == nil && !podSchedulingHasClaimInfo(podScheduling, podResourceName) { pendingDelayedClaims++ } @@ -796,7 +595,7 @@ func (pl *dynamicResources) isSchedulableAfterPodSchedulingContextChange(logger } -func podSchedulingHasClaimInfo(podScheduling *resourcev1alpha2.PodSchedulingContext, podResourceName string) bool { +func podSchedulingHasClaimInfo(podScheduling *resourceapi.PodSchedulingContext, podResourceName string) bool { for _, claimStatus := range podScheduling.Status.ResourceClaims { if claimStatus.Name == podResourceName { return true @@ -806,9 +605,9 @@ func podSchedulingHasClaimInfo(podScheduling *resourcev1alpha2.PodSchedulingCont } // podResourceClaims returns the ResourceClaims for all pod.Spec.PodResourceClaims. -func (pl *dynamicResources) podResourceClaims(pod *v1.Pod) ([]*resourcev1alpha2.ResourceClaim, error) { - claims := make([]*resourcev1alpha2.ResourceClaim, 0, len(pod.Spec.ResourceClaims)) - if err := pl.foreachPodResourceClaim(pod, func(_ string, claim *resourcev1alpha2.ResourceClaim) { +func (pl *dynamicResources) podResourceClaims(pod *v1.Pod) ([]*resourceapi.ResourceClaim, error) { + claims := make([]*resourceapi.ResourceClaim, 0, len(pod.Spec.ResourceClaims)) + if err := pl.foreachPodResourceClaim(pod, func(_ string, claim *resourceapi.ResourceClaim) { // We store the pointer as returned by the lister. The // assumption is that if a claim gets modified while our code // runs, the cache will store a new pointer, not mutate the @@ -822,9 +621,9 @@ func (pl *dynamicResources) podResourceClaims(pod *v1.Pod) ([]*resourcev1alpha2. // foreachPodResourceClaim checks that each ResourceClaim for the pod exists. // It calls an optional handler for those claims that it finds. -func (pl *dynamicResources) foreachPodResourceClaim(pod *v1.Pod, cb func(podResourceName string, claim *resourcev1alpha2.ResourceClaim)) error { +func (pl *dynamicResources) foreachPodResourceClaim(pod *v1.Pod, cb func(podResourceName string, claim *resourceapi.ResourceClaim)) error { for _, resource := range pod.Spec.ResourceClaims { - claimName, mustCheckOwner, err := pl.claimNameLookup.Name(pod, &resource) + claimName, mustCheckOwner, err := resourceclaim.Name(pod, &resource) if err != nil { return err } @@ -839,7 +638,7 @@ func (pl *dynamicResources) foreachPodResourceClaim(pod *v1.Pod, cb func(podReso return err } - claim, ok := obj.(*resourcev1alpha2.ResourceClaim) + claim, ok := obj.(*resourceapi.ResourceClaim) if !ok { return fmt.Errorf("unexpected object type %T for assumed object %s/%s", obj, pod.Namespace, *claimName) } @@ -893,8 +692,10 @@ func (pl *dynamicResources) PreFilter(ctx context.Context, state *framework.Cycl return nil, statusError(logger, err) } + // All claims which the scheduler needs to allocate itself. + allocateClaims := make([]*resourceapi.ResourceClaim, 0, len(claims)) + s.informationsForClaim = make([]informationForClaim, len(claims)) - needResourceInformation := false for index, claim := range claims { if claim.Status.DeallocationRequested { // This will get resolved by the resource driver. @@ -908,44 +709,19 @@ func (pl *dynamicResources) PreFilter(ctx context.Context, state *framework.Cycl } if claim.Status.Allocation != nil { - if claim.Status.Allocation.AvailableOnNodes != nil { - nodeSelector, err := nodeaffinity.NewNodeSelector(claim.Status.Allocation.AvailableOnNodes) + s.informationsForClaim[index].structuredParameters = claim.Status.Allocation.Controller == "" + if claim.Status.Allocation.NodeSelector != nil { + nodeSelector, err := nodeaffinity.NewNodeSelector(claim.Status.Allocation.NodeSelector) if err != nil { return nil, statusError(logger, err) } - s.informationsForClaim[index].availableOnNode = nodeSelector + s.informationsForClaim[index].availableOnNodes = map[string]*nodeaffinity.NodeSelector{"": nodeSelector} } - - // The claim was allocated by the scheduler if it has the finalizer that is - // reserved for Kubernetes. - s.informationsForClaim[index].structuredParameters = slices.Contains(claim.Finalizers, resourcev1alpha2.Finalizer) } else { - // The ResourceClass might have a node filter. This is - // useful for trimming the initial set of potential - // nodes before we ask the driver(s) for information - // about the specific pod. - class, err := pl.classLister.Get(claim.Spec.ResourceClassName) - if err != nil { - // If the class cannot be retrieved, allocation cannot proceed. - if apierrors.IsNotFound(err) { - // Here we mark the pod as "unschedulable", so it'll sleep in - // the unscheduleable queue until a ResourceClass event occurs. - return nil, statusUnschedulable(logger, fmt.Sprintf("resource class %s does not exist", claim.Spec.ResourceClassName)) - } - // Other error, retry with backoff. - return nil, statusError(logger, fmt.Errorf("look up resource class: %v", err)) - } - if class.SuitableNodes != nil { - selector, err := nodeaffinity.NewNodeSelector(class.SuitableNodes) - if err != nil { - return nil, statusError(logger, err) - } - s.informationsForClaim[index].availableOnNode = selector - } - s.informationsForClaim[index].status = statusForClaim(s.podSchedulingState.schedulingCtx, pod.Spec.ResourceClaims[index].Name) - - if class.StructuredParameters != nil && *class.StructuredParameters { - s.informationsForClaim[index].structuredParameters = true + structuredParameters := claim.Spec.Controller == "" + s.informationsForClaim[index].structuredParameters = structuredParameters + if structuredParameters { + allocateClaims = append(allocateClaims, claim) // Allocation in flight? Better wait for that // to finish, see inFlightAllocations @@ -953,168 +729,92 @@ func (pl *dynamicResources) PreFilter(ctx context.Context, state *framework.Cycl if _, found := pl.inFlightAllocations.Load(claim.UID); found { return nil, statusUnschedulable(logger, fmt.Sprintf("resource claim %s is in the process of being allocated", klog.KObj(claim))) } + } else { + s.informationsForClaim[index].status = statusForClaim(s.podSchedulingState.schedulingCtx, pod.Spec.ResourceClaims[index].Name) + } - // We need the claim and class parameters. If - // they don't exist yet, the pod has to wait. - // - // TODO (https://github.com/kubernetes/kubernetes/issues/123697): - // check this already in foreachPodResourceClaim, together with setting up informationsForClaim. - // Then PreEnqueue will also check for existence of parameters. - classParameters, claimParameters, status := pl.lookupParameters(logger, class, claim) - if status != nil { - return nil, status + // Check all requests and device classes. If a class + // does not exist, scheduling cannot proceed, no matter + // how the claim is being allocated. + // + // When using a control plane controller, a class might + // have a node filter. This is useful for trimming the + // initial set of potential nodes before we ask the + // driver(s) for information about the specific pod. + for _, request := range claim.Spec.Devices.Requests { + if request.DeviceClassName == "" { + return nil, statusError(logger, fmt.Errorf("request %s: unsupported request type", request.Name)) } - controller, err := newClaimController(logger, class, classParameters, claimParameters) + + class, err := pl.classLister.Get(request.DeviceClassName) if err != nil { - return nil, statusError(logger, err) + // If the class cannot be retrieved, allocation cannot proceed. + if apierrors.IsNotFound(err) { + // Here we mark the pod as "unschedulable", so it'll sleep in + // the unscheduleable queue until a DeviceClass event occurs. + return nil, statusUnschedulable(logger, fmt.Sprintf("request %s: device class %s does not exist", request.Name, request.DeviceClassName)) + } + // Other error, retry with backoff. + return nil, statusError(logger, fmt.Errorf("request %s: look up device class: %w", request.Name, err)) + } + if class.Spec.SuitableNodes != nil && !structuredParameters { + selector, err := nodeaffinity.NewNodeSelector(class.Spec.SuitableNodes) + if err != nil { + return nil, statusError(logger, err) + } + if s.informationsForClaim[index].availableOnNodes == nil { + s.informationsForClaim[index].availableOnNodes = make(map[string]*nodeaffinity.NodeSelector) + } + s.informationsForClaim[index].availableOnNodes[class.Name] = selector } - s.informationsForClaim[index].controller = controller - needResourceInformation = true - } else if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeImmediate { - // This will get resolved by the resource driver. - return nil, statusUnschedulable(logger, "unallocated immediate resourceclaim", "pod", klog.KObj(pod), "resourceclaim", klog.KObj(claim)) } } } - if needResourceInformation { + if len(allocateClaims) > 0 { + logger.V(5).Info("Preparing allocation with structured parameters", "pod", klog.KObj(pod), "resourceclaims", klog.KObjSlice(allocateClaims)) + // Doing this over and over again for each pod could be avoided - // by parsing once when creating the plugin and then updating - // that state in informer callbacks. But that would cause - // problems for using the plugin in the Cluster Autoscaler. If - // this step here turns out to be expensive, we may have to - // maintain and update state more persistently. + // by setting the allocator up once and then keeping it up-to-date + // as changes are observed. + // + // But that would cause problems for using the plugin in the + // Cluster Autoscaler. If this step here turns out to be + // expensive, we may have to maintain and update state more + // persistently. // // Claims are treated as "allocated" if they are in the assume cache // or currently their allocation is in-flight. - resources, err := newResourceModel(logger, pl.resourceSliceLister, pl.claimAssumeCache, &pl.inFlightAllocations) - logger.V(5).Info("Resource usage", "resources", klog.Format(resources)) + allocator, err := structured.NewAllocator(ctx, allocateClaims, &claimListerForAssumeCache{assumeCache: pl.claimAssumeCache, inFlightAllocations: &pl.inFlightAllocations}, pl.classLister, pl.sliceLister) if err != nil { return nil, statusError(logger, err) } - s.resources = resources + s.allocator = allocator } s.claims = claims return nil, nil } -func (pl *dynamicResources) lookupParameters(logger klog.Logger, class *resourcev1alpha2.ResourceClass, claim *resourcev1alpha2.ResourceClaim) (classParameters *resourcev1alpha2.ResourceClassParameters, claimParameters *resourcev1alpha2.ResourceClaimParameters, status *framework.Status) { - classParameters, status = pl.lookupClassParameters(logger, class) - if status != nil { - return - } - claimParameters, status = pl.lookupClaimParameters(logger, class, claim) - return -} - -func (pl *dynamicResources) lookupClassParameters(logger klog.Logger, class *resourcev1alpha2.ResourceClass) (*resourcev1alpha2.ResourceClassParameters, *framework.Status) { - defaultClassParameters := resourcev1alpha2.ResourceClassParameters{} - - if class.ParametersRef == nil { - return &defaultClassParameters, nil - } - - if class.ParametersRef.APIGroup == resourcev1alpha2.SchemeGroupVersion.Group && - class.ParametersRef.Kind == "ResourceClassParameters" { - // Use the parameters which were referenced directly. - parameters, err := pl.classParametersLister.ResourceClassParameters(class.ParametersRef.Namespace).Get(class.ParametersRef.Name) - if err != nil { - if apierrors.IsNotFound(err) { - return nil, statusUnschedulable(logger, fmt.Sprintf("class parameters %s not found", klog.KRef(class.ParametersRef.Namespace, class.ParametersRef.Name))) - } - return nil, statusError(logger, fmt.Errorf("get class parameters %s: %v", klog.KRef(class.Namespace, class.ParametersRef.Name), err)) - } - return parameters, nil - } - - objs, err := pl.classParametersIndexer.ByIndex(generatedFromIndex, classParametersReferenceKeyFunc(class.ParametersRef)) - if err != nil { - return nil, statusError(logger, fmt.Errorf("listing class parameters failed: %v", err)) - } - switch len(objs) { - case 0: - return nil, statusUnschedulable(logger, fmt.Sprintf("generated class parameters for %s.%s %s not found", class.ParametersRef.Kind, class.ParametersRef.APIGroup, klog.KRef(class.ParametersRef.Namespace, class.ParametersRef.Name))) - case 1: - parameters, ok := objs[0].(*resourcev1alpha2.ResourceClassParameters) - if !ok { - return nil, statusError(logger, fmt.Errorf("unexpected object in class parameters index: %T", objs[0])) - } - return parameters, nil - default: - sort.Slice(objs, func(i, j int) bool { - obj1, obj2 := objs[i].(*resourcev1alpha2.ResourceClassParameters), objs[j].(*resourcev1alpha2.ResourceClassParameters) - if obj1 == nil || obj2 == nil { - return false - } - return obj1.Name < obj2.Name - }) - return nil, statusError(logger, fmt.Errorf("multiple generated class parameters for %s.%s %s found: %s", class.ParametersRef.Kind, class.ParametersRef.APIGroup, klog.KRef(class.Namespace, class.ParametersRef.Name), klog.KObjSlice(objs))) - } +type claimListerForAssumeCache struct { + assumeCache *assumecache.AssumeCache + inFlightAllocations *sync.Map } -func (pl *dynamicResources) lookupClaimParameters(logger klog.Logger, class *resourcev1alpha2.ResourceClass, claim *resourcev1alpha2.ResourceClaim) (*resourcev1alpha2.ResourceClaimParameters, *framework.Status) { - defaultClaimParameters := resourcev1alpha2.ResourceClaimParameters{ - Shareable: true, - DriverRequests: []resourcev1alpha2.DriverRequests{ - { - DriverName: class.DriverName, - Requests: []resourcev1alpha2.ResourceRequest{ - { - ResourceRequestModel: resourcev1alpha2.ResourceRequestModel{ - // TODO: This only works because NamedResources is - // the only model currently implemented. We need to - // match the default to how the resources of this - // class are being advertized in a ResourceSlice. - NamedResources: &resourcev1alpha2.NamedResourcesRequest{ - Selector: "true", - }, - }, - }, - }, - }, - }, - } - - if claim.Spec.ParametersRef == nil { - return &defaultClaimParameters, nil - } - if claim.Spec.ParametersRef.APIGroup == resourcev1alpha2.SchemeGroupVersion.Group && - claim.Spec.ParametersRef.Kind == "ResourceClaimParameters" { - // Use the parameters which were referenced directly. - parameters, err := pl.claimParametersLister.ResourceClaimParameters(claim.Namespace).Get(claim.Spec.ParametersRef.Name) - if err != nil { - if apierrors.IsNotFound(err) { - return nil, statusUnschedulable(logger, fmt.Sprintf("claim parameters %s not found", klog.KRef(claim.Namespace, claim.Spec.ParametersRef.Name))) - } - return nil, statusError(logger, fmt.Errorf("get claim parameters %s: %v", klog.KRef(claim.Namespace, claim.Spec.ParametersRef.Name), err)) +func (cl *claimListerForAssumeCache) ListAllAllocated() ([]*resourceapi.ResourceClaim, error) { + // Probably not worth adding an index for? + objs := cl.assumeCache.List(nil) + allocated := make([]*resourceapi.ResourceClaim, 0, len(objs)) + for _, obj := range objs { + claim := obj.(*resourceapi.ResourceClaim) + if obj, ok := cl.inFlightAllocations.Load(claim.UID); ok { + claim = obj.(*resourceapi.ResourceClaim) } - return parameters, nil - } - - objs, err := pl.claimParametersIndexer.ByIndex(generatedFromIndex, claimParametersReferenceKeyFunc(claim.Namespace, claim.Spec.ParametersRef)) - if err != nil { - return nil, statusError(logger, fmt.Errorf("listing claim parameters failed: %v", err)) - } - switch len(objs) { - case 0: - return nil, statusUnschedulable(logger, fmt.Sprintf("generated claim parameters for %s.%s %s not found", claim.Spec.ParametersRef.Kind, claim.Spec.ParametersRef.APIGroup, klog.KRef(claim.Namespace, claim.Spec.ParametersRef.Name))) - case 1: - parameters, ok := objs[0].(*resourcev1alpha2.ResourceClaimParameters) - if !ok { - return nil, statusError(logger, fmt.Errorf("unexpected object in claim parameters index: %T", objs[0])) + if claim.Status.Allocation != nil { + allocated = append(allocated, claim) } - return parameters, nil - default: - sort.Slice(objs, func(i, j int) bool { - obj1, obj2 := objs[i].(*resourcev1alpha2.ResourceClaimParameters), objs[j].(*resourcev1alpha2.ResourceClaimParameters) - if obj1 == nil || obj2 == nil { - return false - } - return obj1.Name < obj2.Name - }) - return nil, statusError(logger, fmt.Errorf("multiple generated claim parameters for %s.%s %s found: %s", claim.Spec.ParametersRef.Kind, claim.Spec.ParametersRef.APIGroup, klog.KRef(claim.Namespace, claim.Spec.ParametersRef.Name), klog.KObjSlice(objs))) } + return allocated, nil } // PreFilterExtensions returns prefilter extensions, pod add and remove. @@ -1161,78 +861,97 @@ func (pl *dynamicResources) Filter(ctx context.Context, cs *framework.CycleState var unavailableClaims []int for index, claim := range state.claims { logger.V(10).Info("filtering based on resource claims of the pod", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim)) - switch { - case claim.Status.Allocation != nil: - if nodeSelector := state.informationsForClaim[index].availableOnNode; nodeSelector != nil { + + if claim.Status.Allocation != nil { + for _, nodeSelector := range state.informationsForClaim[index].availableOnNodes { if !nodeSelector.Match(node) { logger.V(5).Info("AvailableOnNodes does not match", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim)) unavailableClaims = append(unavailableClaims, index) + break } } - case claim.Status.DeallocationRequested: + continue + } + + if claim.Status.DeallocationRequested { // We shouldn't get here. PreFilter already checked this. return statusUnschedulable(logger, "resourceclaim must be reallocated", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim)) - case claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer || - state.informationsForClaim[index].structuredParameters: - if selector := state.informationsForClaim[index].availableOnNode; selector != nil { - if matches := selector.Match(node); !matches { - return statusUnschedulable(logger, "excluded by resource class node filter", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclassName", claim.Spec.ResourceClassName) - } + } + + for className, nodeSelector := range state.informationsForClaim[index].availableOnNodes { + if !nodeSelector.Match(node) { + return statusUnschedulable(logger, "excluded by device class node filter", "pod", klog.KObj(pod), "node", klog.KObj(node), "deviceclass", klog.KRef("", className)) } - // Can the builtin controller tell us whether the node is suitable? - if state.informationsForClaim[index].structuredParameters { - suitable, err := state.informationsForClaim[index].controller.nodeIsSuitable(ctx, node.Name, state.resources) - if err != nil { - // An error indicates that something wasn't configured correctly, for example - // writing a CEL expression which doesn't handle a map lookup error. Normally - // this should never fail. We could return an error here, but then the pod - // would get retried. Instead we ignore the node. - return statusUnschedulable(logger, fmt.Sprintf("checking structured parameters failed: %v", err), "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim)) - } - if !suitable { - return statusUnschedulable(logger, "resourceclaim cannot be allocated for the node (unsuitable)", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim)) - } - } else { - if status := state.informationsForClaim[index].status; status != nil { - for _, unsuitableNode := range status.UnsuitableNodes { - if node.Name == unsuitableNode { - return statusUnschedulable(logger, "resourceclaim cannot be allocated for the node (unsuitable)", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim), "unsuitablenodes", status.UnsuitableNodes) - } - } + } + + // Use information from control plane controller? + if status := state.informationsForClaim[index].status; status != nil { + for _, unsuitableNode := range status.UnsuitableNodes { + if node.Name == unsuitableNode { + return statusUnschedulable(logger, "resourceclaim cannot be allocated for the node (unsuitable)", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaim", klog.KObj(claim), "unsuitablenodes", status.UnsuitableNodes) } } - default: - // This claim should have been handled above. - // Immediate allocation with control plane controller - // was already checked for in PreFilter. - return statusError(logger, fmt.Errorf("internal error, unexpected allocation mode %v", claim.Spec.AllocationMode)) } } - if len(unavailableClaims) > 0 { + // Use allocator to check the node and cache the result in case that the node is picked. + var allocations []*resourceapi.AllocationResult + if state.allocator != nil { + allocCtx := ctx + if loggerV := logger.V(5); loggerV.Enabled() { + allocCtx = klog.NewContext(allocCtx, klog.LoggerWithValues(logger, "node", klog.KObj(node))) + } + + // TODO: is emitting log output at V(4) okay in Filter? That is what the + // allocator does for one-time output. + + a, err := state.allocator.Allocate(allocCtx, node) + if err != nil { + // This should only fail if there is something wrong with the claim or class. + // Mark the pod as unschedulable until they get updated to fix the problem. + // + // Also record the error in the state to ensure that PreScore sees it and + // can prevent scheduling from continuing. + state.mutex.Lock() + defer state.mutex.Unlock() + state.filterErr = fmt.Errorf("filter node %s: %w", node.Name, err) + return statusUnschedulable(logger, err.Error(), "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaims", klog.KObjSlice(state.allocator.ClaimsToAllocate())) + } + // Check for exact length just to be sure. In practice this is all-or-nothing. + if len(a) != len(state.allocator.ClaimsToAllocate()) { + return statusUnschedulable(logger, "cannot allocate all claims", "pod", klog.KObj(pod), "node", klog.KObj(node), "resourceclaims", klog.KObjSlice(state.allocator.ClaimsToAllocate())) + } + // Reserve uses this information. + allocations = a + } + + // Store information in state while holding the mutex. + if state.allocator != nil || len(unavailableClaims) > 0 { state.mutex.Lock() defer state.mutex.Unlock() + } + + if len(unavailableClaims) > 0 { + // Remember all unavailable claims. This might be observed + // concurrently, so we have to lock the state before writing. + if state.unavailableClaims == nil { state.unavailableClaims = sets.New[int]() } for _, index := range unavailableClaims { - claim := state.claims[index] - // Deallocation makes more sense for claims with - // delayed allocation. Claims with immediate allocation - // would just get allocated again for a random node, - // which is unlikely to help the pod. - // - // Claims with builtin controller are handled like - // claims with delayed allocation. - if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer || - state.informationsForClaim[index].controller != nil { - state.unavailableClaims.Insert(index) - } + state.unavailableClaims.Insert(index) } return statusUnschedulable(logger, "resourceclaim not available on the node", "pod", klog.KObj(pod)) } + if state.allocator != nil { + if state.nodeAllocations == nil { + state.nodeAllocations = make(map[string][]*resourceapi.AllocationResult) + } + state.nodeAllocations[node.Name] = allocations + } + return nil } @@ -1282,13 +1001,12 @@ func (pl *dynamicResources) PostFilter(ctx context.Context, cs *framework.CycleS claim := claim.DeepCopy() claim.Status.ReservedFor = nil if clearAllocation { - claim.Status.DriverName = "" claim.Status.Allocation = nil } else { claim.Status.DeallocationRequested = true } logger.V(5).Info("Requesting deallocation of ResourceClaim", "pod", klog.KObj(pod), "resourceclaim", klog.KObj(claim)) - if _, err := pl.clientset.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}); err != nil { + if _, err := pl.clientset.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}); err != nil { return nil, statusError(logger, err) } return nil, framework.NewStatus(framework.Unschedulable, "deallocation of ResourceClaim completed") @@ -1316,10 +1034,13 @@ func (pl *dynamicResources) PreScore(ctx context.Context, cs *framework.CycleSta } logger := klog.FromContext(ctx) + if state.filterErr != nil { + return statusUnschedulable(logger, state.filterErr.Error()) + } pending := false for index, claim := range state.claims { if claim.Status.Allocation == nil && - state.informationsForClaim[index].controller == nil { + !state.informationsForClaim[index].structuredParameters { pending = true break } @@ -1340,8 +1061,8 @@ func (pl *dynamicResources) PreScore(ctx context.Context, cs *framework.CycleSta // is only a single node. logger.V(5).Info("remembering potential nodes", "pod", klog.KObj(pod), "potentialnodes", klog.KObjSlice(nodes)) numNodes := len(nodes) - if numNodes > resourcev1alpha2.PodSchedulingNodeListMaxSize { - numNodes = resourcev1alpha2.PodSchedulingNodeListMaxSize + if numNodes > resourceapi.PodSchedulingNodeListMaxSize { + numNodes = resourceapi.PodSchedulingNodeListMaxSize } potentialNodes := make([]string, 0, numNodes) if numNodes == len(nodes) { @@ -1359,7 +1080,7 @@ func (pl *dynamicResources) PreScore(ctx context.Context, cs *framework.CycleSta nodeNames[node.Node().Name] = struct{}{} } for nodeName := range nodeNames { - if len(potentialNodes) >= resourcev1alpha2.PodSchedulingNodeListMaxSize { + if len(potentialNodes) >= resourceapi.PodSchedulingNodeListMaxSize { break } potentialNodes = append(potentialNodes, nodeName) @@ -1370,7 +1091,7 @@ func (pl *dynamicResources) PreScore(ctx context.Context, cs *framework.CycleSta return nil } -func haveAllPotentialNodes(schedulingCtx *resourcev1alpha2.PodSchedulingContext, nodes []*framework.NodeInfo) bool { +func haveAllPotentialNodes(schedulingCtx *resourceapi.PodSchedulingContext, nodes []*framework.NodeInfo) bool { if schedulingCtx == nil { return false } @@ -1395,10 +1116,15 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat return nil } + logger := klog.FromContext(ctx) + // PreScore might not have been called when there was only one node. + if state.filterErr != nil { + return statusUnschedulable(logger, state.filterErr.Error()) + } + numDelayedAllocationPending := 0 numClaimsWithStatusInfo := 0 - claimsWithBuiltinController := make([]int, 0, len(state.claims)) - logger := klog.FromContext(ctx) + numClaimsWithAllocator := 0 for index, claim := range state.claims { if claim.Status.Allocation != nil { // Allocated, but perhaps not reserved yet. We checked in PreFilter that @@ -1409,9 +1135,9 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat continue } - // Do we have the builtin controller? - if state.informationsForClaim[index].controller != nil { - claimsWithBuiltinController = append(claimsWithBuiltinController, index) + // Do we use the allocator for it? + if state.informationsForClaim[index].structuredParameters { + numClaimsWithAllocator++ continue } @@ -1425,7 +1151,7 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat } } - if numDelayedAllocationPending == 0 && len(claimsWithBuiltinController) == 0 { + if numDelayedAllocationPending == 0 && numClaimsWithAllocator == 0 { // Nothing left to do. return nil } @@ -1446,27 +1172,41 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat } // Prepare allocation of claims handled by the schedulder. - for _, index := range claimsWithBuiltinController { - claim := state.claims[index] - driverName, allocation, err := state.informationsForClaim[index].controller.allocate(ctx, nodeName, state.resources) - if err != nil { + if state.allocator != nil { + // Entries in these two slices match each other. + claimsToAllocate := state.allocator.ClaimsToAllocate() + allocations, ok := state.nodeAllocations[nodeName] + if !ok { // We checked before that the node is suitable. This shouldn't have failed, // so treat this as an error. - return statusError(logger, fmt.Errorf("claim allocation failed unexpectedly: %v", err)) + return statusError(logger, errors.New("claim allocation not found for node")) + } + + // Sanity check: do we have results for all pending claims? + if len(allocations) != len(claimsToAllocate) || + len(allocations) != numClaimsWithAllocator { + return statusError(logger, fmt.Errorf("internal error, have %d allocations, %d claims to allocate, want %d claims", len(allocations), len(claimsToAllocate), numClaimsWithAllocator)) } - state.informationsForClaim[index].allocation = allocation - state.informationsForClaim[index].allocationDriverName = driverName - // Strictly speaking, we don't need to store the full modified object. - // The allocation would be enough. The full object is useful for - // debugging and testing, so let's make it realistic. - claim = claim.DeepCopy() - if !slices.Contains(claim.Finalizers, resourcev1alpha2.Finalizer) { - claim.Finalizers = append(claim.Finalizers, resourcev1alpha2.Finalizer) + + for i, claim := range claimsToAllocate { + index := slices.Index(state.claims, claim) + if index < 0 { + return statusError(logger, fmt.Errorf("internal error, claim %s with allocation not found", claim.Name)) + } + allocation := allocations[i] + state.informationsForClaim[index].allocation = allocation + + // Strictly speaking, we don't need to store the full modified object. + // The allocation would be enough. The full object is useful for + // debugging, testing and the allocator, so let's make it realistic. + claim = claim.DeepCopy() + if !slices.Contains(claim.Finalizers, resourceapi.Finalizer) { + claim.Finalizers = append(claim.Finalizers, resourceapi.Finalizer) + } + claim.Status.Allocation = allocation + pl.inFlightAllocations.Store(claim.UID, claim) + logger.V(5).Info("Reserved resource in allocation result", "claim", klog.KObj(claim), "allocation", klog.Format(allocation)) } - claim.Status.DriverName = driverName - claim.Status.Allocation = allocation - pl.inFlightAllocations.Store(claim.UID, claim) - logger.V(5).Info("Reserved resource in allocation result", "claim", klog.KObj(claim), "driver", driverName, "allocation", klog.Format(allocation)) } // When there is only one pending resource, we can go ahead with @@ -1476,8 +1216,8 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat // // If all pending claims are handled with the builtin controller, // there is no need for a PodSchedulingContext change. - if numDelayedAllocationPending == 1 && len(claimsWithBuiltinController) == 0 || - numClaimsWithStatusInfo+len(claimsWithBuiltinController) == numDelayedAllocationPending && len(claimsWithBuiltinController) < numDelayedAllocationPending { + if numDelayedAllocationPending == 1 && numClaimsWithAllocator == 0 || + numClaimsWithStatusInfo+numClaimsWithAllocator == numDelayedAllocationPending && numClaimsWithAllocator < numDelayedAllocationPending { // TODO: can we increase the chance that the scheduler picks // the same node as before when allocation is on-going, // assuming that that node still fits the pod? Picking a @@ -1546,7 +1286,7 @@ func (pl *dynamicResources) Unreserve(ctx context.Context, cs *framework.CycleSt for index, claim := range state.claims { // If allocation was in-flight, then it's not anymore and we need to revert the // claim object in the assume cache to what it was before. - if state.informationsForClaim[index].controller != nil { + if state.informationsForClaim[index].structuredParameters { if _, found := pl.inFlightAllocations.LoadAndDelete(state.claims[index].UID); found { pl.claimAssumeCache.Restore(claim.Namespace + "/" + claim.Name) } @@ -1562,7 +1302,7 @@ func (pl *dynamicResources) Unreserve(ctx context.Context, cs *framework.CycleSt pod.UID, ) logger.V(5).Info("unreserve", "resourceclaim", klog.KObj(claim), "pod", klog.KObj(pod)) - claim, err := pl.clientset.ResourceV1alpha2().ResourceClaims(claim.Namespace).Patch(ctx, claim.Name, types.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{}, "status") + claim, err := pl.clientset.ResourceV1alpha3().ResourceClaims(claim.Namespace).Patch(ctx, claim.Name, types.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{}, "status") if err != nil { // We will get here again when pod scheduling is retried. logger.Error(err, "unreserve", "resourceclaim", klog.KObj(claim)) @@ -1619,7 +1359,7 @@ func (pl *dynamicResources) PreBind(ctx context.Context, cs *framework.CycleStat // bindClaim gets called by PreBind for claim which is not reserved for the pod yet. // It might not even be allocated. bindClaim then ensures that the allocation // and reservation are recorded. This finishes the work started in Reserve. -func (pl *dynamicResources) bindClaim(ctx context.Context, state *stateData, index int, pod *v1.Pod, nodeName string) (patchedClaim *resourcev1alpha2.ResourceClaim, finalErr error) { +func (pl *dynamicResources) bindClaim(ctx context.Context, state *stateData, index int, pod *v1.Pod, nodeName string) (patchedClaim *resourceapi.ResourceClaim, finalErr error) { logger := klog.FromContext(ctx) claim := state.claims[index].DeepCopy() allocation := state.informationsForClaim[index].allocation @@ -1646,7 +1386,7 @@ func (pl *dynamicResources) bindClaim(ctx context.Context, state *stateData, ind refreshClaim := false retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { if refreshClaim { - updatedClaim, err := pl.clientset.ResourceV1alpha2().ResourceClaims(claim.Namespace).Get(ctx, claim.Name, metav1.GetOptions{}) + updatedClaim, err := pl.clientset.ResourceV1alpha3().ResourceClaims(claim.Namespace).Get(ctx, claim.Name, metav1.GetOptions{}) if err != nil { return fmt.Errorf("get updated claim %s after conflict: %w", klog.KObj(claim), err) } @@ -1669,24 +1409,22 @@ func (pl *dynamicResources) bindClaim(ctx context.Context, state *stateData, ind // The finalizer needs to be added in a normal update. // If we were interrupted in the past, it might already be set and we simply continue. - if !slices.Contains(claim.Finalizers, resourcev1alpha2.Finalizer) { - claim.Finalizers = append(claim.Finalizers, resourcev1alpha2.Finalizer) - updatedClaim, err := pl.clientset.ResourceV1alpha2().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) + if !slices.Contains(claim.Finalizers, resourceapi.Finalizer) { + claim.Finalizers = append(claim.Finalizers, resourceapi.Finalizer) + updatedClaim, err := pl.clientset.ResourceV1alpha3().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) if err != nil { return fmt.Errorf("add finalizer to claim %s: %w", klog.KObj(claim), err) } claim = updatedClaim } - - claim.Status.DriverName = state.informationsForClaim[index].allocationDriverName claim.Status.Allocation = allocation } // We can simply try to add the pod here without checking // preconditions. The apiserver will tell us with a // non-conflict error if this isn't possible. - claim.Status.ReservedFor = append(claim.Status.ReservedFor, resourcev1alpha2.ResourceClaimConsumerReference{Resource: "pods", Name: pod.Name, UID: pod.UID}) - updatedClaim, err := pl.clientset.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) + claim.Status.ReservedFor = append(claim.Status.ReservedFor, resourceapi.ResourceClaimConsumerReference{Resource: "pods", Name: pod.Name, UID: pod.UID}) + updatedClaim, err := pl.clientset.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) if err != nil { if allocation != nil { return fmt.Errorf("add allocation and reservation to claim %s: %w", klog.KObj(claim), err) @@ -1727,7 +1465,7 @@ func (pl *dynamicResources) PostBind(ctx context.Context, cs *framework.CycleSta // have it in our informer cache yet. Let's try to delete, just to be // on the safe side. logger := klog.FromContext(ctx) - err = pl.clientset.ResourceV1alpha2().PodSchedulingContexts(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{}) + err = pl.clientset.ResourceV1alpha3().PodSchedulingContexts(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{}) switch { case apierrors.IsNotFound(err): logger.V(5).Info("no PodSchedulingContext object to delete") diff --git a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go index fb46fb443bde7..439e650500441 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go @@ -31,10 +31,9 @@ import ( "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" apiruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" @@ -52,6 +51,11 @@ import ( var ( podKind = v1.SchemeGroupVersion.WithKind("Pod") + nodeName = "worker" + node2Name = "worker-2" + node3Name = "worker-3" + controller = "some-driver" + driver = controller podName = "my-pod" podUID = "1234" resourceName = "my-resource" @@ -60,55 +64,18 @@ var ( claimName2 = podName + "-" + resourceName + "-2" className = "my-resource-class" namespace = "default" + attrName = resourceapi.QualifiedName("healthy") // device attribute only available on non-default node - resourceClass = &resourcev1alpha2.ResourceClass{ + deviceClass = &resourceapi.DeviceClass{ ObjectMeta: metav1.ObjectMeta{ Name: className, }, - DriverName: "some-driver", - } - structuredResourceClass = &resourcev1alpha2.ResourceClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: className, - }, - DriverName: "some-driver", - StructuredParameters: ptr.To(true), - } - structuredResourceClassWithParams = &resourcev1alpha2.ResourceClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: className, - }, - DriverName: "some-driver", - StructuredParameters: ptr.To(true), - ParametersRef: &resourcev1alpha2.ResourceClassParametersReference{ - Name: className, - Namespace: namespace, - Kind: "ResourceClassParameters", - APIGroup: "resource.k8s.io", - }, - } - structuredResourceClassWithCRD = &resourcev1alpha2.ResourceClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: className, - }, - DriverName: "some-driver", - StructuredParameters: ptr.To(true), - ParametersRef: &resourcev1alpha2.ResourceClassParametersReference{ - Name: className, - Namespace: namespace, - Kind: "ResourceClassParameters", - APIGroup: "example.com", - }, } podWithClaimName = st.MakePod().Name(podName).Namespace(namespace). UID(podUID). PodResourceClaims(v1.PodResourceClaim{Name: resourceName, ResourceClaimName: &claimName}). Obj() - otherPodWithClaimName = st.MakePod().Name(podName).Namespace(namespace). - UID(podUID + "-II"). - PodResourceClaims(v1.PodResourceClaim{Name: resourceName, ResourceClaimName: &claimName}). - Obj() podWithClaimTemplate = st.MakePod().Name(podName).Namespace(namespace). UID(podUID). PodResourceClaims(v1.PodResourceClaim{Name: resourceName, ResourceClaimTemplateName: &claimName}). @@ -129,100 +96,76 @@ var ( PodResourceClaims(v1.PodResourceClaim{Name: resourceName2, ResourceClaimName: &claimName2}). Obj() - workerNode = &st.MakeNode().Name("worker").Label("kubernetes.io/hostname", "worker").Node - workerNodeSlice = st.MakeResourceSlice("worker", "some-driver").NamedResourcesInstances("instance-1").Obj() - - claimParameters = st.MakeClaimParameters().Name(claimName).Namespace(namespace). - NamedResourcesRequests("some-driver", "true"). - Shareable(true). - GeneratedFrom(&resourcev1alpha2.ResourceClaimParametersReference{ - Name: claimName, - Kind: "ResourceClaimParameters", - APIGroup: "example.com", - }). - Obj() - claimParametersOtherNamespace = st.MakeClaimParameters().Name(claimName).Namespace(namespace+"-2"). - NamedResourcesRequests("some-driver", "true"). - Shareable(true). - GeneratedFrom(&resourcev1alpha2.ResourceClaimParametersReference{ - Name: claimName, - Kind: "ResourceClaimParameters", - APIGroup: "example.com", - }). - Obj() - classParameters = st.MakeClassParameters().Name(className).Namespace(namespace). - NamedResourcesFilters("some-driver", "true"). - GeneratedFrom(&resourcev1alpha2.ResourceClassParametersReference{ - Name: className, - Namespace: namespace, - Kind: "ResourceClassParameters", - APIGroup: "example.com", - }). - Obj() + // Node with "instance-1" device and no device attributes. + workerNode = &st.MakeNode().Name(nodeName).Label("kubernetes.io/hostname", nodeName).Node + workerNodeSlice = st.MakeResourceSlice(nodeName, driver).Device("instance-1", nil).Obj() - claim = st.MakeResourceClaim(). + // Node with same device, but now with a "healthy" boolean attribute. + workerNode2 = &st.MakeNode().Name(node2Name).Label("kubernetes.io/hostname", node2Name).Node + workerNode2Slice = st.MakeResourceSlice(node2Name, driver).Device("instance-1", map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{attrName: {BoolValue: ptr.To(true)}}).Obj() + + // Yet another node, same as the second one. + workerNode3 = &st.MakeNode().Name(node3Name).Label("kubernetes.io/hostname", node3Name).Node + workerNode3Slice = st.MakeResourceSlice(node3Name, driver).Device("instance-1", map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{attrName: {BoolValue: ptr.To(true)}}).Obj() + + brokenSelector = resourceapi.DeviceSelector{ + CEL: &resourceapi.CELDeviceSelector{ + // Not set for workerNode. + Expression: fmt.Sprintf(`device.attributes["%s"].%s`, driver, attrName), + }, + } + + claim = st.MakeResourceClaim(controller). Name(claimName). Namespace(namespace). - ResourceClassName(className). + Request(className). Obj() - pendingImmediateClaim = st.FromResourceClaim(claim). - AllocationMode(resourcev1alpha2.AllocationModeImmediate). - Obj() - structuredAllocatedImmediateClaim = st.FromResourceClaim(pendingImmediateClaim). - Allocation("some-driver", &resourcev1alpha2.AllocationResult{}). - Structured("worker", "instance-1"). - Obj() - pendingDelayedClaim = st.FromResourceClaim(claim). - OwnerReference(podName, podUID, podKind). - AllocationMode(resourcev1alpha2.AllocationModeWaitForFirstConsumer). - Obj() - pendingDelayedClaim2 = st.FromResourceClaim(pendingDelayedClaim). - Name(claimName2). - Obj() - deallocatingClaim = st.FromResourceClaim(pendingImmediateClaim). - Allocation("some-driver", &resourcev1alpha2.AllocationResult{}). + pendingClaim = st.FromResourceClaim(claim). + OwnerReference(podName, podUID, podKind). + Obj() + pendingClaim2 = st.FromResourceClaim(pendingClaim). + Name(claimName2). + Obj() + allocationResult = &resourceapi.AllocationResult{ + Controller: controller, + Devices: resourceapi.DeviceAllocationResult{ + Results: []resourceapi.DeviceRequestAllocationResult{{ + Driver: driver, + Pool: nodeName, + Device: "instance-1", + Request: "req-1", + }}, + }, + } + deallocatingClaim = st.FromResourceClaim(pendingClaim). + Allocation(allocationResult). DeallocationRequested(true). Obj() - inUseClaim = st.FromResourceClaim(pendingImmediateClaim). - Allocation("some-driver", &resourcev1alpha2.AllocationResult{}). + inUseClaim = st.FromResourceClaim(pendingClaim). + Allocation(allocationResult). ReservedForPod(podName, types.UID(podUID)). Obj() structuredInUseClaim = st.FromResourceClaim(inUseClaim). - Structured("worker", "instance-1"). + Structured(). Obj() - allocatedClaim = st.FromResourceClaim(pendingDelayedClaim). - Allocation("some-driver", &resourcev1alpha2.AllocationResult{}). + allocatedClaim = st.FromResourceClaim(pendingClaim). + Allocation(allocationResult). Obj() - pendingDelayedClaimWithParams = st.FromResourceClaim(pendingDelayedClaim).ParametersRef(claimName).Obj() - structuredAllocatedClaim = st.FromResourceClaim(allocatedClaim).Structured("worker", "instance-1").Obj() - structuredAllocatedClaimWithParams = st.FromResourceClaim(structuredAllocatedClaim).ParametersRef(claimName).Obj() - - otherStructuredAllocatedClaim = st.FromResourceClaim(structuredAllocatedClaim).Name(structuredAllocatedClaim.Name + "-other").Obj() - - allocatedDelayedClaimWithWrongTopology = st.FromResourceClaim(allocatedClaim). - Allocation("some-driver", &resourcev1alpha2.AllocationResult{AvailableOnNodes: st.MakeNodeSelector().In("no-such-label", []string{"no-such-value"}).Obj()}). - Obj() - structuredAllocatedDelayedClaimWithWrongTopology = st.FromResourceClaim(allocatedDelayedClaimWithWrongTopology). - Structured("worker-2", "instance-1"). - Obj() - allocatedImmediateClaimWithWrongTopology = st.FromResourceClaim(allocatedDelayedClaimWithWrongTopology). - AllocationMode(resourcev1alpha2.AllocationModeImmediate). - Obj() - structuredAllocatedImmediateClaimWithWrongTopology = st.FromResourceClaim(allocatedImmediateClaimWithWrongTopology). - Structured("worker-2", "instance-1"). - Obj() + allocatedClaimWithWrongTopology = st.FromResourceClaim(allocatedClaim). + Allocation(&resourceapi.AllocationResult{Controller: controller, NodeSelector: st.MakeNodeSelector().In("no-such-label", []string{"no-such-value"}).Obj()}). + Obj() allocatedClaimWithGoodTopology = st.FromResourceClaim(allocatedClaim). - Allocation("some-driver", &resourcev1alpha2.AllocationResult{AvailableOnNodes: st.MakeNodeSelector().In("kubernetes.io/hostname", []string{"worker"}).Obj()}). + Allocation(&resourceapi.AllocationResult{Controller: controller, NodeSelector: st.MakeNodeSelector().In("kubernetes.io/hostname", []string{nodeName}).Obj()}). Obj() - structuredAllocatedClaimWithGoodTopology = st.FromResourceClaim(allocatedClaimWithGoodTopology). - Structured("worker", "instance-1"). - Obj() - otherClaim = st.MakeResourceClaim(). + otherClaim = st.MakeResourceClaim(controller). Name("not-my-claim"). Namespace(namespace). - ResourceClassName(className). + Request(className). Obj() + otherAllocatedClaim = st.FromResourceClaim(otherClaim). + Allocation(allocationResult). + Obj() scheduling = st.MakePodSchedulingContexts().Name(podName).Namespace(namespace). OwnerReference(podName, podUID, podKind). @@ -234,47 +177,46 @@ var ( SelectedNode(workerNode.Name). Obj() schedulingInfo = st.FromPodSchedulingContexts(schedulingPotential). - ResourceClaims(resourcev1alpha2.ResourceClaimSchedulingStatus{Name: resourceName}, - resourcev1alpha2.ResourceClaimSchedulingStatus{Name: resourceName2}). + ResourceClaims(resourceapi.ResourceClaimSchedulingStatus{Name: resourceName}, + resourceapi.ResourceClaimSchedulingStatus{Name: resourceName2}). Obj() ) -func reserve(claim *resourcev1alpha2.ResourceClaim, pod *v1.Pod) *resourcev1alpha2.ResourceClaim { +func reserve(claim *resourceapi.ResourceClaim, pod *v1.Pod) *resourceapi.ResourceClaim { return st.FromResourceClaim(claim). ReservedForPod(pod.Name, types.UID(pod.UID)). Obj() } -// claimWithCRD replaces the in-tree group with "example.com". -func claimWithCRD(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { - claim = claim.DeepCopy() - claim.Spec.ParametersRef.APIGroup = "example.com" - return claim -} - -// classWithCRD replaces the in-tree group with "example.com". -func classWithCRD(class *resourcev1alpha2.ResourceClass) *resourcev1alpha2.ResourceClass { - class = class.DeepCopy() - class.ParametersRef.APIGroup = "example.com" - return class +func structuredClaim(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { + return st.FromResourceClaim(claim). + Structured(). + Obj() } -func breakCELInClaimParameters(parameters *resourcev1alpha2.ResourceClaimParameters) *resourcev1alpha2.ResourceClaimParameters { - parameters = parameters.DeepCopy() - for i := range parameters.DriverRequests { - for e := range parameters.DriverRequests[i].Requests { - parameters.DriverRequests[i].Requests[e].NamedResources.Selector = `attributes.bool["no-such-attribute"]` +func breakCELInClaim(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { + claim = claim.DeepCopy() + for i := range claim.Spec.Devices.Requests { + for e := range claim.Spec.Devices.Requests[i].Selectors { + claim.Spec.Devices.Requests[i].Selectors[e] = brokenSelector + } + if len(claim.Spec.Devices.Requests[i].Selectors) == 0 { + claim.Spec.Devices.Requests[i].Selectors = []resourceapi.DeviceSelector{brokenSelector} } } - return parameters + return claim } -func breakCELInClassParameters(parameters *resourcev1alpha2.ResourceClassParameters) *resourcev1alpha2.ResourceClassParameters { - parameters = parameters.DeepCopy() - for i := range parameters.Filters { - parameters.Filters[i].NamedResources.Selector = `attributes.bool["no-such-attribute"]` +func breakCELInClass(class *resourceapi.DeviceClass) *resourceapi.DeviceClass { + class = class.DeepCopy() + for i := range class.Spec.Selectors { + class.Spec.Selectors[i] = brokenSelector + } + if len(class.Spec.Selectors) == 0 { + class.Spec.Selectors = []resourceapi.DeviceSelector{brokenSelector} } - return parameters + + return class } // result defines the expected outcome of some operation. It covers @@ -294,19 +236,19 @@ type result struct { // assumedClaim is the one claim which is expected to be assumed, // nil if none. - assumedClaim *resourcev1alpha2.ResourceClaim + assumedClaim *resourceapi.ResourceClaim // inFlightClaim is the one claim which is expected to be tracked as // in flight, nil if none. - inFlightClaim *resourcev1alpha2.ResourceClaim + inFlightClaim *resourceapi.ResourceClaim } // change contains functions for modifying objects of a certain type. These // functions will get called for all objects of that type. If they needs to // make changes only to a particular instance, then it must check the name. type change struct { - scheduling func(*resourcev1alpha2.PodSchedulingContext) *resourcev1alpha2.PodSchedulingContext - claim func(*resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim + scheduling func(*resourceapi.PodSchedulingContext) *resourceapi.PodSchedulingContext + claim func(*resourceapi.ResourceClaim) *resourceapi.ResourceClaim } type perNodeResult map[string]result @@ -357,9 +299,9 @@ func TestPlugin(t *testing.T) { testcases := map[string]struct { nodes []*v1.Node // default if unset is workerNode pod *v1.Pod - claims []*resourcev1alpha2.ResourceClaim - classes []*resourcev1alpha2.ResourceClass - schedulings []*resourcev1alpha2.PodSchedulingContext + claims []*resourceapi.ResourceClaim + classes []*resourceapi.DeviceClass + schedulings []*resourceapi.PodSchedulingContext // objs get stored directly in the fake client, without passing // through reactors, in contrast to the types above. @@ -382,11 +324,11 @@ func TestPlugin(t *testing.T) { }, "claim-reference": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaim, otherClaim}, + claims: []*resourceapi.ResourceClaim{allocatedClaim, otherClaim}, want: want{ prebind: result{ changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() claim.Status.ReservedFor = inUseClaim.Status.ReservedFor @@ -399,11 +341,11 @@ func TestPlugin(t *testing.T) { }, "claim-reference-structured": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{structuredAllocatedClaim, otherClaim}, + claims: []*resourceapi.ResourceClaim{structuredClaim(allocatedClaim), otherClaim}, want: want{ prebind: result{ changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() claim.Status.ReservedFor = inUseClaim.Status.ReservedFor @@ -416,11 +358,11 @@ func TestPlugin(t *testing.T) { }, "claim-template": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaim, otherClaim}, + claims: []*resourceapi.ResourceClaim{allocatedClaim, otherClaim}, want: want{ prebind: result{ changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() claim.Status.ReservedFor = inUseClaim.Status.ReservedFor @@ -433,11 +375,11 @@ func TestPlugin(t *testing.T) { }, "claim-template-structured": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{structuredAllocatedClaim, otherClaim}, + claims: []*resourceapi.ResourceClaim{structuredClaim(allocatedClaim), otherClaim}, want: want{ prebind: result{ changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() claim.Status.ReservedFor = inUseClaim.Status.ReservedFor @@ -450,7 +392,7 @@ func TestPlugin(t *testing.T) { }, "missing-claim": { pod: podWithClaimTemplate, // status not set - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaim, otherClaim}, + claims: []*resourceapi.ResourceClaim{allocatedClaim, otherClaim}, want: want{ preenqueue: result{ status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `pod "default/my-pod": ResourceClaim not created yet`), @@ -459,10 +401,10 @@ func TestPlugin(t *testing.T) { }, "deleted-claim": { pod: podWithClaimTemplateInStatus, - claims: func() []*resourcev1alpha2.ResourceClaim { + claims: func() []*resourceapi.ResourceClaim { claim := allocatedClaim.DeepCopy() claim.DeletionTimestamp = &metav1.Time{Time: time.Now()} - return []*resourcev1alpha2.ResourceClaim{claim} + return []*resourceapi.ResourceClaim{claim} }(), want: want{ preenqueue: result{ @@ -472,10 +414,10 @@ func TestPlugin(t *testing.T) { }, "wrong-claim": { pod: podWithClaimTemplateInStatus, - claims: func() []*resourcev1alpha2.ResourceClaim { + claims: func() []*resourceapi.ResourceClaim { claim := allocatedClaim.DeepCopy() claim.OwnerReferences[0].UID += "123" - return []*resourcev1alpha2.ResourceClaim{claim} + return []*resourceapi.ResourceClaim{claim} }(), want: want{ preenqueue: result{ @@ -483,27 +425,14 @@ func TestPlugin(t *testing.T) { }, }, }, - "waiting-for-immediate-allocation": { + "structured-no-resources": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingImmediateClaim}, - classes: []*resourcev1alpha2.ResourceClass{resourceClass}, - want: want{ - prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `unallocated immediate resourceclaim`), - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), - }, - }, - }, - "immediate-allocation-structured-no-resources": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingImmediateClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + claims: []*resourceapi.ResourceClaim{structuredClaim(pendingClaim)}, + classes: []*resourceapi.DeviceClass{deviceClass}, want: want{ filter: perNodeResult{ workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim cannot be allocated for the node (unsuitable)`), + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `cannot allocate all claims`), }, }, postfilter: result{ @@ -511,94 +440,52 @@ func TestPlugin(t *testing.T) { }, }, }, - "immediate-allocation-structured-with-resources": { + "structured-with-resources": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingImmediateClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + claims: []*resourceapi.ResourceClaim{structuredClaim(pendingClaim)}, + classes: []*resourceapi.DeviceClass{deviceClass}, objs: []apiruntime.Object{workerNodeSlice}, want: want{ reserve: result{ - inFlightClaim: structuredAllocatedImmediateClaim, + inFlightClaim: structuredClaim(allocatedClaim), }, prebind: result{ - assumedClaim: reserve(structuredAllocatedImmediateClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() - claim.Finalizers = structuredAllocatedImmediateClaim.Finalizers - claim.Status = structuredInUseClaim.Status + claim.Finalizers = structuredClaim(allocatedClaim).Finalizers + claim.Status = structuredClaim(inUseClaim).Status } return claim }, }, }, postbind: result{ - assumedClaim: reserve(structuredAllocatedImmediateClaim, podWithClaimName), - }, - }, - }, - "delayed-allocation-structured-no-resources": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, - want: want{ - filter: perNodeResult{ - workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim cannot be allocated for the node (unsuitable)`), - }, - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), }, }, }, - "delayed-allocation-structured-with-resources": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, - objs: []apiruntime.Object{workerNodeSlice}, - want: want{ - reserve: result{ - inFlightClaim: structuredAllocatedClaim, - }, - prebind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), - changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { - if claim.Name == claimName { - claim = claim.DeepCopy() - claim.Finalizers = structuredAllocatedClaim.Finalizers - claim.Status = structuredInUseClaim.Status - } - return claim - }, - }, - }, - postbind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), - }, - }, - }, - "delayed-allocation-structured-with-resources-has-finalizer": { + "structured-with-resources-has-finalizer": { // As before. but the finalizer is already set. Could happen if // the scheduler got interrupted. pod: podWithClaimName, - claims: func() []*resourcev1alpha2.ResourceClaim { - claim := pendingDelayedClaim.DeepCopy() - claim.Finalizers = structuredAllocatedClaim.Finalizers - return []*resourcev1alpha2.ResourceClaim{claim} + claims: func() []*resourceapi.ResourceClaim { + claim := structuredClaim(pendingClaim) + claim.Finalizers = structuredClaim(allocatedClaim).Finalizers + return []*resourceapi.ResourceClaim{claim} }(), - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + classes: []*resourceapi.DeviceClass{deviceClass}, objs: []apiruntime.Object{workerNodeSlice}, want: want{ reserve: result{ - inFlightClaim: structuredAllocatedClaim, + inFlightClaim: structuredClaim(allocatedClaim), }, prebind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() claim.Status = structuredInUseClaim.Status @@ -608,24 +495,24 @@ func TestPlugin(t *testing.T) { }, }, postbind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), }, }, }, - "delayed-allocation-structured-with-resources-finalizer-gets-removed": { + "structured-with-resources-finalizer-gets-removed": { // As before. but the finalizer is already set. Then it gets // removed before the scheduler reaches PreBind. pod: podWithClaimName, - claims: func() []*resourcev1alpha2.ResourceClaim { - claim := pendingDelayedClaim.DeepCopy() - claim.Finalizers = structuredAllocatedClaim.Finalizers - return []*resourcev1alpha2.ResourceClaim{claim} + claims: func() []*resourceapi.ResourceClaim { + claim := structuredClaim(pendingClaim) + claim.Finalizers = structuredClaim(allocatedClaim).Finalizers + return []*resourceapi.ResourceClaim{claim} }(), - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + classes: []*resourceapi.DeviceClass{deviceClass}, objs: []apiruntime.Object{workerNodeSlice}, prepare: prepare{ prebind: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { claim.Finalizers = nil return claim }, @@ -633,15 +520,15 @@ func TestPlugin(t *testing.T) { }, want: want{ reserve: result{ - inFlightClaim: structuredAllocatedClaim, + inFlightClaim: structuredClaim(allocatedClaim), }, prebind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() - claim.Finalizers = structuredAllocatedClaim.Finalizers + claim.Finalizers = structuredClaim(allocatedClaim).Finalizers claim.Status = structuredInUseClaim.Status } return claim @@ -649,33 +536,33 @@ func TestPlugin(t *testing.T) { }, }, postbind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), }, }, }, - "delayed-allocation-structured-with-resources-finalizer-gets-added": { + "structured-with-resources-finalizer-gets-added": { // No finalizer initially, then it gets added before // the scheduler reaches PreBind. Shouldn't happen? pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + claims: []*resourceapi.ResourceClaim{structuredClaim(pendingClaim)}, + classes: []*resourceapi.DeviceClass{deviceClass}, objs: []apiruntime.Object{workerNodeSlice}, prepare: prepare{ prebind: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { - claim.Finalizers = structuredAllocatedClaim.Finalizers + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { + claim.Finalizers = structuredClaim(allocatedClaim).Finalizers return claim }, }, }, want: want{ reserve: result{ - inFlightClaim: structuredAllocatedClaim, + inFlightClaim: structuredClaim(allocatedClaim), }, prebind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { if claim.Name == claimName { claim = claim.DeepCopy() claim.Status = structuredInUseClaim.Status @@ -685,31 +572,31 @@ func TestPlugin(t *testing.T) { }, }, postbind: result{ - assumedClaim: reserve(structuredAllocatedClaim, podWithClaimName), + assumedClaim: reserve(structuredClaim(allocatedClaim), podWithClaimName), }, }, }, - "delayed-allocation-structured-skip-bind": { + "structured-skip-bind": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + claims: []*resourceapi.ResourceClaim{structuredClaim(pendingClaim)}, + classes: []*resourceapi.DeviceClass{deviceClass}, objs: []apiruntime.Object{workerNodeSlice}, want: want{ reserve: result{ - inFlightClaim: structuredAllocatedClaim, + inFlightClaim: structuredClaim(allocatedClaim), }, unreserveBeforePreBind: &result{}, }, }, - "delayed-allocation-structured-exhausted-resources": { + "structured-exhausted-resources": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim, otherStructuredAllocatedClaim}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClass}, + claims: []*resourceapi.ResourceClaim{structuredClaim(pendingClaim), structuredClaim(otherAllocatedClaim)}, + classes: []*resourceapi.DeviceClass{deviceClass}, objs: []apiruntime.Object{workerNodeSlice}, want: want{ filter: perNodeResult{ workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim cannot be allocated for the node (unsuitable)`), + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `cannot allocate all claims`), }, }, postfilter: result{ @@ -718,189 +605,88 @@ func TestPlugin(t *testing.T) { }, }, - "with-parameters": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaimWithParams}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClassWithParams}, - objs: []apiruntime.Object{claimParameters, classParameters, workerNodeSlice}, - want: want{ - reserve: result{ - inFlightClaim: structuredAllocatedClaimWithParams, - }, - prebind: result{ - assumedClaim: reserve(structuredAllocatedClaimWithParams, podWithClaimName), - changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { - if claim.Name == claimName { - claim = claim.DeepCopy() - claim.Finalizers = structuredAllocatedClaim.Finalizers - claim.Status = structuredInUseClaim.Status - } - return claim - }, - }, - }, - postbind: result{ - assumedClaim: reserve(structuredAllocatedClaimWithParams, podWithClaimName), - }, - }, - }, - - "with-translated-parameters": { + "claim-parameters-CEL-runtime-error": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{claimWithCRD(pendingDelayedClaimWithParams)}, - classes: []*resourcev1alpha2.ResourceClass{classWithCRD(structuredResourceClassWithCRD)}, - objs: []apiruntime.Object{claimParameters, claimParametersOtherNamespace /* must be ignored */, classParameters, workerNodeSlice}, + claims: []*resourceapi.ResourceClaim{breakCELInClaim(structuredClaim(pendingClaim))}, + classes: []*resourceapi.DeviceClass{deviceClass}, + objs: []apiruntime.Object{workerNodeSlice}, want: want{ - reserve: result{ - inFlightClaim: claimWithCRD(structuredAllocatedClaimWithParams), - }, - prebind: result{ - assumedClaim: reserve(claimWithCRD(structuredAllocatedClaimWithParams), podWithClaimName), - changes: change{ - claim: func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { - if claim.Name == claimName { - claim = claim.DeepCopy() - claim.Finalizers = structuredAllocatedClaim.Finalizers - claim.Status = structuredInUseClaim.Status - } - return claim - }, + filter: perNodeResult{ + workerNode.Name: { + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `claim default/my-pod-my-resource: selector #0: CEL runtime error: no such key: `+string(attrName)), }, }, - postbind: result{ - assumedClaim: reserve(claimWithCRD(structuredAllocatedClaimWithParams), podWithClaimName), - }, - }, - }, - - "missing-class-parameters": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaimWithParams}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClassWithParams}, - objs: []apiruntime.Object{claimParameters, workerNodeSlice}, - want: want{ - prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `class parameters default/my-resource-class not found`), - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), - }, - }, - }, - - "missing-claim-parameters": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaimWithParams}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClassWithParams}, - objs: []apiruntime.Object{classParameters, workerNodeSlice}, - want: want{ - prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `claim parameters default/my-pod-my-resource not found`), - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), - }, - }, - }, - - "missing-translated-class-parameters": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{claimWithCRD(pendingDelayedClaimWithParams)}, - classes: []*resourcev1alpha2.ResourceClass{classWithCRD(structuredResourceClassWithCRD)}, - objs: []apiruntime.Object{claimParameters, workerNodeSlice}, - want: want{ - prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `generated class parameters for ResourceClassParameters.example.com default/my-resource-class not found`), - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), - }, - }, - }, - - "missing-translated-claim-parameters": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{claimWithCRD(pendingDelayedClaimWithParams)}, - classes: []*resourcev1alpha2.ResourceClass{classWithCRD(structuredResourceClassWithCRD)}, - objs: []apiruntime.Object{classParameters, workerNodeSlice}, - want: want{ - prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `generated claim parameters for ResourceClaimParameters.example.com default/my-pod-my-resource not found`), - }, postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), - }, - }, - }, - - "too-many-translated-class-parameters": { - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{claimWithCRD(pendingDelayedClaimWithParams)}, - classes: []*resourcev1alpha2.ResourceClass{classWithCRD(structuredResourceClassWithCRD)}, - objs: []apiruntime.Object{claimParameters, classParameters, st.FromClassParameters(classParameters).Name("other").Obj() /* too many */, workerNodeSlice}, - want: want{ - prefilter: result{ - status: framework.AsStatus(errors.New(`multiple generated class parameters for ResourceClassParameters.example.com my-resource-class found: [default/my-resource-class default/other]`)), - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), + status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), }, }, }, - "too-many-translated-claim-parameters": { + "class-parameters-CEL-runtime-error": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{claimWithCRD(pendingDelayedClaimWithParams)}, - classes: []*resourcev1alpha2.ResourceClass{classWithCRD(structuredResourceClassWithCRD)}, - objs: []apiruntime.Object{claimParameters, st.FromClaimParameters(claimParameters).Name("other").Obj() /* too many */, classParameters, workerNodeSlice}, + claims: []*resourceapi.ResourceClaim{structuredClaim(pendingClaim)}, + classes: []*resourceapi.DeviceClass{breakCELInClass(deviceClass)}, + objs: []apiruntime.Object{workerNodeSlice}, want: want{ - prefilter: result{ - status: framework.AsStatus(errors.New(`multiple generated claim parameters for ResourceClaimParameters.example.com default/my-pod-my-resource found: [default/my-pod-my-resource default/other]`)), + filter: perNodeResult{ + workerNode.Name: { + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `class my-resource-class: selector #0: CEL runtime error: no such key: `+string(attrName)), + }, }, postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), + status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), }, }, }, - "claim-parameters-CEL-runtime-error": { + // When pod scheduling encounters CEL runtime errors for some nodes, but not all, + // it should still not schedule the pod because there is something wrong with it. + // Scheduling it would make it harder to detect that there is a problem. + // + // This matches the "keeps pod pending because of CEL runtime errors" E2E test. + "CEL-runtime-error-for-one-of-two-nodes": { + nodes: []*v1.Node{workerNode, workerNode2}, pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaimWithParams}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClassWithParams}, - objs: []apiruntime.Object{breakCELInClaimParameters(claimParameters), classParameters, workerNodeSlice}, + claims: []*resourceapi.ResourceClaim{breakCELInClaim(structuredClaim(pendingClaim))}, + classes: []*resourceapi.DeviceClass{deviceClass}, + objs: []apiruntime.Object{workerNodeSlice, workerNode2Slice}, want: want{ filter: perNodeResult{ workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `checking structured parameters failed: checking node "worker" and resources of driver "some-driver": evaluate request CEL expression: no such key: no-such-attribute`), + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `claim default/my-pod-my-resource: selector #0: CEL runtime error: no such key: `+string(attrName)), }, }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), + // PreScore not called, only one suitable node. + reserve: result{ + // This is the error found during Filter. + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `filter node worker: claim default/my-pod-my-resource: selector #0: CEL runtime error: no such key: healthy`), }, }, }, - "class-parameters-CEL-runtime-error": { + // When two nodes where found, PreScore gets called. + "CEL-runtime-error-for-one-of-three-nodes": { + nodes: []*v1.Node{workerNode, workerNode2, workerNode3}, pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaimWithParams}, - classes: []*resourcev1alpha2.ResourceClass{structuredResourceClassWithParams}, - objs: []apiruntime.Object{claimParameters, breakCELInClassParameters(classParameters), workerNodeSlice}, + claims: []*resourceapi.ResourceClaim{breakCELInClaim(structuredClaim(pendingClaim))}, + classes: []*resourceapi.DeviceClass{deviceClass}, + objs: []apiruntime.Object{workerNodeSlice, workerNode2Slice, workerNode3Slice}, want: want{ filter: perNodeResult{ workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `checking structured parameters failed: checking node "worker" and resources of driver "some-driver": evaluate filter CEL expression: no such key: no-such-attribute`), + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `claim default/my-pod-my-resource: selector #0: CEL runtime error: no such key: `+string(attrName)), }, }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), + prescore: result{ + // This is the error found during Filter. + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `filter node worker: claim default/my-pod-my-resource: selector #0: CEL runtime error: no such key: healthy`), }, }, }, "waiting-for-deallocation": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{deallocatingClaim}, + claims: []*resourceapi.ResourceClaim{deallocatingClaim}, want: want{ prefilter: result{ status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim must be reallocated`), @@ -910,24 +696,24 @@ func TestPlugin(t *testing.T) { }, }, }, - "delayed-allocation-missing-class": { + "missing-class": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, want: want{ prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("resource class %s does not exist", className)), + status: framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("request req-1: resource class %s does not exist", className)), }, postfilter: result{ status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), }, }, }, - "delayed-allocation-scheduling-select-immediately": { + "scheduling-select-immediately": { // Create the PodSchedulingContext object, ask for information // and select a node. pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - classes: []*resourcev1alpha2.ResourceClass{resourceClass}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, + classes: []*resourceapi.DeviceClass{deviceClass}, want: want{ prebind: result{ status: framework.NewStatus(framework.Pending, `waiting for resource driver`), @@ -935,13 +721,13 @@ func TestPlugin(t *testing.T) { }, }, }, - "delayed-allocation-scheduling-ask": { + "scheduling-ask": { // Create the PodSchedulingContext object, ask for // information, but do not select a node because // there are multiple claims. pod: podWithTwoClaimNames, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim, pendingDelayedClaim2}, - classes: []*resourcev1alpha2.ResourceClass{resourceClass}, + claims: []*resourceapi.ResourceClaim{pendingClaim, pendingClaim2}, + classes: []*resourceapi.DeviceClass{deviceClass}, want: want{ prebind: result{ status: framework.NewStatus(framework.Pending, `waiting for resource driver`), @@ -949,18 +735,18 @@ func TestPlugin(t *testing.T) { }, }, }, - "delayed-allocation-scheduling-finish": { + "scheduling-finish": { // Use the populated PodSchedulingContext object to select a // node. pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - schedulings: []*resourcev1alpha2.PodSchedulingContext{schedulingInfo}, - classes: []*resourcev1alpha2.ResourceClass{resourceClass}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, + schedulings: []*resourceapi.PodSchedulingContext{schedulingInfo}, + classes: []*resourceapi.DeviceClass{deviceClass}, want: want{ prebind: result{ status: framework.NewStatus(framework.Pending, `waiting for resource driver`), changes: change{ - scheduling: func(in *resourcev1alpha2.PodSchedulingContext) *resourcev1alpha2.PodSchedulingContext { + scheduling: func(in *resourceapi.PodSchedulingContext) *resourceapi.PodSchedulingContext { return st.FromPodSchedulingContexts(in). SelectedNode(workerNode.Name). Obj() @@ -969,16 +755,16 @@ func TestPlugin(t *testing.T) { }, }, }, - "delayed-allocation-scheduling-finish-concurrent-label-update": { + "scheduling-finish-concurrent-label-update": { // Use the populated PodSchedulingContext object to select a // node. pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - schedulings: []*resourcev1alpha2.PodSchedulingContext{schedulingInfo}, - classes: []*resourcev1alpha2.ResourceClass{resourceClass}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, + schedulings: []*resourceapi.PodSchedulingContext{schedulingInfo}, + classes: []*resourceapi.DeviceClass{deviceClass}, prepare: prepare{ prebind: change{ - scheduling: func(in *resourcev1alpha2.PodSchedulingContext) *resourcev1alpha2.PodSchedulingContext { + scheduling: func(in *resourceapi.PodSchedulingContext) *resourceapi.PodSchedulingContext { // This does not actually conflict with setting the // selected node, but because the plugin is not using // patching yet, Update nonetheless fails. @@ -994,18 +780,18 @@ func TestPlugin(t *testing.T) { }, }, }, - "delayed-allocation-scheduling-completed": { + "scheduling-completed": { // Remove PodSchedulingContext object once the pod is scheduled. pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaim}, - schedulings: []*resourcev1alpha2.PodSchedulingContext{schedulingInfo}, - classes: []*resourcev1alpha2.ResourceClass{resourceClass}, + claims: []*resourceapi.ResourceClaim{allocatedClaim}, + schedulings: []*resourceapi.PodSchedulingContext{schedulingInfo}, + classes: []*resourceapi.DeviceClass{deviceClass}, want: want{ prebind: result{ changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { return st.FromResourceClaim(in). - ReservedFor(resourcev1alpha2.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). + ReservedFor(resourceapi.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). Obj() }, }, @@ -1015,27 +801,11 @@ func TestPlugin(t *testing.T) { }, }, }, - "in-use-by-other": { - nodes: []*v1.Node{}, - pod: otherPodWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{inUseClaim}, - classes: []*resourcev1alpha2.ResourceClass{}, - schedulings: []*resourcev1alpha2.PodSchedulingContext{}, - prepare: prepare{}, - want: want{ - prefilter: result{ - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim in use`), - }, - postfilter: result{ - status: framework.NewStatus(framework.Unschedulable, `no new claims to deallocate`), - }, - }, - }, - "wrong-topology-delayed-allocation": { + "wrong-topology": { // PostFilter tries to get the pod scheduleable by // deallocating the claim. pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{allocatedDelayedClaimWithWrongTopology}, + claims: []*resourceapi.ResourceClaim{allocatedClaimWithWrongTopology}, want: want{ filter: perNodeResult{ workerNode.Name: { @@ -1045,7 +815,7 @@ func TestPlugin(t *testing.T) { postfilter: result{ // Claims with delayed allocation get deallocated. changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { return st.FromResourceClaim(in). DeallocationRequested(true). Obj() @@ -1055,29 +825,11 @@ func TestPlugin(t *testing.T) { }, }, }, - "wrong-topology-immediate-allocation": { + "wrong-topology-structured": { // PostFilter tries to get the pod scheduleable by // deallocating the claim. pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{allocatedImmediateClaimWithWrongTopology}, - want: want{ - filter: perNodeResult{ - workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim not available on the node`), - }, - }, - postfilter: result{ - // Claims with immediate allocation don't. They would just get allocated again right - // away, without considering the needs of the pod. - status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), - }, - }, - }, - "wrong-topology-delayed-allocation-structured": { - // PostFilter tries to get the pod scheduleable by - // deallocating the claim. - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{structuredAllocatedDelayedClaimWithWrongTopology}, + claims: []*resourceapi.ResourceClaim{structuredClaim(allocatedClaimWithWrongTopology)}, want: want{ filter: perNodeResult{ workerNode.Name: { @@ -1087,9 +839,9 @@ func TestPlugin(t *testing.T) { postfilter: result{ // Claims with delayed allocation and structured parameters get deallocated immediately. changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { return st.FromResourceClaim(in). - Allocation("", nil). + Allocation(nil). Obj() }, }, @@ -1097,34 +849,15 @@ func TestPlugin(t *testing.T) { }, }, }, - "wrong-topology-immediate-allocation-structured": { - // PostFilter tries to get the pod scheduleable by - // deallocating the claim. - pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{structuredAllocatedImmediateClaimWithWrongTopology}, - want: want{ - filter: perNodeResult{ - workerNode.Name: { - status: framework.NewStatus(framework.UnschedulableAndUnresolvable, `resourceclaim not available on the node`), - }, - }, - postfilter: result{ - // Claims with immediate allocation don't. The allocation is considered - // more important than the pod and pods need to wait for the node to - // become available again. - status: framework.NewStatus(framework.Unschedulable, `still not schedulable`), - }, - }, - }, "good-topology": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaimWithGoodTopology}, + claims: []*resourceapi.ResourceClaim{allocatedClaimWithGoodTopology}, want: want{ prebind: result{ changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { return st.FromResourceClaim(in). - ReservedFor(resourcev1alpha2.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). + ReservedFor(resourceapi.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). Obj() }, }, @@ -1133,22 +866,22 @@ func TestPlugin(t *testing.T) { }, "bind-failure": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaimWithGoodTopology}, + claims: []*resourceapi.ResourceClaim{allocatedClaimWithGoodTopology}, want: want{ prebind: result{ changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { return st.FromResourceClaim(in). - ReservedFor(resourcev1alpha2.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). + ReservedFor(resourceapi.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). Obj() }, }, }, unreserveAfterBindFailure: &result{ changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { out := in.DeepCopy() - out.Status.ReservedFor = []resourcev1alpha2.ResourceClaimConsumerReference{} + out.Status.ReservedFor = []resourceapi.ResourceClaimConsumerReference{} return out }, }, @@ -1157,22 +890,22 @@ func TestPlugin(t *testing.T) { }, "bind-failure-structured": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{structuredAllocatedClaimWithGoodTopology}, + claims: []*resourceapi.ResourceClaim{structuredClaim(allocatedClaimWithGoodTopology)}, want: want{ prebind: result{ changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { return st.FromResourceClaim(in). - ReservedFor(resourcev1alpha2.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). + ReservedFor(resourceapi.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: types.UID(podUID)}). Obj() }, }, }, unreserveAfterBindFailure: &result{ changes: change{ - claim: func(in *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + claim: func(in *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { out := in.DeepCopy() - out.Status.ReservedFor = []resourcev1alpha2.ResourceClaimConsumerReference{} + out.Status.ReservedFor = []resourceapi.ResourceClaimConsumerReference{} return out }, }, @@ -1181,11 +914,11 @@ func TestPlugin(t *testing.T) { }, "reserved-okay": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{inUseClaim}, + claims: []*resourceapi.ResourceClaim{inUseClaim}, }, "disable": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{inUseClaim}, + claims: []*resourceapi.ResourceClaim{inUseClaim}, want: want{ prefilter: result{ status: framework.NewStatus(framework.Skip), @@ -1238,15 +971,16 @@ func TestPlugin(t *testing.T) { t.Run(fmt.Sprintf("filter/%s", nodeInfo.Node().Name), func(t *testing.T) { testCtx.verify(t, tc.want.filter.forNode(nodeName), initialObjects, nil, status) }) - if status.Code() != framework.Success { - unschedulable = true - } else { + if status.Code() == framework.Success { potentialNodes = append(potentialNodes, nodeInfo) } } + if len(potentialNodes) == 0 { + unschedulable = true + } } - if !unschedulable && len(potentialNodes) > 0 { + if !unschedulable && len(potentialNodes) > 1 { initialObjects = testCtx.listAll(t) initialObjects = testCtx.updateAPIServer(t, initialObjects, tc.prepare.prescore) status := testCtx.p.PreScore(testCtx.ctx, testCtx.state, tc.pod, potentialNodes) @@ -1313,7 +1047,7 @@ func TestPlugin(t *testing.T) { }) } } - } else { + } else if len(potentialNodes) == 0 { initialObjects = testCtx.listAll(t) initialObjects = testCtx.updateAPIServer(t, initialObjects, tc.prepare.postfilter) result, status := testCtx.p.PostFilter(testCtx.ctx, testCtx.state, tc.pod, nil /* filteredNodeStatusMap not used by plugin */) @@ -1379,13 +1113,13 @@ func (tc *testContext) verify(t *testing.T, expected result, initialObjects []me func (tc *testContext) listAll(t *testing.T) (objects []metav1.Object) { t.Helper() - claims, err := tc.client.ResourceV1alpha2().ResourceClaims("").List(tc.ctx, metav1.ListOptions{}) + claims, err := tc.client.ResourceV1alpha3().ResourceClaims("").List(tc.ctx, metav1.ListOptions{}) require.NoError(t, err, "list claims") for _, claim := range claims.Items { claim := claim objects = append(objects, &claim) } - schedulings, err := tc.client.ResourceV1alpha2().PodSchedulingContexts("").List(tc.ctx, metav1.ListOptions{}) + schedulings, err := tc.client.ResourceV1alpha3().PodSchedulingContexts("").List(tc.ctx, metav1.ListOptions{}) require.NoError(t, err, "list pod scheduling") for _, scheduling := range schedulings.Items { scheduling := scheduling @@ -1399,7 +1133,7 @@ func (tc *testContext) listAll(t *testing.T) (objects []metav1.Object) { func (tc *testContext) listAssumedClaims() []metav1.Object { var assumedClaims []metav1.Object for _, obj := range tc.p.claimAssumeCache.List(nil) { - claim := obj.(*resourcev1alpha2.ResourceClaim) + claim := obj.(*resourceapi.ResourceClaim) obj, _ := tc.p.claimAssumeCache.Get(claim.Namespace + "/" + claim.Name) apiObj, _ := tc.p.claimAssumeCache.GetAPIObj(claim.Namespace + "/" + claim.Name) if obj != apiObj { @@ -1413,7 +1147,7 @@ func (tc *testContext) listAssumedClaims() []metav1.Object { func (tc *testContext) listInFlightClaims() []metav1.Object { var inFlightClaims []metav1.Object tc.p.inFlightAllocations.Range(func(key, value any) bool { - inFlightClaims = append(inFlightClaims, value.(*resourcev1alpha2.ResourceClaim)) + inFlightClaims = append(inFlightClaims, value.(*resourceapi.ResourceClaim)) return true }) sortObjects(inFlightClaims) @@ -1428,14 +1162,14 @@ func (tc *testContext) updateAPIServer(t *testing.T, objects []metav1.Object, up if diff := cmp.Diff(objects[i], obj); diff != "" { t.Logf("Updating %T %q, diff (-old, +new):\n%s", obj, obj.GetName(), diff) switch obj := obj.(type) { - case *resourcev1alpha2.ResourceClaim: - obj, err := tc.client.ResourceV1alpha2().ResourceClaims(obj.Namespace).Update(tc.ctx, obj, metav1.UpdateOptions{}) + case *resourceapi.ResourceClaim: + obj, err := tc.client.ResourceV1alpha3().ResourceClaims(obj.Namespace).Update(tc.ctx, obj, metav1.UpdateOptions{}) if err != nil { t.Fatalf("unexpected error during prepare update: %v", err) } modified[i] = obj - case *resourcev1alpha2.PodSchedulingContext: - obj, err := tc.client.ResourceV1alpha2().PodSchedulingContexts(obj.Namespace).Update(tc.ctx, obj, metav1.UpdateOptions{}) + case *resourceapi.PodSchedulingContext: + obj, err := tc.client.ResourceV1alpha3().PodSchedulingContexts(obj.Namespace).Update(tc.ctx, obj, metav1.UpdateOptions{}) if err != nil { t.Fatalf("unexpected error during prepare update: %v", err) } @@ -1465,11 +1199,11 @@ func update(t *testing.T, objects []metav1.Object, updates change) []metav1.Obje for _, obj := range objects { switch in := obj.(type) { - case *resourcev1alpha2.ResourceClaim: + case *resourceapi.ResourceClaim: if updates.claim != nil { obj = updates.claim(in) } - case *resourcev1alpha2.PodSchedulingContext: + case *resourceapi.PodSchedulingContext: if updates.scheduling != nil { obj = updates.scheduling(in) } @@ -1480,7 +1214,7 @@ func update(t *testing.T, objects []metav1.Object, updates change) []metav1.Obje return updated } -func setup(t *testing.T, nodes []*v1.Node, claims []*resourcev1alpha2.ResourceClaim, classes []*resourcev1alpha2.ResourceClass, schedulings []*resourcev1alpha2.PodSchedulingContext, objs []apiruntime.Object) (result *testContext) { +func setup(t *testing.T, nodes []*v1.Node, claims []*resourceapi.ResourceClaim, classes []*resourceapi.DeviceClass, schedulings []*resourceapi.PodSchedulingContext, objs []apiruntime.Object) (result *testContext) { t.Helper() tc := &testContext{} @@ -1491,15 +1225,8 @@ func setup(t *testing.T, nodes []*v1.Node, claims []*resourcev1alpha2.ResourceCl reactor := createReactor(tc.client.Tracker()) tc.client.PrependReactor("*", "*", reactor) - // Quick-and-dirty workaround for fake client storing ResourceClassParameters and - // ResourceClaimParameters as "resourceclassparameterses" and "resourceclaimparameterses": - // intercept the correct LIST from the informers and reply to them with the incorrect - // LIST result. - tc.client.PrependReactor("list", "resourceclaimparameters", createListReactor(tc.client.Tracker(), "ResourceClaimParameters")) - tc.client.PrependReactor("list", "resourceclassparameters", createListReactor(tc.client.Tracker(), "ResourceClassParameters")) - tc.informerFactory = informers.NewSharedInformerFactory(tc.client, 0) - tc.claimAssumeCache = assumecache.NewAssumeCache(tCtx.Logger(), tc.informerFactory.Resource().V1alpha2().ResourceClaims().Informer(), "resource claim", "", nil) + tc.claimAssumeCache = assumecache.NewAssumeCache(tCtx.Logger(), tc.informerFactory.Resource().V1alpha3().ResourceClaims().Informer(), "resource claim", "", nil) opts := []runtime.Option{ runtime.WithClientSet(tc.client), runtime.WithInformerFactory(tc.informerFactory), @@ -1519,15 +1246,15 @@ func setup(t *testing.T, nodes []*v1.Node, claims []*resourcev1alpha2.ResourceCl // The tests use the API to create the objects because then reactors // get triggered. for _, claim := range claims { - _, err := tc.client.ResourceV1alpha2().ResourceClaims(claim.Namespace).Create(tc.ctx, claim, metav1.CreateOptions{}) + _, err := tc.client.ResourceV1alpha3().ResourceClaims(claim.Namespace).Create(tc.ctx, claim, metav1.CreateOptions{}) require.NoError(t, err, "create resource claim") } for _, class := range classes { - _, err := tc.client.ResourceV1alpha2().ResourceClasses().Create(tc.ctx, class, metav1.CreateOptions{}) + _, err := tc.client.ResourceV1alpha3().DeviceClasses().Create(tc.ctx, class, metav1.CreateOptions{}) require.NoError(t, err, "create resource class") } for _, scheduling := range schedulings { - _, err := tc.client.ResourceV1alpha2().PodSchedulingContexts(scheduling.Namespace).Create(tc.ctx, scheduling, metav1.CreateOptions{}) + _, err := tc.client.ResourceV1alpha3().PodSchedulingContexts(scheduling.Namespace).Create(tc.ctx, scheduling, metav1.CreateOptions{}) require.NoError(t, err, "create pod scheduling") } @@ -1613,21 +1340,10 @@ func createReactor(tracker cgotesting.ObjectTracker) func(action cgotesting.Acti } } -func createListReactor(tracker cgotesting.ObjectTracker, kind string) func(action cgotesting.Action) (handled bool, ret apiruntime.Object, err error) { - return func(action cgotesting.Action) (handled bool, ret apiruntime.Object, err error) { - // listAction := action.(cgotesting.ListAction) - gvr := action.GetResource() - ns := action.GetNamespace() - gvr.Resource += "es" - list, err := tracker.List(gvr, schema.GroupVersionKind{Group: gvr.Group, Version: gvr.Version, Kind: kind}, ns) - return true, list, err - } -} - func Test_isSchedulableAfterClaimChange(t *testing.T) { testcases := map[string]struct { pod *v1.Pod - claims []*resourcev1alpha2.ResourceClaim + claims []*resourceapi.ResourceClaim oldObj, newObj interface{} expectedHint framework.QueueingHint expectedErr bool @@ -1645,7 +1361,7 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { }, "skip-wrong-claim": { pod: podWithClaimTemplate, - newObj: func() *resourcev1alpha2.ResourceClaim { + newObj: func() *resourceapi.ResourceClaim { claim := allocatedClaim.DeepCopy() claim.OwnerReferences[0].UID += "123" return claim @@ -1654,8 +1370,8 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { }, "skip-unrelated-claim": { pod: podWithClaimTemplate, - claims: []*resourcev1alpha2.ResourceClaim{allocatedClaim}, - newObj: func() *resourcev1alpha2.ResourceClaim { + claims: []*resourceapi.ResourceClaim{allocatedClaim}, + newObj: func() *resourceapi.ResourceClaim { claim := allocatedClaim.DeepCopy() claim.Name += "-foo" claim.UID += "123" @@ -1665,22 +1381,22 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { }, "queue-on-add": { pod: podWithClaimName, - newObj: pendingImmediateClaim, + newObj: pendingClaim, expectedHint: framework.Queue, }, "backoff-wrong-old-object": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, oldObj: "not-a-claim", - newObj: pendingImmediateClaim, + newObj: pendingClaim, expectedErr: true, }, "skip-adding-finalizer": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingImmediateClaim}, - oldObj: pendingImmediateClaim, - newObj: func() *resourcev1alpha2.ResourceClaim { - claim := pendingImmediateClaim.DeepCopy() + claims: []*resourceapi.ResourceClaim{pendingClaim}, + oldObj: pendingClaim, + newObj: func() *resourceapi.ResourceClaim { + claim := pendingClaim.DeepCopy() claim.Finalizers = append(claim.Finalizers, "foo") return claim }(), @@ -1688,21 +1404,21 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { }, "queue-on-status-change": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingImmediateClaim}, - oldObj: pendingImmediateClaim, - newObj: func() *resourcev1alpha2.ResourceClaim { - claim := pendingImmediateClaim.DeepCopy() - claim.Status.Allocation = &resourcev1alpha2.AllocationResult{} + claims: []*resourceapi.ResourceClaim{pendingClaim}, + oldObj: pendingClaim, + newObj: func() *resourceapi.ResourceClaim { + claim := pendingClaim.DeepCopy() + claim.Status.Allocation = &resourceapi.AllocationResult{} return claim }(), expectedHint: framework.Queue, }, "structured-claim-deallocate": { pod: podWithClaimName, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim, otherStructuredAllocatedClaim}, - oldObj: otherStructuredAllocatedClaim, - newObj: func() *resourcev1alpha2.ResourceClaim { - claim := otherStructuredAllocatedClaim.DeepCopy() + claims: []*resourceapi.ResourceClaim{pendingClaim, structuredClaim(otherAllocatedClaim)}, + oldObj: structuredClaim(otherAllocatedClaim), + newObj: func() *resourceapi.ResourceClaim { + claim := structuredClaim(otherAllocatedClaim).DeepCopy() claim.Status.Allocation = nil return claim }(), @@ -1718,14 +1434,14 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { testCtx := setup(t, nil, tc.claims, nil, nil, nil) oldObj := tc.oldObj newObj := tc.newObj - if claim, ok := tc.newObj.(*resourcev1alpha2.ResourceClaim); ok { + if claim, ok := tc.newObj.(*resourceapi.ResourceClaim); ok { // Add or update through the client and wait until the event is processed. claimKey := claim.Namespace + "/" + claim.Name if tc.oldObj == nil { // Some test claims already have it. Clear for create. createClaim := claim.DeepCopy() createClaim.UID = "" - storedClaim, err := testCtx.client.ResourceV1alpha2().ResourceClaims(createClaim.Namespace).Create(tCtx, createClaim, metav1.CreateOptions{}) + storedClaim, err := testCtx.client.ResourceV1alpha3().ResourceClaims(createClaim.Namespace).Create(tCtx, createClaim, metav1.CreateOptions{}) require.NoError(t, err, "create claim") claim = storedClaim } else { @@ -1733,10 +1449,10 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { require.NoError(t, err, "retrieve old claim") updateClaim := claim.DeepCopy() // The test claim doesn't have those (generated dynamically), so copy them. - updateClaim.UID = cachedClaim.(*resourcev1alpha2.ResourceClaim).UID - updateClaim.ResourceVersion = cachedClaim.(*resourcev1alpha2.ResourceClaim).ResourceVersion + updateClaim.UID = cachedClaim.(*resourceapi.ResourceClaim).UID + updateClaim.ResourceVersion = cachedClaim.(*resourceapi.ResourceClaim).ResourceVersion - storedClaim, err := testCtx.client.ResourceV1alpha2().ResourceClaims(updateClaim.Namespace).Update(tCtx, updateClaim, metav1.UpdateOptions{}) + storedClaim, err := testCtx.client.ResourceV1alpha3().ResourceClaims(updateClaim.Namespace).Update(tCtx, updateClaim, metav1.UpdateOptions{}) require.NoError(t, err, "update claim") claim = storedClaim } @@ -1745,7 +1461,7 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { require.EventuallyWithT(t, func(t *assert.CollectT) { cachedClaim, err := testCtx.claimAssumeCache.Get(claimKey) require.NoError(t, err, "retrieve claim") - if cachedClaim.(*resourcev1alpha2.ResourceClaim).ResourceVersion != claim.ResourceVersion { + if cachedClaim.(*resourceapi.ResourceClaim).ResourceVersion != claim.ResourceVersion { t.Errorf("cached claim not updated yet") } }, time.Minute, time.Second, "claim assume cache must have new or updated claim") @@ -1770,8 +1486,8 @@ func Test_isSchedulableAfterClaimChange(t *testing.T) { func Test_isSchedulableAfterPodSchedulingContextChange(t *testing.T) { testcases := map[string]struct { pod *v1.Pod - schedulings []*resourcev1alpha2.PodSchedulingContext - claims []*resourcev1alpha2.ResourceClaim + schedulings []*resourceapi.PodSchedulingContext + claims []*resourceapi.ResourceClaim oldObj, newObj interface{} expectedHint framework.QueueingHint expectedErr bool @@ -1804,8 +1520,8 @@ func Test_isSchedulableAfterPodSchedulingContextChange(t *testing.T) { }, "skip-unrelated-object": { pod: podWithClaimTemplate, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - newObj: func() *resourcev1alpha2.PodSchedulingContext { + claims: []*resourceapi.ResourceClaim{pendingClaim}, + newObj: func() *resourceapi.PodSchedulingContext { scheduling := scheduling.DeepCopy() scheduling.Name += "-foo" return scheduling @@ -1826,27 +1542,27 @@ func Test_isSchedulableAfterPodSchedulingContextChange(t *testing.T) { }, "skip-missing-infos": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, oldObj: scheduling, newObj: scheduling, expectedHint: framework.QueueSkip, }, "queue-new-infos": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, oldObj: scheduling, newObj: schedulingInfo, expectedHint: framework.Queue, }, "queue-bad-selected-node": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, - oldObj: func() *resourcev1alpha2.PodSchedulingContext { + claims: []*resourceapi.ResourceClaim{pendingClaim}, + oldObj: func() *resourceapi.PodSchedulingContext { scheduling := schedulingInfo.DeepCopy() scheduling.Spec.SelectedNode = workerNode.Name return scheduling }(), - newObj: func() *resourcev1alpha2.PodSchedulingContext { + newObj: func() *resourceapi.PodSchedulingContext { scheduling := schedulingInfo.DeepCopy() scheduling.Spec.SelectedNode = workerNode.Name scheduling.Status.ResourceClaims[0].UnsuitableNodes = append(scheduling.Status.ResourceClaims[0].UnsuitableNodes, scheduling.Spec.SelectedNode) @@ -1856,9 +1572,9 @@ func Test_isSchedulableAfterPodSchedulingContextChange(t *testing.T) { }, "skip-spec-changes": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, oldObj: schedulingInfo, - newObj: func() *resourcev1alpha2.PodSchedulingContext { + newObj: func() *resourceapi.PodSchedulingContext { scheduling := schedulingInfo.DeepCopy() scheduling.Spec.SelectedNode = workerNode.Name return scheduling @@ -1867,9 +1583,9 @@ func Test_isSchedulableAfterPodSchedulingContextChange(t *testing.T) { }, "backoff-other-changes": { pod: podWithClaimTemplateInStatus, - claims: []*resourcev1alpha2.ResourceClaim{pendingDelayedClaim}, + claims: []*resourceapi.ResourceClaim{pendingClaim}, oldObj: schedulingInfo, - newObj: func() *resourcev1alpha2.PodSchedulingContext { + newObj: func() *resourceapi.PodSchedulingContext { scheduling := schedulingInfo.DeepCopy() scheduling.Finalizers = append(scheduling.Finalizers, "foo") return scheduling diff --git a/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel.go b/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel.go deleted file mode 100644 index c65265c83803e..0000000000000 --- a/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Copyright 2024 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. -*/ - -package namedresources - -import ( - "context" - "errors" - "fmt" - "slices" - - resourceapi "k8s.io/api/resource/v1alpha2" - "k8s.io/apiserver/pkg/cel/environment" - "k8s.io/dynamic-resource-allocation/structured/namedresources/cel" -) - -// These types and fields are all exported to allow logging them with -// pretty-printed JSON. - -type Model struct { - Instances []InstanceAllocation -} - -type InstanceAllocation struct { - Allocated bool - Instance *resourceapi.NamedResourcesInstance -} - -// AddResources must be called first to create entries for all existing -// resource instances. The resources parameter may be nil. -func AddResources(m *Model, resources *resourceapi.NamedResourcesResources) { - if resources == nil { - return - } - - for i := range resources.Instances { - m.Instances = append(m.Instances, InstanceAllocation{Instance: &resources.Instances[i]}) - } -} - -// AddAllocation may get called after AddResources to mark some resource -// instances as allocated. The result parameter may be nil. -func AddAllocation(m *Model, result *resourceapi.NamedResourcesAllocationResult) { - if result == nil { - return - } - for i := range m.Instances { - if m.Instances[i].Instance.Name == result.Name { - m.Instances[i].Allocated = true - break - } - } -} - -func NewClaimController(filter *resourceapi.NamedResourcesFilter, requests []*resourceapi.NamedResourcesRequest) (*Controller, error) { - c := &Controller{} - if filter != nil { - compilation := cel.Compiler.CompileCELExpression(filter.Selector, environment.StoredExpressions) - if compilation.Error != nil { - // Shouldn't happen because of validation. - return nil, fmt.Errorf("compile class filter CEL expression: %w", compilation.Error) - } - c.filter = &compilation - } - for _, request := range requests { - compilation := cel.Compiler.CompileCELExpression(request.Selector, environment.StoredExpressions) - if compilation.Error != nil { - // Shouldn't happen because of validation. - return nil, fmt.Errorf("compile request CEL expression: %w", compilation.Error) - } - c.requests = append(c.requests, compilation) - } - return c, nil -} - -type Controller struct { - filter *cel.CompilationResult - requests []cel.CompilationResult -} - -func (c *Controller) NodeIsSuitable(ctx context.Context, model Model) (bool, error) { - indices, err := c.allocate(ctx, model) - return len(indices) == len(c.requests), err -} - -func (c *Controller) Allocate(ctx context.Context, model Model) ([]*resourceapi.NamedResourcesAllocationResult, error) { - indices, err := c.allocate(ctx, model) - if err != nil { - return nil, err - } - if len(indices) != len(c.requests) { - return nil, errors.New("insufficient resources") - } - results := make([]*resourceapi.NamedResourcesAllocationResult, len(c.requests)) - for i := range c.requests { - results[i] = &resourceapi.NamedResourcesAllocationResult{Name: model.Instances[indices[i]].Instance.Name} - } - return results, nil -} - -func (c *Controller) allocate(ctx context.Context, model Model) ([]int, error) { - // Shallow copy, we need to modify the allocated boolean. - instances := slices.Clone(model.Instances) - indices := make([]int, 0, len(c.requests)) - - for _, request := range c.requests { - for i, instance := range instances { - if instance.Allocated { - continue - } - if c.filter != nil { - okay, err := c.filter.Evaluate(ctx, instance.Instance.Attributes) - if err != nil { - return nil, fmt.Errorf("evaluate filter CEL expression: %w", err) - } - if !okay { - continue - } - } - okay, err := request.Evaluate(ctx, instance.Instance.Attributes) - if err != nil { - return nil, fmt.Errorf("evaluate request CEL expression: %w", err) - } - if !okay { - continue - } - // Found a matching, unallocated instance. Let's use it. - // - // A more thorough search would include backtracking because - // allocating one "large" instances for a "small" request may - // make a following "large" request impossible to satisfy when - // only "small" instances are left. - instances[i].Allocated = true - indices = append(indices, i) - break - } - } - return indices, nil - -} diff --git a/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel_test.go b/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel_test.go deleted file mode 100644 index aa920757274b1..0000000000000 --- a/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources/namedresourcesmodel_test.go +++ /dev/null @@ -1,327 +0,0 @@ -/* -Copyright 2024 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. -*/ - -package namedresources - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - resourceapi "k8s.io/api/resource/v1alpha2" - "k8s.io/kubernetes/test/utils/ktesting" - "k8s.io/utils/ptr" -) - -func instance(allocated bool, name string, attributes ...resourceapi.NamedResourcesAttribute) InstanceAllocation { - return InstanceAllocation{ - Allocated: allocated, - Instance: &resourceapi.NamedResourcesInstance{ - Name: name, - Attributes: attributes, - }, - } -} - -func TestModel(t *testing.T) { - testcases := map[string]struct { - resources []*resourceapi.NamedResourcesResources - allocations []*resourceapi.NamedResourcesAllocationResult - - expectModel Model - }{ - "empty": {}, - - "nil": { - resources: []*resourceapi.NamedResourcesResources{nil}, - allocations: []*resourceapi.NamedResourcesAllocationResult{nil}, - }, - - "available": { - resources: []*resourceapi.NamedResourcesResources{ - { - Instances: []resourceapi.NamedResourcesInstance{ - {Name: "a"}, - {Name: "b"}, - }, - }, - { - Instances: []resourceapi.NamedResourcesInstance{ - {Name: "x"}, - {Name: "y"}, - }, - }, - }, - - expectModel: Model{Instances: []InstanceAllocation{instance(false, "a"), instance(false, "b"), instance(false, "x"), instance(false, "y")}}, - }, - - "allocated": { - resources: []*resourceapi.NamedResourcesResources{ - { - Instances: []resourceapi.NamedResourcesInstance{ - {Name: "a"}, - {Name: "b"}, - }, - }, - { - Instances: []resourceapi.NamedResourcesInstance{ - {Name: "x"}, - {Name: "y"}, - }, - }, - }, - allocations: []*resourceapi.NamedResourcesAllocationResult{ - { - Name: "something-else", - }, - { - Name: "a", - }, - }, - - expectModel: Model{Instances: []InstanceAllocation{instance(true, "a"), instance(false, "b"), instance(false, "x"), instance(false, "y")}}, - }, - } - - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - var actualModel Model - for _, resources := range tc.resources { - AddResources(&actualModel, resources) - } - for _, allocation := range tc.allocations { - AddAllocation(&actualModel, allocation) - } - - require.Equal(t, tc.expectModel, actualModel) - }) - } - -} - -func TestController(t *testing.T) { - filterAny := &resourceapi.NamedResourcesFilter{ - Selector: "true", - } - filterNone := &resourceapi.NamedResourcesFilter{ - Selector: "false", - } - filterBrokenType := &resourceapi.NamedResourcesFilter{ - Selector: "1", - } - filterBrokenEvaluation := &resourceapi.NamedResourcesFilter{ - Selector: `attributes.bool["no-such-attribute"]`, - } - filterAttribute := &resourceapi.NamedResourcesFilter{ - Selector: `attributes.bool["usable"]`, - } - - requestAny := &resourceapi.NamedResourcesRequest{ - Selector: "true", - } - requestNone := &resourceapi.NamedResourcesRequest{ - Selector: "false", - } - requestBrokenType := &resourceapi.NamedResourcesRequest{ - Selector: "1", - } - requestBrokenEvaluation := &resourceapi.NamedResourcesRequest{ - Selector: `attributes.bool["no-such-attribute"]`, - } - requestAttribute := &resourceapi.NamedResourcesRequest{ - Selector: `attributes.bool["usable"]`, - } - - instance1 := "instance-1" - oneInstance := Model{ - Instances: []InstanceAllocation{{ - Instance: &resourceapi.NamedResourcesInstance{ - Name: instance1, - }, - }}, - } - - instance2 := "instance-2" - twoInstances := Model{ - Instances: []InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{ - Name: instance1, - Attributes: []resourceapi.NamedResourcesAttribute{{ - Name: "usable", - NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{ - BoolValue: ptr.To(false), - }, - }}, - }, - }, - { - Instance: &resourceapi.NamedResourcesInstance{ - Name: instance2, - Attributes: []resourceapi.NamedResourcesAttribute{{ - Name: "usable", - NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{ - BoolValue: ptr.To(true), - }, - }}, - }, - }, - }, - } - - testcases := map[string]struct { - model Model - filter *resourceapi.NamedResourcesFilter - requests []*resourceapi.NamedResourcesRequest - - expectCreateErr bool - expectAllocation []string - expectAllocateErr bool - }{ - "empty": {}, - - "broken-filter": { - filter: filterBrokenType, - - expectCreateErr: true, - }, - - "broken-request": { - requests: []*resourceapi.NamedResourcesRequest{requestBrokenType}, - - expectCreateErr: true, - }, - - "no-resources": { - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestAny}, - - expectAllocateErr: true, - }, - - "okay": { - model: oneInstance, - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestAny}, - - expectAllocation: []string{instance1}, - }, - - "filter-mismatch": { - model: oneInstance, - filter: filterNone, - requests: []*resourceapi.NamedResourcesRequest{requestAny}, - - expectAllocateErr: true, - }, - - "request-mismatch": { - model: oneInstance, - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestNone}, - - expectAllocateErr: true, - }, - - "many": { - model: twoInstances, - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestAny, requestAny}, - - expectAllocation: []string{instance1, instance2}, - }, - - "too-many": { - model: oneInstance, - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestAny, requestAny}, - - expectAllocateErr: true, - }, - - "filter-evaluation-error": { - model: oneInstance, - filter: filterBrokenEvaluation, - requests: []*resourceapi.NamedResourcesRequest{requestAny}, - - expectAllocateErr: true, - }, - - "request-evaluation-error": { - model: oneInstance, - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestBrokenEvaluation}, - - expectAllocateErr: true, - }, - - "filter-attribute": { - model: twoInstances, - filter: filterAttribute, - requests: []*resourceapi.NamedResourcesRequest{requestAny}, - - expectAllocation: []string{instance2}, - }, - - "request-attribute": { - model: twoInstances, - filter: filterAny, - requests: []*resourceapi.NamedResourcesRequest{requestAttribute}, - - expectAllocation: []string{instance2}, - }, - } - - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - tCtx := ktesting.Init(t) - - controller, createErr := NewClaimController(tc.filter, tc.requests) - if createErr != nil { - if !tc.expectCreateErr { - tCtx.Fatalf("unexpected create error: %v", createErr) - } - return - } - if tc.expectCreateErr { - tCtx.Fatalf("did not get expected create error") - } - - allocation, createErr := controller.Allocate(tCtx, tc.model) - if createErr != nil { - if !tc.expectAllocateErr { - tCtx.Fatalf("unexpected allocate error: %v", createErr) - } - return - } - if tc.expectAllocateErr { - tCtx.Fatalf("did not get expected allocate error") - } - - expectAllocation := []*resourceapi.NamedResourcesAllocationResult{} - for _, name := range tc.expectAllocation { - expectAllocation = append(expectAllocation, &resourceapi.NamedResourcesAllocationResult{Name: name}) - } - require.Equal(tCtx, expectAllocation, allocation) - - isSuitable, isSuitableErr := controller.NodeIsSuitable(tCtx, tc.model) - assert.Equal(tCtx, len(expectAllocation) == len(tc.requests), isSuitable, "is suitable") - assert.Equal(tCtx, createErr, isSuitableErr) - }) - } -} diff --git a/pkg/scheduler/framework/plugins/dynamicresources/structuredparameters.go b/pkg/scheduler/framework/plugins/dynamicresources/structuredparameters.go deleted file mode 100644 index 31a532331cc6a..0000000000000 --- a/pkg/scheduler/framework/plugins/dynamicresources/structuredparameters.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2024 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. -*/ - -package dynamicresources - -import ( - "context" - "fmt" - "sync" - - v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" - namedresourcesmodel "k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources" -) - -// resources is a map "node name" -> "driver name" -> available and -// allocated resources per structured parameter model. -type resources map[string]map[string]ResourceModels - -// ResourceModels may have more than one entry because it is valid for a driver to -// use more than one structured parameter model. -type ResourceModels struct { - NamedResources namedresourcesmodel.Model -} - -// resourceSliceLister is the subset of resourcev1alpha2listers.ResourceSliceLister needed by -// newResourceModel. -type resourceSliceLister interface { - List(selector labels.Selector) (ret []*resourcev1alpha2.ResourceSlice, err error) -} - -// assumeCacheLister is the subset of volumebinding.AssumeCache needed by newResourceModel. -type assumeCacheLister interface { - List(indexObj interface{}) []interface{} -} - -// newResourceModel parses the available information about resources. Objects -// with an unknown structured parameter model silently ignored. An error gets -// logged later when parameters required for a pod depend on such an unknown -// model. -func newResourceModel(logger klog.Logger, resourceSliceLister resourceSliceLister, claimAssumeCache assumeCacheLister, inFlightAllocations *sync.Map) (resources, error) { - model := make(resources) - - slices, err := resourceSliceLister.List(labels.Everything()) - if err != nil { - return nil, fmt.Errorf("list node resource slices: %w", err) - } - for _, slice := range slices { - if model[slice.NodeName] == nil { - model[slice.NodeName] = make(map[string]ResourceModels) - } - resource := model[slice.NodeName][slice.DriverName] - namedresourcesmodel.AddResources(&resource.NamedResources, slice.NamedResources) - model[slice.NodeName][slice.DriverName] = resource - } - - objs := claimAssumeCache.List(nil) - for _, obj := range objs { - claim, ok := obj.(*resourcev1alpha2.ResourceClaim) - if !ok { - return nil, fmt.Errorf("got unexpected object of type %T from claim assume cache", obj) - } - if obj, ok := inFlightAllocations.Load(claim.UID); ok { - // If the allocation is in-flight, then we have to use the allocation - // from that claim. - claim = obj.(*resourcev1alpha2.ResourceClaim) - } - if claim.Status.Allocation == nil { - continue - } - for _, handle := range claim.Status.Allocation.ResourceHandles { - structured := handle.StructuredData - if structured == nil { - continue - } - if model[structured.NodeName] == nil { - model[structured.NodeName] = make(map[string]ResourceModels) - } - resource := model[structured.NodeName][handle.DriverName] - for _, result := range structured.Results { - // Call AddAllocation for each known model. Each call itself needs to check for nil. - namedresourcesmodel.AddAllocation(&resource.NamedResources, result.NamedResources) - } - } - } - - return model, nil -} - -func newClaimController(logger klog.Logger, class *resourcev1alpha2.ResourceClass, classParameters *resourcev1alpha2.ResourceClassParameters, claimParameters *resourcev1alpha2.ResourceClaimParameters) (*claimController, error) { - // Each node driver is separate from the others. Each driver may have - // multiple requests which need to be allocated together, so here - // we have to collect them per model. - type perDriverRequests struct { - parameters []runtime.RawExtension - requests []*resourcev1alpha2.NamedResourcesRequest - } - namedresourcesRequests := make(map[string]perDriverRequests) - for i, request := range claimParameters.DriverRequests { - driverName := request.DriverName - p := namedresourcesRequests[driverName] - for e, request := range request.Requests { - switch { - case request.ResourceRequestModel.NamedResources != nil: - p.parameters = append(p.parameters, request.VendorParameters) - p.requests = append(p.requests, request.ResourceRequestModel.NamedResources) - default: - return nil, fmt.Errorf("claim parameters %s: driverRequests[%d].requests[%d]: no supported structured parameters found", klog.KObj(claimParameters), i, e) - } - } - if len(p.requests) > 0 { - namedresourcesRequests[driverName] = p - } - } - - c := &claimController{ - class: class, - classParameters: classParameters, - claimParameters: claimParameters, - namedresources: make(map[string]perDriverController, len(namedresourcesRequests)), - } - for driverName, perDriver := range namedresourcesRequests { - var filter *resourcev1alpha2.NamedResourcesFilter - for _, f := range classParameters.Filters { - if f.DriverName == driverName && f.ResourceFilterModel.NamedResources != nil { - filter = f.ResourceFilterModel.NamedResources - break - } - } - controller, err := namedresourcesmodel.NewClaimController(filter, perDriver.requests) - if err != nil { - return nil, fmt.Errorf("creating claim controller for named resources structured model: %w", err) - } - c.namedresources[driverName] = perDriverController{ - parameters: perDriver.parameters, - controller: controller, - } - } - return c, nil -} - -// claimController currently wraps exactly one structured parameter model. - -type claimController struct { - class *resourcev1alpha2.ResourceClass - classParameters *resourcev1alpha2.ResourceClassParameters - claimParameters *resourcev1alpha2.ResourceClaimParameters - namedresources map[string]perDriverController -} - -type perDriverController struct { - parameters []runtime.RawExtension - controller *namedresourcesmodel.Controller -} - -func (c claimController) nodeIsSuitable(ctx context.Context, nodeName string, resources resources) (bool, error) { - nodeResources := resources[nodeName] - for driverName, perDriver := range c.namedresources { - okay, err := perDriver.controller.NodeIsSuitable(ctx, nodeResources[driverName].NamedResources) - if err != nil { - // This is an error in the CEL expression which needs - // to be fixed. Better fail very visibly instead of - // ignoring the node. - return false, fmt.Errorf("checking node %q and resources of driver %q: %w", nodeName, driverName, err) - } - if !okay { - return false, nil - } - } - return true, nil -} - -func (c claimController) allocate(ctx context.Context, nodeName string, resources resources) (string, *resourcev1alpha2.AllocationResult, error) { - allocation := &resourcev1alpha2.AllocationResult{ - Shareable: c.claimParameters.Shareable, - AvailableOnNodes: &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{ - { - MatchExpressions: []v1.NodeSelectorRequirement{ - {Key: "kubernetes.io/hostname", Operator: v1.NodeSelectorOpIn, Values: []string{nodeName}}, - }, - }, - }, - }, - } - - nodeResources := resources[nodeName] - for driverName, perDriver := range c.namedresources { - // Must return one entry for each request. The entry may be nil. This way, - // the result can be correlated with the per-request parameters. - results, err := perDriver.controller.Allocate(ctx, nodeResources[driverName].NamedResources) - if err != nil { - return "", nil, fmt.Errorf("allocating via named resources structured model: %w", err) - } - handle := resourcev1alpha2.ResourceHandle{ - DriverName: driverName, - StructuredData: &resourcev1alpha2.StructuredResourceHandle{ - NodeName: nodeName, - }, - } - for i, result := range results { - if result == nil { - continue - } - handle.StructuredData.Results = append(handle.StructuredData.Results, - resourcev1alpha2.DriverAllocationResult{ - VendorRequestParameters: perDriver.parameters[i], - AllocationResultModel: resourcev1alpha2.AllocationResultModel{ - NamedResources: result, - }, - }, - ) - } - if c.classParameters != nil { - for _, p := range c.classParameters.VendorParameters { - if p.DriverName == driverName { - handle.StructuredData.VendorClassParameters = p.Parameters - break - } - } - } - for _, request := range c.claimParameters.DriverRequests { - if request.DriverName == driverName { - handle.StructuredData.VendorClaimParameters = request.VendorParameters - break - } - } - allocation.ResourceHandles = append(allocation.ResourceHandles, handle) - } - - return c.class.DriverName, allocation, nil -} diff --git a/pkg/scheduler/framework/plugins/dynamicresources/structuredparameters_test.go b/pkg/scheduler/framework/plugins/dynamicresources/structuredparameters_test.go deleted file mode 100644 index 2c82fd9f60870..0000000000000 --- a/pkg/scheduler/framework/plugins/dynamicresources/structuredparameters_test.go +++ /dev/null @@ -1,1257 +0,0 @@ -/* -Copyright 2024 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. -*/ - -package dynamicresources - -import ( - "errors" - "sync" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - v1 "k8s.io/api/core/v1" - resourceapi "k8s.io/api/resource/v1alpha2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - namedresourcesmodel "k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/structured/namedresources" - "k8s.io/kubernetes/test/utils/ktesting" - "k8s.io/utils/ptr" -) - -func TestModel(t *testing.T) { - testcases := map[string]struct { - slices resourceSliceLister - claims assumeCacheLister - inFlight map[types.UID]resourceapi.ResourceClaimStatus - - wantResources resources - wantErr bool - }{ - "empty": {}, - - "slice-list-error": { - slices: sliceError("slice list error"), - - wantErr: true, - }, - - "unknown-model": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node", - DriverName: "driver", - ResourceModel: resourceapi.ResourceModel{ /* empty! */ }, - }, - }, - - // Not an error. It is safe to ignore unknown resources until a claim requests them. - // The unknown model in that claim then triggers an error for that claim. - wantResources: resources{"node": map[string]ResourceModels{ - "driver": { - NamedResources: namedresourcesmodel.Model{}, - }, - }}, - }, - - "one-instance": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node", - DriverName: "driver", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{ - Name: "one", - Attributes: []resourceapi.NamedResourcesAttribute{{ - Name: "size", - NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{ - IntValue: ptr.To(int64(1)), - }, - }}, - }}, - }, - }, - }, - }, - - wantResources: resources{"node": map[string]ResourceModels{ - "driver": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{ - Name: "one", - Attributes: []resourceapi.NamedResourcesAttribute{{ - Name: "size", - NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{ - IntValue: ptr.To(int64(1)), - }, - }}, - }, - }, - }, - }, - }, - }}, - }, - - "two-instances": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node", - DriverName: "driver", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - }, - - wantResources: resources{"node": map[string]ResourceModels{ - "driver": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }}, - }, - - "two-nodes": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - }, - - wantResources: resources{ - "node-a": map[string]ResourceModels{ - "driver": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }, - "node-b": map[string]ResourceModels{ - "driver": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - }, - }, - }, - - "two-nodes-two-drivers": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - }, - - wantResources: resources{ - "node-a": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }, - "node-b": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - }, - }, - }, - - "in-use-simple": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - }, - - claims: claimList{ - &resourceapi.ResourceClaim{ - /* not allocated */ - }, - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "driver-a", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{{ - // Claims not allocated via structured parameters can be ignored. - }}, - }, - }, - }, - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "driver-a", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{{ - DriverName: "driver-a", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-b", - // Unknown allocations can be ignored. - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{}, - }}, - }, - }}, - }, - }, - }, - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "driver-a", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{{ - DriverName: "driver-a", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-a", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "two", - }, - }, - }}, - }, - }}, - }, - }, - }, - }, - - wantResources: resources{ - "node-a": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }, - "node-b": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - }, - }, - }, - - "in-use-meta-driver": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - }, - - claims: claimList{ - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "meta-driver", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{{ - DriverName: "driver-b", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-b", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "X", - }, - }, - }}, - }, - }}, - }, - }, - }, - }, - - wantResources: resources{ - "node-a": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }, - "node-b": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - }, - }, - }, - - "in-use-many-results": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - }, - - claims: claimList{ - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "driver-a", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{{ - DriverName: "driver-a", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-a", - Results: []resourceapi.DriverAllocationResult{ - { - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "one", - }, - }, - }, - { - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "two", - }, - }, - }, - }, - }, - }}, - }, - }, - }, - }, - - wantResources: resources{ - "node-a": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }, - "node-b": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - }, - }, - }, - - "in-use-many-handles": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-a", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}, {Name: "two"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-a", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - &resourceapi.ResourceSlice{ - NodeName: "node-b", - DriverName: "driver-b", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "X"}, {Name: "Y"}}, - }, - }, - }, - }, - - claims: claimList{ - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "meta-driver", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{ - { - DriverName: "driver-a", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-b", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "X", - }, - }, - }}, - }, - }, - { - DriverName: "driver-b", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-b", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "X", - }, - }, - }}, - }, - }, - }, - }, - }, - }, - }, - - wantResources: resources{ - "node-a": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "two"}, - }, - }, - }, - }, - }, - "node-b": map[string]ResourceModels{ - "driver-a": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - "driver-b": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "X"}, - }, - { - Instance: &resourceapi.NamedResourcesInstance{Name: "Y"}, - }, - }, - }, - }, - }, - }, - }, - - "orphaned-allocations": { - claims: claimList{ - &resourceapi.ResourceClaim{ - Status: resourceapi.ResourceClaimStatus{ - DriverName: "meta-driver", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{ - { - DriverName: "driver-a", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-b", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "X", - }, - }, - }}, - }, - }, - { - DriverName: "driver-b", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node-b", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "X", - }, - }, - }}, - }, - }, - }, - }, - }, - }, - }, - - wantResources: resources{ - "node-b": map[string]ResourceModels{}, - }, - }, - - "in-flight": { - slices: sliceList{ - &resourceapi.ResourceSlice{ - NodeName: "node", - DriverName: "driver", - ResourceModel: resourceapi.ResourceModel{ - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: []resourceapi.NamedResourcesInstance{{Name: "one"}}, - }, - }, - }, - }, - - claims: claimList{ - &resourceapi.ResourceClaim{ - ObjectMeta: metav1.ObjectMeta{ - UID: "abc", - }, - // Allocation not recorded yet. - }, - }, - - inFlight: map[types.UID]resourceapi.ResourceClaimStatus{ - "abc": { - DriverName: "driver", - Allocation: &resourceapi.AllocationResult{ - ResourceHandles: []resourceapi.ResourceHandle{{ - DriverName: "driver", - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: "node", - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: "one", - }, - }, - }}, - }, - }}, - }, - }, - }, - - wantResources: resources{"node": map[string]ResourceModels{ - "driver": { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{ - { - Allocated: true, - Instance: &resourceapi.NamedResourcesInstance{Name: "one"}, - }, - }, - }, - }, - }}, - }, - } - - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - tCtx := ktesting.Init(t) - - var inFlightAllocations sync.Map - for uid, claimStatus := range tc.inFlight { - inFlightAllocations.Store(uid, &resourceapi.ResourceClaim{Status: claimStatus}) - } - - slices := tc.slices - if slices == nil { - slices = sliceList{} - } - claims := tc.claims - if claims == nil { - claims = claimList{} - } - actualResources, actualErr := newResourceModel(tCtx.Logger(), slices, claims, &inFlightAllocations) - - if actualErr != nil { - if !tc.wantErr { - tCtx.Fatalf("unexpected error: %v", actualErr) - } - return - } - if tc.wantErr { - tCtx.Fatalf("did not get expected error") - } - - expectResources := tc.wantResources - if expectResources == nil { - expectResources = resources{} - } - require.Equal(tCtx, expectResources, actualResources) - }) - } -} - -type sliceList []*resourceapi.ResourceSlice - -func (l sliceList) List(selector labels.Selector) ([]*resourceapi.ResourceSlice, error) { - return l, nil -} - -type sliceError string - -func (l sliceError) List(selector labels.Selector) ([]*resourceapi.ResourceSlice, error) { - return nil, errors.New(string(l)) -} - -type claimList []any - -func (l claimList) List(indexObj any) []any { - return l -} - -func TestController(t *testing.T) { - driver1 := "driver-1" - class1 := &resourceapi.ResourceClass{ - DriverName: driver1, - } - - classParametersEmpty := &resourceapi.ResourceClassParameters{} - classParametersAny := &resourceapi.ResourceClassParameters{ - Filters: []resourceapi.ResourceFilter{{ - DriverName: driver1, - ResourceFilterModel: resourceapi.ResourceFilterModel{ - NamedResources: &resourceapi.NamedResourcesFilter{ - Selector: "true", - }, - }, - }}, - } - - claimParametersEmpty := &resourceapi.ResourceClaimParameters{} - claimParametersAny := &resourceapi.ResourceClaimParameters{ - DriverRequests: []resourceapi.DriverRequests{{ - DriverName: driver1, - }}, - } - claimParametersOne := &resourceapi.ResourceClaimParameters{ - DriverRequests: []resourceapi.DriverRequests{{ - DriverName: driver1, - Requests: []resourceapi.ResourceRequest{{ - ResourceRequestModel: resourceapi.ResourceRequestModel{ - NamedResources: &resourceapi.NamedResourcesRequest{ - Selector: "true", - }, - }, - }}, - }}, - } - claimParametersBroken := &resourceapi.ResourceClaimParameters{ - DriverRequests: []resourceapi.DriverRequests{{ - DriverName: driver1, - Requests: []resourceapi.ResourceRequest{{ - ResourceRequestModel: resourceapi.ResourceRequestModel{ - NamedResources: &resourceapi.NamedResourcesRequest{ - Selector: `attributes.bool["no-such-attribute"]`, - }, - }, - }}, - }}, - } - - instance1 := "instance-1" - - node1 := "node-1" - node1Selector := &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{{ - MatchExpressions: []v1.NodeSelectorRequirement{{ - Key: "kubernetes.io/hostname", - Operator: v1.NodeSelectorOpIn, - Values: []string{node1}, - }}, - }}, - } - node1Resources := resources{node1: map[string]ResourceModels{ - driver1: { - NamedResources: namedresourcesmodel.Model{ - Instances: []namedresourcesmodel.InstanceAllocation{{ - Instance: &resourceapi.NamedResourcesInstance{ - Name: instance1, - }, - }}, - }, - }, - }} - node1Allocation := &resourceapi.AllocationResult{ - AvailableOnNodes: node1Selector, - } - - instance1Allocation := &resourceapi.AllocationResult{ - AvailableOnNodes: node1Selector, - ResourceHandles: []resourceapi.ResourceHandle{{ - DriverName: driver1, - StructuredData: &resourceapi.StructuredResourceHandle{ - NodeName: node1, - Results: []resourceapi.DriverAllocationResult{{ - AllocationResultModel: resourceapi.AllocationResultModel{ - NamedResources: &resourceapi.NamedResourcesAllocationResult{ - Name: instance1, - }, - }, - }}, - }, - }}, - } - - type nodeResult struct { - isSuitable bool - suitableErr string - - driverName string - allocation *resourceapi.AllocationResult - allocateErr string - } - type nodeResults map[string]nodeResult - - testcases := map[string]struct { - resources resources - class *resourceapi.ResourceClass - classParameters *resourceapi.ResourceClassParameters - claimParameters *resourceapi.ResourceClaimParameters - - expectCreateErr bool - expectNodeResults nodeResults - }{ - "empty": { - class: class1, - classParameters: classParametersEmpty, - claimParameters: claimParametersEmpty, - - expectNodeResults: nodeResults{ - node1: {isSuitable: true, driverName: driver1, allocation: node1Allocation}, - }, - }, - - "any": { - class: class1, - classParameters: classParametersEmpty, - claimParameters: claimParametersAny, - - expectNodeResults: nodeResults{ - node1: {isSuitable: true, driverName: driver1, allocation: node1Allocation}, - }, - }, - - "missing-model": { - class: class1, - classParameters: classParametersEmpty, - claimParameters: &resourceapi.ResourceClaimParameters{ - DriverRequests: []resourceapi.DriverRequests{{ - Requests: []resourceapi.ResourceRequest{{ /* empty model */ }}, - }}, - }, - - expectCreateErr: true, - }, - - "no-resources": { - class: class1, - classParameters: classParametersEmpty, - claimParameters: claimParametersOne, - - expectNodeResults: nodeResults{ - node1: {isSuitable: false, allocateErr: "allocating via named resources structured model: insufficient resources"}, - }, - }, - - "have-resources": { - resources: node1Resources, - class: class1, - classParameters: classParametersEmpty, - claimParameters: claimParametersOne, - - expectNodeResults: nodeResults{ - node1: {isSuitable: true, driverName: driver1, allocation: instance1Allocation}, - }, - }, - - "broken-cel": { - resources: node1Resources, - class: class1, - classParameters: classParametersEmpty, - claimParameters: claimParametersBroken, - - expectNodeResults: nodeResults{ - node1: {suitableErr: `checking node "node-1" and resources of driver "driver-1": evaluate request CEL expression: no such key: no-such-attribute`}, - }, - }, - - "class-filter": { - resources: node1Resources, - class: class1, - classParameters: classParametersAny, - claimParameters: claimParametersOne, - - expectNodeResults: nodeResults{ - node1: {isSuitable: true, driverName: driver1, allocation: instance1Allocation}, - }, - }, - - "vendor-parameters": { - resources: node1Resources, - class: class1, - classParameters: func() *resourceapi.ResourceClassParameters { - parameters := classParametersAny.DeepCopy() - parameters.VendorParameters = []resourceapi.VendorParameters{{ - DriverName: driver1, - Parameters: runtime.RawExtension{Raw: []byte("class-parameters")}, - }} - return parameters - }(), - - claimParameters: func() *resourceapi.ResourceClaimParameters { - parameters := claimParametersOne.DeepCopy() - parameters.DriverRequests[0].VendorParameters = runtime.RawExtension{Raw: []byte("claim-parameters")} - parameters.DriverRequests[0].Requests[0].VendorParameters = runtime.RawExtension{Raw: []byte("request-parameters")} - return parameters - }(), - - expectNodeResults: nodeResults{ - node1: {isSuitable: true, driverName: driver1, - allocation: func() *resourceapi.AllocationResult { - allocation := instance1Allocation.DeepCopy() - allocation.ResourceHandles[0].StructuredData.VendorClassParameters = runtime.RawExtension{Raw: []byte("class-parameters")} - allocation.ResourceHandles[0].StructuredData.VendorClaimParameters = runtime.RawExtension{Raw: []byte("claim-parameters")} - allocation.ResourceHandles[0].StructuredData.Results[0].VendorRequestParameters = runtime.RawExtension{Raw: []byte("request-parameters")} - return allocation - }(), - }, - }, - }, - } - - for name, tc := range testcases { - t.Run(name, func(t *testing.T) { - tCtx := ktesting.Init(t) - - controller, err := newClaimController(tCtx.Logger(), tc.class, tc.classParameters, tc.claimParameters) - if err != nil { - if !tc.expectCreateErr { - tCtx.Fatalf("unexpected error: %v", err) - } - return - } - if tc.expectCreateErr { - tCtx.Fatalf("did not get expected error") - } - - for nodeName, expect := range tc.expectNodeResults { - t.Run(nodeName, func(t *testing.T) { - tCtx := ktesting.Init(t) - - isSuitable, err := controller.nodeIsSuitable(tCtx, nodeName, tc.resources) - if err != nil { - if expect.suitableErr == "" { - tCtx.Fatalf("unexpected nodeIsSuitable error: %v", err) - } - require.Equal(tCtx, expect.suitableErr, err.Error()) - return - } - if expect.suitableErr != "" { - tCtx.Fatalf("did not get expected nodeIsSuitable error: %v", expect.suitableErr) - } - assert.Equal(tCtx, expect.isSuitable, isSuitable, "is suitable") - - driverName, allocation, err := controller.allocate(tCtx, nodeName, tc.resources) - if err != nil { - if expect.allocateErr == "" { - tCtx.Fatalf("unexpected allocate error: %v", err) - } - require.Equal(tCtx, expect.allocateErr, err.Error()) - return - } - if expect.allocateErr != "" { - tCtx.Fatalf("did not get expected allocate error: %v", expect.allocateErr) - } - assert.Equal(tCtx, expect.driverName, driverName, "driver name") - assert.Equal(tCtx, expect.allocation, allocation) - }) - } - }) - } -} diff --git a/pkg/scheduler/framework/types.go b/pkg/scheduler/framework/types.go index d066059276f92..43cc16e15dfdf 100644 --- a/pkg/scheduler/framework/types.go +++ b/pkg/scheduler/framework/types.go @@ -93,18 +93,16 @@ const ( // unschedulable pod pool. // This behavior will be removed when we remove the preCheck feature. // See: https://github.com/kubernetes/kubernetes/issues/110175 - Node GVK = "Node" - PersistentVolume GVK = "PersistentVolume" - PersistentVolumeClaim GVK = "PersistentVolumeClaim" - CSINode GVK = "storage.k8s.io/CSINode" - CSIDriver GVK = "storage.k8s.io/CSIDriver" - CSIStorageCapacity GVK = "storage.k8s.io/CSIStorageCapacity" - StorageClass GVK = "storage.k8s.io/StorageClass" - PodSchedulingContext GVK = "PodSchedulingContext" - ResourceClaim GVK = "ResourceClaim" - ResourceClass GVK = "ResourceClass" - ResourceClaimParameters GVK = "ResourceClaimParameters" - ResourceClassParameters GVK = "ResourceClassParameters" + Node GVK = "Node" + PersistentVolume GVK = "PersistentVolume" + PersistentVolumeClaim GVK = "PersistentVolumeClaim" + CSINode GVK = "storage.k8s.io/CSINode" + CSIDriver GVK = "storage.k8s.io/CSIDriver" + CSIStorageCapacity GVK = "storage.k8s.io/CSIStorageCapacity" + StorageClass GVK = "storage.k8s.io/StorageClass" + PodSchedulingContext GVK = "PodSchedulingContext" + ResourceClaim GVK = "ResourceClaim" + DeviceClass GVK = "DeviceClass" // WildCard is a special GVK to match all resources. // e.g., If you register `{Resource: "*", ActionType: All}` in EventsToRegister, @@ -197,9 +195,7 @@ func UnrollWildCardResource() []ClusterEventWithHint { {Event: ClusterEvent{Resource: StorageClass, ActionType: All}}, {Event: ClusterEvent{Resource: PodSchedulingContext, ActionType: All}}, {Event: ClusterEvent{Resource: ResourceClaim, ActionType: All}}, - {Event: ClusterEvent{Resource: ResourceClass, ActionType: All}}, - {Event: ClusterEvent{Resource: ResourceClaimParameters, ActionType: All}}, - {Event: ClusterEvent{Resource: ResourceClassParameters, ActionType: All}}, + {Event: ClusterEvent{Resource: DeviceClass, ActionType: All}}, } } diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index 22ac5054d9c17..bc60816d2e4f7 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -297,7 +297,7 @@ func New(ctx context.Context, var resourceClaimCache *assumecache.AssumeCache if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - resourceClaimInformer := informerFactory.Resource().V1alpha2().ResourceClaims().Informer() + resourceClaimInformer := informerFactory.Resource().V1alpha3().ResourceClaims().Informer() resourceClaimCache = assumecache.NewAssumeCache(logger, resourceClaimInformer, "ResourceClaim", "", nil) } diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go index 5bc55816ffa55..86b317e5b2f31 100644 --- a/pkg/scheduler/scheduler_test.go +++ b/pkg/scheduler/scheduler_test.go @@ -643,13 +643,7 @@ func Test_buildQueueingHintMap(t *testing.T) { {Resource: framework.ResourceClaim, ActionType: framework.All}: { {PluginName: filterWithoutEnqueueExtensions, QueueingHintFn: defaultQueueingHintFn}, }, - {Resource: framework.ResourceClass, ActionType: framework.All}: { - {PluginName: filterWithoutEnqueueExtensions, QueueingHintFn: defaultQueueingHintFn}, - }, - {Resource: framework.ResourceClaimParameters, ActionType: framework.All}: { - {PluginName: filterWithoutEnqueueExtensions, QueueingHintFn: defaultQueueingHintFn}, - }, - {Resource: framework.ResourceClassParameters, ActionType: framework.All}: { + {Resource: framework.DeviceClass, ActionType: framework.All}: { {PluginName: filterWithoutEnqueueExtensions, QueueingHintFn: defaultQueueingHintFn}, }, }, @@ -785,19 +779,17 @@ func Test_UnionedGVKs(t *testing.T) { Disabled: []schedulerapi.Plugin{{Name: "*"}}, // disable default plugins }, want: map[framework.GVK]framework.ActionType{ - framework.Pod: framework.All, - framework.Node: framework.All, - framework.CSINode: framework.All, - framework.CSIDriver: framework.All, - framework.CSIStorageCapacity: framework.All, - framework.PersistentVolume: framework.All, - framework.PersistentVolumeClaim: framework.All, - framework.StorageClass: framework.All, - framework.PodSchedulingContext: framework.All, - framework.ResourceClaim: framework.All, - framework.ResourceClass: framework.All, - framework.ResourceClaimParameters: framework.All, - framework.ResourceClassParameters: framework.All, + framework.Pod: framework.All, + framework.Node: framework.All, + framework.CSINode: framework.All, + framework.CSIDriver: framework.All, + framework.CSIStorageCapacity: framework.All, + framework.PersistentVolume: framework.All, + framework.PersistentVolumeClaim: framework.All, + framework.StorageClass: framework.All, + framework.PodSchedulingContext: framework.All, + framework.ResourceClaim: framework.All, + framework.DeviceClass: framework.All, }, }, { diff --git a/pkg/scheduler/testing/wrappers.go b/pkg/scheduler/testing/wrappers.go index 3ddd79cb61db4..5562555f19271 100644 --- a/pkg/scheduler/testing/wrappers.go +++ b/pkg/scheduler/testing/wrappers.go @@ -21,7 +21,7 @@ import ( "time" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -897,20 +897,20 @@ func (p *PersistentVolumeWrapper) NodeAffinityIn(key string, vals []string) *Per } // ResourceClaimWrapper wraps a ResourceClaim inside. -type ResourceClaimWrapper struct{ resourcev1alpha2.ResourceClaim } +type ResourceClaimWrapper struct{ resourceapi.ResourceClaim } // MakeResourceClaim creates a ResourceClaim wrapper. -func MakeResourceClaim() *ResourceClaimWrapper { - return &ResourceClaimWrapper{resourcev1alpha2.ResourceClaim{}} +func MakeResourceClaim(controller string) *ResourceClaimWrapper { + return &ResourceClaimWrapper{resourceapi.ResourceClaim{Spec: resourceapi.ResourceClaimSpec{Controller: controller}}} } // FromResourceClaim creates a ResourceClaim wrapper from some existing object. -func FromResourceClaim(other *resourcev1alpha2.ResourceClaim) *ResourceClaimWrapper { +func FromResourceClaim(other *resourceapi.ResourceClaim) *ResourceClaimWrapper { return &ResourceClaimWrapper{*other.DeepCopy()} } // Obj returns the inner ResourceClaim. -func (wrapper *ResourceClaimWrapper) Obj() *resourcev1alpha2.ResourceClaim { +func (wrapper *ResourceClaimWrapper) Obj() *resourceapi.ResourceClaim { return &wrapper.ResourceClaim } @@ -946,79 +946,33 @@ func (wrapper *ResourceClaimWrapper) OwnerReference(name, uid string, gvk schema return wrapper } -// AllocationMode sets the allocation mode of the inner object. -func (wrapper *ResourceClaimWrapper) AllocationMode(a resourcev1alpha2.AllocationMode) *ResourceClaimWrapper { - wrapper.ResourceClaim.Spec.AllocationMode = a - return wrapper -} - -// ParametersRef sets a reference to a ResourceClaimParameters.resource.k8s.io. -func (wrapper *ResourceClaimWrapper) ParametersRef(name string) *ResourceClaimWrapper { - wrapper.ResourceClaim.Spec.ParametersRef = &resourcev1alpha2.ResourceClaimParametersReference{ - Name: name, - Kind: "ResourceClaimParameters", - APIGroup: "resource.k8s.io", - } - return wrapper -} - -// ResourceClassName sets the resource class name of the inner object. -func (wrapper *ResourceClaimWrapper) ResourceClassName(name string) *ResourceClaimWrapper { - wrapper.ResourceClaim.Spec.ResourceClassName = name +// Request adds one device request for the given device class. +func (wrapper *ResourceClaimWrapper) Request(deviceClassName string) *ResourceClaimWrapper { + wrapper.Spec.Devices.Requests = append(wrapper.Spec.Devices.Requests, + resourceapi.DeviceRequest{ + Name: fmt.Sprintf("req-%d", len(wrapper.Spec.Devices.Requests)+1), + CountMode: resourceapi.DeviceCountModeExact, + Count: 1, + DeviceClassName: deviceClassName, + }, + ) return wrapper } // Allocation sets the allocation of the inner object. -func (wrapper *ResourceClaimWrapper) Allocation(driverName string, allocation *resourcev1alpha2.AllocationResult) *ResourceClaimWrapper { - wrapper.ResourceClaim.Status.DriverName = driverName +func (wrapper *ResourceClaimWrapper) Allocation(allocation *resourceapi.AllocationResult) *ResourceClaimWrapper { wrapper.ResourceClaim.Status.Allocation = allocation return wrapper } // Structured turns a "normal" claim into one which was allocated via structured parameters. -// This modifies the allocation result and adds the reserved finalizer if the claim -// is allocated. The claim has to become local to a node. The assumption is that -// "named resources" are used. -func (wrapper *ResourceClaimWrapper) Structured(nodeName string, namedResourcesInstances ...string) *ResourceClaimWrapper { +// The only difference is that there is no controller name and the special finalizer +// gets added. +func (wrapper *ResourceClaimWrapper) Structured() *ResourceClaimWrapper { + wrapper.Spec.Controller = "" if wrapper.ResourceClaim.Status.Allocation != nil { - wrapper.ResourceClaim.Finalizers = append(wrapper.ResourceClaim.Finalizers, resourcev1alpha2.Finalizer) - for i, resourceHandle := range wrapper.ResourceClaim.Status.Allocation.ResourceHandles { - resourceHandle.Data = "" - resourceHandle.StructuredData = &resourcev1alpha2.StructuredResourceHandle{ - NodeName: nodeName, - } - wrapper.ResourceClaim.Status.Allocation.ResourceHandles[i] = resourceHandle - } - if len(wrapper.ResourceClaim.Status.Allocation.ResourceHandles) == 0 { - wrapper.ResourceClaim.Status.Allocation.ResourceHandles = []resourcev1alpha2.ResourceHandle{{ - DriverName: wrapper.ResourceClaim.Status.DriverName, - StructuredData: &resourcev1alpha2.StructuredResourceHandle{ - NodeName: nodeName, - }, - }} - } - for _, resourceHandle := range wrapper.ResourceClaim.Status.Allocation.ResourceHandles { - for _, name := range namedResourcesInstances { - result := resourcev1alpha2.DriverAllocationResult{ - AllocationResultModel: resourcev1alpha2.AllocationResultModel{ - NamedResources: &resourcev1alpha2.NamedResourcesAllocationResult{ - Name: name, - }, - }, - } - resourceHandle.StructuredData.Results = append(resourceHandle.StructuredData.Results, result) - } - } - wrapper.ResourceClaim.Status.Allocation.Shareable = true - wrapper.ResourceClaim.Status.Allocation.AvailableOnNodes = &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{{ - MatchExpressions: []v1.NodeSelectorRequirement{{ - Key: "kubernetes.io/hostname", - Operator: v1.NodeSelectorOpIn, - Values: []string{nodeName}, - }}, - }}, - } + wrapper.ResourceClaim.Finalizers = append(wrapper.ResourceClaim.Finalizers, resourceapi.Finalizer) + wrapper.ResourceClaim.Status.Allocation.Controller = "" } return wrapper } @@ -1030,33 +984,33 @@ func (wrapper *ResourceClaimWrapper) DeallocationRequested(deallocationRequested } // ReservedFor sets that field of the inner object. -func (wrapper *ResourceClaimWrapper) ReservedFor(consumers ...resourcev1alpha2.ResourceClaimConsumerReference) *ResourceClaimWrapper { +func (wrapper *ResourceClaimWrapper) ReservedFor(consumers ...resourceapi.ResourceClaimConsumerReference) *ResourceClaimWrapper { wrapper.ResourceClaim.Status.ReservedFor = consumers return wrapper } // ReservedFor sets that field of the inner object given information about one pod. func (wrapper *ResourceClaimWrapper) ReservedForPod(podName string, podUID types.UID) *ResourceClaimWrapper { - return wrapper.ReservedFor(resourcev1alpha2.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: podUID}) + return wrapper.ReservedFor(resourceapi.ResourceClaimConsumerReference{Resource: "pods", Name: podName, UID: podUID}) } // PodSchedulingWrapper wraps a PodSchedulingContext inside. type PodSchedulingWrapper struct { - resourcev1alpha2.PodSchedulingContext + resourceapi.PodSchedulingContext } // MakePodSchedulingContexts creates a PodSchedulingContext wrapper. func MakePodSchedulingContexts() *PodSchedulingWrapper { - return &PodSchedulingWrapper{resourcev1alpha2.PodSchedulingContext{}} + return &PodSchedulingWrapper{resourceapi.PodSchedulingContext{}} } // FromPodSchedulingContexts creates a PodSchedulingContext wrapper from an existing object. -func FromPodSchedulingContexts(other *resourcev1alpha2.PodSchedulingContext) *PodSchedulingWrapper { +func FromPodSchedulingContexts(other *resourceapi.PodSchedulingContext) *PodSchedulingWrapper { return &PodSchedulingWrapper{*other.DeepCopy()} } // Obj returns the inner object. -func (wrapper *PodSchedulingWrapper) Obj() *resourcev1alpha2.PodSchedulingContext { +func (wrapper *PodSchedulingWrapper) Obj() *resourceapi.PodSchedulingContext { return &wrapper.PodSchedulingContext } @@ -1115,145 +1069,36 @@ func (wrapper *PodSchedulingWrapper) PotentialNodes(nodes ...string) *PodSchedul } // ResourceClaims sets that field of the inner object. -func (wrapper *PodSchedulingWrapper) ResourceClaims(statuses ...resourcev1alpha2.ResourceClaimSchedulingStatus) *PodSchedulingWrapper { +func (wrapper *PodSchedulingWrapper) ResourceClaims(statuses ...resourceapi.ResourceClaimSchedulingStatus) *PodSchedulingWrapper { wrapper.Status.ResourceClaims = statuses return wrapper } type ResourceSliceWrapper struct { - resourcev1alpha2.ResourceSlice + resourceapi.ResourceSlice } func MakeResourceSlice(nodeName, driverName string) *ResourceSliceWrapper { wrapper := new(ResourceSliceWrapper) wrapper.Name = nodeName + "-" + driverName - wrapper.NodeName = nodeName - wrapper.DriverName = driverName + wrapper.Spec.NodeName = nodeName + wrapper.Spec.Pool.Name = nodeName + wrapper.Spec.Driver = driverName return wrapper } -func (wrapper *ResourceSliceWrapper) Obj() *resourcev1alpha2.ResourceSlice { +func (wrapper *ResourceSliceWrapper) Obj() *resourceapi.ResourceSlice { return &wrapper.ResourceSlice } -func (wrapper *ResourceSliceWrapper) NamedResourcesInstances(names ...string) *ResourceSliceWrapper { - wrapper.ResourceModel = resourcev1alpha2.ResourceModel{NamedResources: &resourcev1alpha2.NamedResourcesResources{}} +func (wrapper *ResourceSliceWrapper) Devices(names ...string) *ResourceSliceWrapper { for _, name := range names { - wrapper.ResourceModel.NamedResources.Instances = append(wrapper.ResourceModel.NamedResources.Instances, - resourcev1alpha2.NamedResourcesInstance{Name: name}, - ) - } - return wrapper -} - -type ClaimParametersWrapper struct { - resourcev1alpha2.ResourceClaimParameters -} - -func MakeClaimParameters() *ClaimParametersWrapper { - return &ClaimParametersWrapper{} -} - -// FromClaimParameters creates a ResourceClaimParameters wrapper from an existing object. -func FromClaimParameters(other *resourcev1alpha2.ResourceClaimParameters) *ClaimParametersWrapper { - return &ClaimParametersWrapper{*other.DeepCopy()} -} - -func (wrapper *ClaimParametersWrapper) Obj() *resourcev1alpha2.ResourceClaimParameters { - return &wrapper.ResourceClaimParameters -} - -func (wrapper *ClaimParametersWrapper) Name(s string) *ClaimParametersWrapper { - wrapper.SetName(s) - return wrapper -} - -func (wrapper *ClaimParametersWrapper) UID(s string) *ClaimParametersWrapper { - wrapper.SetUID(types.UID(s)) - return wrapper -} - -func (wrapper *ClaimParametersWrapper) Namespace(s string) *ClaimParametersWrapper { - wrapper.SetNamespace(s) - return wrapper -} - -func (wrapper *ClaimParametersWrapper) Shareable(value bool) *ClaimParametersWrapper { - wrapper.ResourceClaimParameters.Shareable = value - return wrapper -} - -func (wrapper *ClaimParametersWrapper) GeneratedFrom(value *resourcev1alpha2.ResourceClaimParametersReference) *ClaimParametersWrapper { - wrapper.ResourceClaimParameters.GeneratedFrom = value - return wrapper -} - -func (wrapper *ClaimParametersWrapper) NamedResourcesRequests(driverName string, selectors ...string) *ClaimParametersWrapper { - requests := resourcev1alpha2.DriverRequests{ - DriverName: driverName, - } - for _, selector := range selectors { - request := resourcev1alpha2.ResourceRequest{ - ResourceRequestModel: resourcev1alpha2.ResourceRequestModel{ - NamedResources: &resourcev1alpha2.NamedResourcesRequest{ - Selector: selector, - }, - }, - } - requests.Requests = append(requests.Requests, request) + wrapper.Spec.Devices = append(wrapper.Spec.Devices, resourceapi.Device{Name: name}) } - wrapper.DriverRequests = append(wrapper.DriverRequests, requests) - return wrapper -} - -type ClassParametersWrapper struct { - resourcev1alpha2.ResourceClassParameters -} - -func MakeClassParameters() *ClassParametersWrapper { - return &ClassParametersWrapper{} -} - -// FromClassParameters creates a ResourceClassParameters wrapper from an existing object. -func FromClassParameters(other *resourcev1alpha2.ResourceClassParameters) *ClassParametersWrapper { - return &ClassParametersWrapper{*other.DeepCopy()} -} - -func (wrapper *ClassParametersWrapper) Obj() *resourcev1alpha2.ResourceClassParameters { - return &wrapper.ResourceClassParameters -} - -func (wrapper *ClassParametersWrapper) Name(s string) *ClassParametersWrapper { - wrapper.SetName(s) - return wrapper -} - -func (wrapper *ClassParametersWrapper) UID(s string) *ClassParametersWrapper { - wrapper.SetUID(types.UID(s)) return wrapper } -func (wrapper *ClassParametersWrapper) Namespace(s string) *ClassParametersWrapper { - wrapper.SetNamespace(s) - return wrapper -} - -func (wrapper *ClassParametersWrapper) GeneratedFrom(value *resourcev1alpha2.ResourceClassParametersReference) *ClassParametersWrapper { - wrapper.ResourceClassParameters.GeneratedFrom = value - return wrapper -} - -func (wrapper *ClassParametersWrapper) NamedResourcesFilters(driverName string, selectors ...string) *ClassParametersWrapper { - for _, selector := range selectors { - filter := resourcev1alpha2.ResourceFilter{ - DriverName: driverName, - ResourceFilterModel: resourcev1alpha2.ResourceFilterModel{ - NamedResources: &resourcev1alpha2.NamedResourcesFilter{ - Selector: selector, - }, - }, - } - wrapper.Filters = append(wrapper.Filters, filter) - } +func (wrapper *ResourceSliceWrapper) Device(name string, attrs map[resourceapi.QualifiedName]resourceapi.DeviceAttribute) *ResourceSliceWrapper { + wrapper.Spec.Devices = append(wrapper.Spec.Devices, resourceapi.Device{Name: name, Basic: &resourceapi.BasicDevice{Attributes: attrs}}) return wrapper } diff --git a/plugin/pkg/admission/noderestriction/admission.go b/plugin/pkg/admission/noderestriction/admission.go index 9388ac52252f9..3cefa080ab1ee 100644 --- a/plugin/pkg/admission/noderestriction/admission.go +++ b/plugin/pkg/admission/noderestriction/admission.go @@ -641,16 +641,31 @@ func (p *Plugin) admitCSINode(nodeName string, a admission.Attributes) error { func (p *Plugin) admitResourceSlice(nodeName string, a admission.Attributes) error { // The create request must come from a node with the same name as the NodeName field. - // Other requests gets checked by the node authorizer. - if a.GetOperation() == admission.Create { + // Same when deleting an object. + // + // Other requests get checked by the node authorizer. The checks here are necessary + // because the node authorizer does not know the object content for a create request + // and not each deleted object in a DeleteCollection. DeleteCollection checks each + // individual object. + switch a.GetOperation() { + case admission.Create: slice, ok := a.GetObject().(*resource.ResourceSlice) if !ok { return admission.NewForbidden(a, fmt.Errorf("unexpected type %T", a.GetObject())) } - if slice.NodeName != nodeName { + if slice.Spec.NodeName != nodeName { return admission.NewForbidden(a, errors.New("can only create ResourceSlice with the same NodeName as the requesting node")) } + case admission.Delete: + slice, ok := a.GetOldObject().(*resource.ResourceSlice) + if !ok { + return admission.NewForbidden(a, fmt.Errorf("unexpected type %T", a.GetOldObject())) + } + + if slice.Spec.NodeName != nodeName { + return admission.NewForbidden(a, errors.New("can only delete ResourceSlice with the same NodeName as the requesting node")) + } } return nil diff --git a/plugin/pkg/admission/noderestriction/admission_test.go b/plugin/pkg/admission/noderestriction/admission_test.go index d4eb6d8fef466..9913b185557d1 100644 --- a/plugin/pkg/admission/noderestriction/admission_test.go +++ b/plugin/pkg/admission/noderestriction/admission_test.go @@ -1607,70 +1607,153 @@ func TestAdmitResourceSlice(t *testing.T) { apiResource := resourceapi.SchemeGroupVersion.WithResource("resourceslices") nodename := "mynode" mynode := &user.DefaultInfo{Name: "system:node:" + nodename, Groups: []string{"system:nodes"}} - err := "can only create ResourceSlice with the same NodeName as the requesting node" + createErr := "can only create ResourceSlice with the same NodeName as the requesting node" + deleteErr := "can only delete ResourceSlice with the same NodeName as the requesting node" sliceNode := &resourceapi.ResourceSlice{ ObjectMeta: metav1.ObjectMeta{ Name: "something", }, - NodeName: nodename, + Spec: resourceapi.ResourceSliceSpec{ + NodeName: nodename, + }, } sliceOtherNode := &resourceapi.ResourceSlice{ ObjectMeta: metav1.ObjectMeta{ Name: "something", }, - NodeName: nodename + "-other", + Spec: resourceapi.ResourceSliceSpec{ + NodeName: nodename + "-other", + }, + } + sliceNoNode := &resourceapi.ResourceSlice{ + ObjectMeta: metav1.ObjectMeta{ + Name: "something", + }, + Spec: resourceapi.ResourceSliceSpec{ + NodeName: "", + }, } tests := map[string]struct { operation admission.Operation - obj runtime.Object + options runtime.Object + obj, oldObj runtime.Object featureEnabled bool expectError string }{ "create allowed, enabled": { operation: admission.Create, + options: &metav1.CreateOptions{}, obj: sliceNode, featureEnabled: true, expectError: "", }, "create disallowed, enabled": { operation: admission.Create, + options: &metav1.CreateOptions{}, obj: sliceOtherNode, featureEnabled: true, - expectError: err, + expectError: createErr, + }, + "create disallowed, no node name, enabled": { + operation: admission.Create, + options: &metav1.CreateOptions{}, + obj: sliceNoNode, + featureEnabled: true, + expectError: createErr, }, "create allowed, disabled": { operation: admission.Create, + options: &metav1.CreateOptions{}, obj: sliceNode, featureEnabled: false, expectError: "", }, "create disallowed, disabled": { operation: admission.Create, + options: &metav1.CreateOptions{}, obj: sliceOtherNode, featureEnabled: false, - expectError: err, + expectError: createErr, + }, + "create disallowed, no node name, disabled": { + operation: admission.Create, + options: &metav1.CreateOptions{}, + obj: sliceNoNode, + featureEnabled: false, + expectError: createErr, }, "update allowed, same node": { operation: admission.Update, + options: &metav1.UpdateOptions{}, obj: sliceNode, featureEnabled: true, expectError: "", }, "update allowed, other node": { operation: admission.Update, + options: &metav1.UpdateOptions{}, obj: sliceOtherNode, featureEnabled: true, expectError: "", }, + "update allowed, no node": { + operation: admission.Update, + options: &metav1.UpdateOptions{}, + obj: sliceNoNode, + featureEnabled: true, + expectError: "", + }, + "delete allowed, enabled": { + operation: admission.Delete, + options: &metav1.DeleteOptions{}, + oldObj: sliceNode, + featureEnabled: true, + expectError: "", + }, + "delete disallowed, enabled": { + operation: admission.Delete, + options: &metav1.DeleteOptions{}, + oldObj: sliceOtherNode, + featureEnabled: true, + expectError: deleteErr, + }, + "delete disallowed, no node name, enabled": { + operation: admission.Delete, + options: &metav1.DeleteOptions{}, + oldObj: sliceNoNode, + featureEnabled: true, + expectError: deleteErr, + }, + "delete allowed, disabled": { + operation: admission.Delete, + options: &metav1.DeleteOptions{}, + oldObj: sliceNode, + featureEnabled: false, + expectError: "", + }, + "delete disallowed, disabled": { + operation: admission.Delete, + options: &metav1.DeleteOptions{}, + oldObj: sliceOtherNode, + featureEnabled: false, + expectError: deleteErr, + }, + "delete disallowed, no node name, disabled": { + operation: admission.Delete, + options: &metav1.DeleteOptions{}, + oldObj: sliceNoNode, + featureEnabled: false, + expectError: deleteErr, + }, } for name, test := range tests { t.Run(name, func(t *testing.T) { attributes := admission.NewAttributesRecord( - test.obj, nil, schema.GroupVersionKind{}, - "", "foo", apiResource, "", test.operation, &metav1.CreateOptions{}, false, mynode) + test.obj, test.oldObj, schema.GroupVersionKind{}, + "", "foo", apiResource, "", test.operation, test.options, false, mynode) featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.DynamicResourceAllocation, test.featureEnabled) a := &admitTestCase{ name: name, diff --git a/plugin/pkg/auth/authorizer/node/graph_populator.go b/plugin/pkg/auth/authorizer/node/graph_populator.go index 0e4fb0764b080..e0b3c056e8308 100644 --- a/plugin/pkg/auth/authorizer/node/graph_populator.go +++ b/plugin/pkg/auth/authorizer/node/graph_populator.go @@ -22,11 +22,11 @@ import ( "k8s.io/klog/v2" corev1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/util/wait" corev1informers "k8s.io/client-go/informers/core/v1" - resourcev1alpha2informers "k8s.io/client-go/informers/resource/v1alpha2" + resourceinformers "k8s.io/client-go/informers/resource/v1alpha3" storageinformers "k8s.io/client-go/informers/storage/v1" "k8s.io/client-go/tools/cache" ) @@ -41,7 +41,7 @@ func AddGraphEventHandlers( pods corev1informers.PodInformer, pvs corev1informers.PersistentVolumeInformer, attachments storageinformers.VolumeAttachmentInformer, - slices resourcev1alpha2informers.ResourceSliceInformer, + slices resourceinformers.ResourceSliceInformer, ) { g := &graphPopulator{ graph: graph, @@ -201,19 +201,19 @@ func (g *graphPopulator) deleteVolumeAttachment(obj interface{}) { } func (g *graphPopulator) addResourceSlice(obj interface{}) { - slice, ok := obj.(*resourcev1alpha2.ResourceSlice) + slice, ok := obj.(*resourceapi.ResourceSlice) if !ok { klog.Infof("unexpected type %T", obj) return } - g.graph.AddResourceSlice(slice.Name, slice.NodeName) + g.graph.AddResourceSlice(slice.Name, slice.Spec.NodeName) } func (g *graphPopulator) deleteResourceSlice(obj interface{}) { if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { obj = tombstone.Obj } - slice, ok := obj.(*resourcev1alpha2.ResourceSlice) + slice, ok := obj.(*resourceapi.ResourceSlice) if !ok { klog.Infof("unexpected type %T", obj) return diff --git a/plugin/pkg/auth/authorizer/node/node_authorizer.go b/plugin/pkg/auth/authorizer/node/node_authorizer.go index d6b5c8d303745..0b4e4c679b399 100644 --- a/plugin/pkg/auth/authorizer/node/node_authorizer.go +++ b/plugin/pkg/auth/authorizer/node/node_authorizer.go @@ -309,13 +309,21 @@ func (r *NodeAuthorizer) authorizeResourceSlice(nodeName string, attrs authorize return authorizer.DecisionNoOpinion, "cannot authorize ResourceSlice subresources", nil } - // allowed verbs: get, create, update, patch, delete + // allowed verbs: get, create, update, patch, delete, watch, list, deletecollection verb := attrs.GetVerb() switch verb { case "get", "create", "update", "patch", "delete": // Okay, but check individual object permission below. - case "watch", "list": - // Okay. The kubelet is trusted to use a filter for its own objects. + case "watch", "list", "deletecollection": + // Okay. The kubelet is trusted to use a filter for its own objects in watch and list. + // The NodeRestriction admission plugin (plugin/pkg/admission/noderestriction) + // ensures that the node is not deleting some ResourceSlice belonging to + // some other node. + // + // TODO (https://github.com/kubernetes/kubernetes/issues/125355): + // Once https://github.com/kubernetes/enhancements/pull/4600 is implemented, + // this code needs to be extended to verify that the node filter is indeed set. + // Then the admission check can be removed. return authorizer.DecisionAllow, "", nil default: klog.V(2).Infof("NODE DENY: '%s' %#v", nodeName, attrs) diff --git a/plugin/pkg/auth/authorizer/node/node_authorizer_test.go b/plugin/pkg/auth/authorizer/node/node_authorizer_test.go index ac83df0b34473..f903c65772b4c 100644 --- a/plugin/pkg/auth/authorizer/node/node_authorizer_test.go +++ b/plugin/pkg/auth/authorizer/node/node_authorizer_test.go @@ -28,7 +28,7 @@ import ( "time" corev1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apiserver/pkg/authentication/user" @@ -56,7 +56,7 @@ func TestAuthorizer(t *testing.T) { uniqueResourceClaimsPerPod: 1, uniqueResourceClaimTemplatesPerPod: 1, uniqueResourceClaimTemplatesWithClaimPerPod: 1, - nodeResourceCapacitiesPerNode: 2, + nodeResourceSlicesPerNode: 2, } nodes, pods, pvs, attachments, slices := generate(opts) populate(g, nodes, pods, pvs, attachments, slices) @@ -561,7 +561,7 @@ type sampleDataOpts struct { uniqueResourceClaimTemplatesPerPod int uniqueResourceClaimTemplatesWithClaimPerPod int - nodeResourceCapacitiesPerNode int + nodeResourceSlicesPerNode int } func BenchmarkPopulationAllocation(b *testing.B) { @@ -831,7 +831,7 @@ func BenchmarkAuthorization(b *testing.B) { } } -func populate(graph *Graph, nodes []*corev1.Node, pods []*corev1.Pod, pvs []*corev1.PersistentVolume, attachments []*storagev1.VolumeAttachment, slices []*resourcev1alpha2.ResourceSlice) { +func populate(graph *Graph, nodes []*corev1.Node, pods []*corev1.Pod, pvs []*corev1.PersistentVolume, attachments []*storagev1.VolumeAttachment, slices []*resourceapi.ResourceSlice) { p := &graphPopulator{} p.graph = graph for _, pod := range pods { @@ -859,12 +859,12 @@ func randomSubset(a, b int) []int { // the secret/configmap/pvc/node references in the pod and pv objects are named to indicate the connections between the objects. // for example, secret0-pod0-node0 is a secret referenced by pod0 which is bound to node0. // when populated into the graph, the node authorizer should allow node0 to access that secret, but not node1. -func generate(opts *sampleDataOpts) ([]*corev1.Node, []*corev1.Pod, []*corev1.PersistentVolume, []*storagev1.VolumeAttachment, []*resourcev1alpha2.ResourceSlice) { +func generate(opts *sampleDataOpts) ([]*corev1.Node, []*corev1.Pod, []*corev1.PersistentVolume, []*storagev1.VolumeAttachment, []*resourceapi.ResourceSlice) { nodes := make([]*corev1.Node, 0, opts.nodes) pods := make([]*corev1.Pod, 0, opts.nodes*opts.podsPerNode) pvs := make([]*corev1.PersistentVolume, 0, (opts.nodes*opts.podsPerNode*opts.uniquePVCsPerPod)+(opts.sharedPVCsPerPod*opts.namespaces)) attachments := make([]*storagev1.VolumeAttachment, 0, opts.nodes*opts.attachmentsPerNode) - slices := make([]*resourcev1alpha2.ResourceSlice, 0, opts.nodes*opts.nodeResourceCapacitiesPerNode) + slices := make([]*resourceapi.ResourceSlice, 0, opts.nodes*opts.nodeResourceSlicesPerNode) rand.Seed(12345) @@ -891,11 +891,13 @@ func generate(opts *sampleDataOpts) ([]*corev1.Node, []*corev1.Pod, []*corev1.Pe Spec: corev1.NodeSpec{}, }) - for p := 0; p <= opts.nodeResourceCapacitiesPerNode; p++ { + for p := 0; p <= opts.nodeResourceSlicesPerNode; p++ { name := fmt.Sprintf("slice%d-%s", p, nodeName) - slice := &resourcev1alpha2.ResourceSlice{ + slice := &resourceapi.ResourceSlice{ ObjectMeta: metav1.ObjectMeta{Name: name}, - NodeName: nodeName, + Spec: resourceapi.ResourceSliceSpec{ + NodeName: nodeName, + }, } slices = append(slices, slice) } diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go index f91da6e2673dd..d330f5c9dcf17 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go @@ -181,6 +181,7 @@ func NodeRules() []rbacv1.PolicyRule { // DRA Resource Claims if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { nodePolicyRules = append(nodePolicyRules, rbacv1helpers.NewRule("get").Groups(resourceGroup).Resources("resourceclaims").RuleOrDie()) + nodePolicyRules = append(nodePolicyRules, rbacv1helpers.NewRule("deletecollection").Groups(resourceGroup).Resources("resourceslices").RuleOrDie()) } // Kubelet needs access to ClusterTrustBundles to support the pemTrustAnchors volume type. if utilfeature.DefaultFeatureGate.Enabled(features.ClusterTrustBundle) { @@ -577,13 +578,13 @@ func ClusterRoles() []rbacv1.ClusterRole { // Needed for dynamic resource allocation. if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { kubeSchedulerRules = append(kubeSchedulerRules, - rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("resourceclasses").RuleOrDie(), + rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("deviceclasses").RuleOrDie(), rbacv1helpers.NewRule(ReadUpdate...).Groups(resourceGroup).Resources("resourceclaims").RuleOrDie(), rbacv1helpers.NewRule(ReadUpdate...).Groups(resourceGroup).Resources("resourceclaims/status").RuleOrDie(), rbacv1helpers.NewRule(ReadWrite...).Groups(resourceGroup).Resources("podschedulingcontexts").RuleOrDie(), rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("podschedulingcontexts/status").RuleOrDie(), rbacv1helpers.NewRule(ReadUpdate...).Groups(legacyGroup).Resources("pods/finalizers").RuleOrDie(), - rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("resourceslices", "resourceclassparameters", "resourceclaimparameters").RuleOrDie(), + rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("resourceslices").RuleOrDie(), ) } roles = append(roles, rbacv1.ClusterRole{ diff --git a/staging/publishing/import-restrictions.yaml b/staging/publishing/import-restrictions.yaml index ad48080bc8789..79133f0425ab2 100644 --- a/staging/publishing/import-restrictions.yaml +++ b/staging/publishing/import-restrictions.yaml @@ -256,6 +256,7 @@ - k8s.io/apiserver/pkg/cel - k8s.io/apiserver/pkg/cel/environment - k8s.io/client-go + - k8s.io/component-helpers/scheduling/corev1/nodeaffinity - k8s.io/dynamic-resource-allocation - k8s.io/klog - k8s.io/kubelet diff --git a/staging/src/k8s.io/api/core/v1/generated.pb.go b/staging/src/k8s.io/api/core/v1/generated.pb.go index c31185147b3a9..a73562c520caf 100644 --- a/staging/src/k8s.io/api/core/v1/generated.pb.go +++ b/staging/src/k8s.io/api/core/v1/generated.pb.go @@ -6642,996 +6642,996 @@ func init() { } var fileDescriptor_6c07b07c062484ab = []byte{ - // 15811 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x8c, 0x1c, 0xc9, - 0x75, 0x30, 0xa8, 0xac, 0xea, 0xf3, 0xf5, 0x1d, 0x4d, 0x72, 0x9a, 0x3d, 0x24, 0x8b, 0x93, 0x33, - 0xc3, 0xe1, 0x5c, 0x4d, 0x71, 0x0e, 0x0d, 0x35, 0x33, 0x1a, 0xab, 0x4f, 0xb2, 0x86, 0xec, 0x66, - 0x4d, 0x54, 0x93, 0x94, 0x46, 0x23, 0x59, 0xc9, 0xaa, 0xe8, 0xee, 0x54, 0x57, 0x65, 0xd6, 0x64, - 0x66, 0x35, 0xd9, 0x5c, 0x19, 0xb6, 0xe5, 0xb5, 0x6c, 0xc9, 0x5e, 0x40, 0x58, 0x78, 0x0f, 0xc8, - 0x86, 0xb1, 0xf0, 0x7a, 0x7d, 0xac, 0xd6, 0xc6, 0x6a, 0xe5, 0xf5, 0x25, 0x5f, 0x7b, 0x01, 0xf6, - 0xee, 0xc2, 0xeb, 0x35, 0xb0, 0x92, 0xb1, 0xc6, 0xb6, 0x57, 0xed, 0x0f, 0x30, 0xfc, 0xe3, 0xb3, - 0x0d, 0x7f, 0xdf, 0x8f, 0xef, 0x6b, 0xf8, 0xfb, 0xfc, 0x21, 0xce, 0x8c, 0xc8, 0xa3, 0xaa, 0x9a, - 0x43, 0xb6, 0x46, 0xc2, 0xfc, 0xab, 0x7a, 0xef, 0xc5, 0x8b, 0xc8, 0x38, 0x5f, 0xbc, 0xf7, 0xe2, - 0x3d, 0xb0, 0xb7, 0x2f, 0x85, 0x73, 0xae, 0x7f, 0xc1, 0x69, 0xb9, 0x17, 0x6a, 0x7e, 0x40, 0x2e, - 0xec, 0x5c, 0xbc, 0xb0, 0x49, 0x3c, 0x12, 0x38, 0x11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 0xa4, 0xbf, 0x6f, 0xe0, 0xb2, 0xf8, 0xe4, + // 15822 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x59, 0x8c, 0x1c, 0xd9, + 0x75, 0x20, 0xaa, 0xc8, 0xac, 0xf5, 0xd4, 0x7e, 0x8b, 0x4b, 0xb1, 0x9a, 0x64, 0xb2, 0xa3, 0xbb, + 0xd9, 0xec, 0xad, 0x28, 0xf6, 0xa2, 0xa6, 0xba, 0x5b, 0x6d, 0xd5, 0x4a, 0x66, 0x93, 0x55, 0xcc, + 0xbe, 0x59, 0x24, 0xa5, 0x56, 0x4b, 0x56, 0x30, 0xf3, 0x56, 0x55, 0xa8, 0x32, 0x23, 0xb2, 0x23, + 0x22, 0x8b, 0x2c, 0x3e, 0x19, 0xb6, 0xe5, 0x67, 0xd9, 0x92, 0xfd, 0x00, 0xe1, 0xc1, 0x6f, 0x81, + 0x6c, 0x18, 0x0f, 0x7e, 0x7e, 0x5e, 0x9e, 0x9e, 0x8d, 0xa7, 0x91, 0xc7, 0x9b, 0xbc, 0xcd, 0x06, + 0xd8, 0x33, 0x03, 0x8f, 0xc7, 0xc0, 0x48, 0xc6, 0x18, 0x53, 0x1e, 0xd1, 0x03, 0x18, 0xfe, 0x18, + 0xdb, 0xf0, 0xcc, 0xc7, 0x4c, 0xc1, 0x33, 0x1e, 0xdc, 0x35, 0xee, 0x8d, 0x25, 0x33, 0x8b, 0x4d, + 0x96, 0x5a, 0x42, 0xff, 0x65, 0x9e, 0x73, 0xee, 0xb9, 0x37, 0xee, 0x7a, 0xee, 0x39, 0xe7, 0x9e, + 0x03, 0xf6, 0xf6, 0xc5, 0x70, 0xce, 0xf5, 0xcf, 0x3b, 0x2d, 0xf7, 0x7c, 0xcd, 0x0f, 0xc8, 0xf9, + 0x9d, 0x0b, 0xe7, 0x37, 0x89, 0x47, 0x02, 0x27, 0x22, 0xf5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7e, 0x4c, 0x74, 0x6d, 0x1f, 0x1d, 0xab, 0xfd, 0xbd, 0xd2, 0x74, + 0x82, 0x9c, 0x0d, 0x25, 0x2b, 0x80, 0x3e, 0x0a, 0x93, 0x0d, 0xbf, 0xe6, 0x34, 0xb6, 0xfc, 0x30, + 0x12, 0x58, 0x31, 0xf4, 0x47, 0xee, 0xed, 0x95, 0x26, 0xaf, 0x26, 0x70, 0x38, 0x45, 0x6d, 0xdf, + 0x85, 0xf1, 0xf9, 0x28, 0x72, 0x6a, 0x5b, 0xa4, 0xce, 0x27, 0x14, 0x7a, 0x11, 0xfa, 0x3c, 0xa7, + 0x29, 0x1b, 0x73, 0x46, 0x36, 0x66, 0xcd, 0x69, 0xd2, 0xc6, 0x4c, 0x5e, 0xf7, 0xdc, 0x77, 0xda, + 0x62, 0x92, 0x52, 0x18, 0x66, 0xd4, 0xe8, 0x79, 0x80, 0x3a, 0xd9, 0x71, 0x6b, 0xa4, 0xe2, 0x44, + 0x5b, 0xa2, 0x0d, 0x48, 0x94, 0x85, 0x25, 0x85, 0xc1, 0x1a, 0x95, 0x7d, 0x07, 0x86, 0xe7, 0x77, + 0x7c, 0xb7, 0x5e, 0xf1, 0xeb, 0x21, 0xda, 0x86, 0x89, 0x56, 0x40, 0x36, 0x48, 0xa0, 0x40, 0x33, + 0xd6, 0x99, 0xe2, 0xb9, 0x91, 0xe7, 0xcf, 0x65, 0xf6, 0xbd, 0x49, 0xba, 0xec, 0x45, 0xc1, 0xee, + 0xc2, 0x71, 0x51, 0xdf, 0x44, 0x02, 0x8b, 0x93, 0x9c, 0xed, 0x7f, 0x5a, 0x80, 0xa3, 0xf3, 0x77, + 0xdb, 0x01, 0x59, 0x72, 0xc3, 0xed, 0xe4, 0x82, 0xab, 0xbb, 0xe1, 0xf6, 0x5a, 0xdc, 0x03, 0x6a, + 0xa6, 0x2f, 0x09, 0x38, 0x56, 0x14, 0xe8, 0x39, 0x18, 0xa4, 0xbf, 0xaf, 0xe3, 0xb2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, 0xad, 0x7a, 0xfd, 0xd8, 0x2b, 0x74, 0x3c, 0xf6, 0xe2, 0x43, 0xb4, 0x98, - 0x7b, 0x88, 0xfe, 0x70, 0xc6, 0x92, 0xed, 0x63, 0x4b, 0xf6, 0xa3, 0x39, 0x4b, 0xf6, 0x01, 0x2f, - 0xd4, 0x9d, 0x9c, 0x59, 0xdb, 0xcf, 0x06, 0x30, 0x53, 0x42, 0x62, 0xb2, 0x5f, 0x72, 0xab, 0x3d, - 0xe4, 0xd4, 0x7d, 0x30, 0xe3, 0x58, 0x83, 0xd1, 0x45, 0xa7, 0xe5, 0xdc, 0x76, 0x1b, 0x6e, 0xe4, - 0x92, 0x10, 0x3d, 0x05, 0x45, 0xa7, 0x5e, 0x67, 0xd2, 0xdd, 0xf0, 0xc2, 0xf1, 0xfd, 0xbd, 0x52, - 0x71, 0xbe, 0x4e, 0xc5, 0x0c, 0x50, 0x54, 0xbb, 0x98, 0x52, 0xa0, 0x67, 0xa0, 0xaf, 0x1e, 0xf8, - 0xad, 0x99, 0x02, 0xa3, 0xa4, 0xab, 0xbc, 0x6f, 0x29, 0xf0, 0x5b, 0x09, 0x52, 0x46, 0x63, 0xff, - 0x51, 0x01, 0x4e, 0x2d, 0x92, 0xd6, 0xd6, 0x4a, 0x35, 0xe7, 0xbc, 0x38, 0x0f, 0x43, 0x4d, 0xdf, - 0x73, 0x23, 0x3f, 0x08, 0x45, 0xd5, 0x6c, 0x46, 0xac, 0x0a, 0x18, 0x56, 0x58, 0x74, 0x16, 0xfa, - 0x5a, 0xb1, 0x10, 0x3b, 0x2a, 0x05, 0x60, 0x26, 0xbe, 0x32, 0x0c, 0xa5, 0x68, 0x87, 0x24, 0x10, - 0x33, 0x46, 0x51, 0xdc, 0x08, 0x49, 0x80, 0x19, 0x26, 0x96, 0x04, 0xa8, 0x8c, 0x20, 0x4e, 0x84, - 0x84, 0x24, 0x40, 0x31, 0x58, 0xa3, 0x42, 0x15, 0x18, 0x0e, 0x13, 0x23, 0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x19, 0x61, 0xdb, 0x81, 0x1b, 0xed, 0xd2, 0x55, 0x45, 0xee, 0x44, 0x33, 0x13, 0x1d, 0x15, + 0x52, 0x3a, 0xa9, 0xb2, 0xd4, 0xea, 0x40, 0x9c, 0x64, 0x48, 0x8f, 0x82, 0x30, 0xaa, 0xbb, 0xde, + 0xcc, 0x24, 0xbf, 0x4f, 0xc9, 0x9d, 0xb4, 0x4a, 0x81, 0x98, 0xe3, 0x98, 0x01, 0x96, 0xfe, 0xb8, + 0x46, 0x4f, 0xdc, 0x29, 0x46, 0x18, 0x1b, 0x60, 0x25, 0x02, 0xc7, 0x34, 0x54, 0x08, 0x8e, 0xa2, + 0xdd, 0x19, 0xc4, 0x48, 0xd5, 0x86, 0xb8, 0xbe, 0xfe, 0x71, 0x4c, 0xe1, 0xf6, 0x2d, 0x18, 0x57, + 0xdb, 0x04, 0xeb, 0x13, 0x54, 0x82, 0x7e, 0x26, 0xf6, 0x09, 0xf5, 0xe9, 0x30, 0x6d, 0x02, 0x13, + 0x09, 0x31, 0x87, 0xb3, 0x26, 0xb8, 0x77, 0xc9, 0xc2, 0x6e, 0x44, 0xb8, 0x2e, 0xa2, 0xa8, 0x35, + 0x41, 0x22, 0x70, 0x4c, 0x63, 0xff, 0x77, 0x2e, 0x3e, 0xc7, 0xa7, 0x44, 0x0f, 0xe7, 0xe2, 0xb3, + 0x30, 0xc4, 0x1c, 0x3f, 0xfc, 0x80, 0x5b, 0x67, 0xfb, 0x63, 0x81, 0xf9, 0xb2, 0x80, 0x63, 0x45, + 0x81, 0x5e, 0x85, 0xb1, 0x9a, 0x5e, 0x81, 0x38, 0xd4, 0xd5, 0x36, 0x62, 0xd4, 0x8e, 0x4d, 0x5a, + 0x74, 0x11, 0x86, 0x98, 0x8f, 0x53, 0xcd, 0x6f, 0x08, 0x69, 0x53, 0x4a, 0x26, 0x43, 0x15, 0x01, + 0xdf, 0xd7, 0x7e, 0x63, 0x45, 0x8d, 0xce, 0xc2, 0x00, 0x6d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8, 0xe4, + 0x14, 0x14, 0x37, 0xdd, 0xba, 0x78, 0x4d, 0xab, 0xd0, 0x97, 0x28, 0x7a, 0xd3, 0xad, 0xa3, 0x15, + 0x40, 0x61, 0xbb, 0xd5, 0x6a, 0x30, 0x6f, 0x21, 0xa7, 0x71, 0x29, 0xf0, 0xdb, 0x2d, 0xee, 0xe5, + 0x5b, 0xe4, 0xba, 0x99, 0x6a, 0x0a, 0x8b, 0x33, 0x4a, 0xd8, 0xbf, 0x6e, 0x41, 0xdf, 0x21, 0x0c, + 0x13, 0x36, 0x87, 0xe9, 0xb9, 0x5c, 0xd6, 0x22, 0x53, 0xc1, 0x1c, 0x76, 0x6e, 0x2f, 0xdf, 0x89, + 0x88, 0x17, 0x32, 0x81, 0x23, 0x73, 0xd4, 0xf6, 0x2c, 0x98, 0xbe, 0xea, 0x3b, 0xf5, 0x05, 0xa7, + 0xe1, 0x78, 0x35, 0x12, 0x94, 0xbd, 0xcd, 0x03, 0xb9, 0xd4, 0x17, 0xba, 0xba, 0xd4, 0x5f, 0x84, + 0x01, 0xb7, 0xa5, 0x85, 0x3a, 0x3f, 0x43, 0x47, 0xb7, 0x5c, 0x11, 0x51, 0xce, 0x91, 0x51, 0x39, + 0x83, 0x62, 0x41, 0x4f, 0xa7, 0x25, 0xf7, 0x65, 0xeb, 0xcb, 0x9f, 0x96, 0xf4, 0x8a, 0x91, 0x0c, + 0xe1, 0x65, 0x78, 0x5d, 0x6f, 0x81, 0x51, 0x85, 0x78, 0xb5, 0x87, 0x61, 0xd0, 0xe5, 0x5f, 0x2a, + 0xe6, 0xe6, 0x93, 0xd9, 0xa2, 0x7f, 0xaa, 0x63, 0xb4, 0xf7, 0x68, 0x1c, 0x80, 0x25, 0x23, 0xfb, + 0x22, 0x64, 0x86, 0x5c, 0xe9, 0xae, 0xd6, 0xb1, 0x3f, 0x0e, 0x53, 0xac, 0xe4, 0x01, 0x55, 0x26, + 0x76, 0x42, 0x19, 0x9d, 0x11, 0xb5, 0x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 0x63, - 0xff, 0xff, 0x2a, 0x8f, 0x64, 0x20, 0xf1, 0xe8, 0x93, 0xf0, 0x88, 0x8a, 0x9f, 0x27, 0x66, 0x84, - 0xac, 0x71, 0xc0, 0x50, 0xf1, 0x3c, 0xb2, 0x98, 0x4d, 0x86, 0xf3, 0xca, 0xa3, 0x37, 0x60, 0x5c, - 0xdc, 0x2b, 0x24, 0xc7, 0x41, 0xd3, 0x99, 0xed, 0xaa, 0x81, 0xc5, 0x09, 0x6a, 0x99, 0x95, 0x80, - 0x89, 0xf6, 0x92, 0xc3, 0x50, 0x3a, 0x2b, 0x81, 0x8e, 0xc7, 0xa9, 0x12, 0x68, 0x1e, 0x26, 0xb8, - 0xb8, 0xe7, 0x7a, 0x9b, 0x7c, 0x4c, 0xc4, 0xeb, 0x42, 0xb5, 0x10, 0xae, 0x9b, 0x68, 0x9c, 0xa4, - 0x47, 0x97, 0x60, 0xd4, 0x09, 0x6a, 0x5b, 0x6e, 0x44, 0x6a, 0x54, 0x1a, 0x67, 0xfe, 0x64, 0x9a, - 0x37, 0xe0, 0xbc, 0x86, 0xc3, 0x06, 0xa5, 0x7d, 0x0f, 0xa6, 0x33, 0x42, 0x9c, 0xd0, 0x89, 0xe3, - 0xb4, 0x5c, 0xf9, 0x4d, 0x09, 0x97, 0xfb, 0xf9, 0x4a, 0x59, 0x7e, 0x8d, 0x46, 0x45, 0x67, 0x27, - 0x0b, 0x85, 0xa2, 0x65, 0x5f, 0x56, 0xb3, 0x73, 0x45, 0x22, 0x70, 0x4c, 0x63, 0xff, 0x63, 0x01, - 0x26, 0x32, 0xac, 0x55, 0x2c, 0x03, 0x70, 0xe2, 0x82, 0x13, 0x27, 0xfc, 0x35, 0x93, 0x5c, 0x14, - 0x0e, 0x91, 0xe4, 0xa2, 0xd8, 0x2d, 0xc9, 0x45, 0xdf, 0x7b, 0x49, 0x72, 0x61, 0xf6, 0x58, 0x7f, - 0x4f, 0x3d, 0x96, 0x91, 0x18, 0x63, 0xe0,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, 0xcc, 0xe5, 0x20, 0x4a, 0x62, 0x9d, 0x0d, 0xba, 0x0c, - 0x53, 0xad, 0xc0, 0xf5, 0xd9, 0x9c, 0x50, 0x06, 0xea, 0x19, 0x33, 0x3f, 0x65, 0x25, 0x49, 0x80, - 0xd3, 0x65, 0x58, 0xe8, 0x12, 0x01, 0x9c, 0x39, 0xc9, 0x73, 0x6c, 0x71, 0xf5, 0x03, 0x87, 0x61, - 0x85, 0x45, 0xab, 0x6c, 0x27, 0xe6, 0x9a, 0xb3, 0x99, 0xd9, 0xfc, 0x18, 0x73, 0xba, 0x86, 0x8d, - 0x8b, 0xe5, 0xea, 0x2f, 0x8e, 0x39, 0xa0, 0xba, 0x96, 0xda, 0x9a, 0x5e, 0x6e, 0xc2, 0x99, 0x53, - 0x1d, 0xdc, 0x64, 0x13, 0x37, 0xd9, 0x58, 0x20, 0x30, 0xc0, 0x21, 0x4e, 0xf0, 0x44, 0x1f, 0x87, - 0x49, 0xf1, 0xae, 0x3f, 0xee, 0xa6, 0xd3, 0xf1, 0x53, 0x22, 0x9c, 0xc0, 0xe1, 0x14, 0x35, 0xcf, - 0x71, 0xe5, 0xdc, 0x6e, 0x10, 0xb1, 0xf5, 0x5d, 0x73, 0xbd, 0xed, 0x70, 0xe6, 0x0c, 0xdb, 0x1f, - 0x44, 0x8e, 0xab, 0x24, 0x16, 0x67, 0x94, 0x40, 0xeb, 0x30, 0xd9, 0x0a, 0x08, 0x69, 0xb2, 0x2b, - 0x8c, 0x38, 0xcf, 0x4a, 0x3c, 0x72, 0x0f, 0x6d, 0x49, 0x25, 0x81, 0x3b, 0xc8, 0x80, 0xe1, 0x14, - 0x07, 0x74, 0x07, 0x86, 0xfc, 0x1d, 0x12, 0x6c, 0x11, 0xa7, 0x3e, 0x73, 0xb6, 0xc3, 0x03, 0x37, - 0x71, 0xb8, 0x5d, 0x17, 0xb4, 0x09, 0xff, 0x1f, 0x09, 0xee, 0xee, 0xff, 0x23, 0x2b, 0x43, 0xff,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x56, 0xc5, 0x9d, 0x12, 0x67, 0x21, 0x73, 0x78, 0xd7, - 0xad, 0xef, 0x5d, 0xfa, 0x29, 0x36, 0x87, 0x17, 0x72, 0xcd, 0xe1, 0xbf, 0x60, 0xc1, 0xb1, 0x64, - 0x3d, 0xec, 0x75, 0xf8, 0x97, 0x2c, 0x38, 0x1e, 0x67, 0x6a, 0x49, 0xbb, 0x20, 0xbc, 0xd4, 0x31, - 0x96, 0x56, 0x4e, 0x8b, 0xe3, 0xe0, 0x22, 0xab, 0x59, 0xac, 0x71, 0x76, 0x8d, 0xf6, 0xbf, 0xe9, - 0x83, 0x99, 0xbc, 0x20, 0x5c, 0xec, 0x3d, 0x8c, 0x73, 0xb7, 0xba, 0x4d, 0xee, 0x88, 0x57, 0x07, - 0xf1, 0x7b, 0x18, 0x0e, 0xc6, 0x12, 0x9f, 0x4c, 0xce, 0x53, 0xe8, 0x31, 0x39, 0xcf, 0x16, 0x4c, - 0xdd, 0xd9, 0x22, 0xde, 0x0d, 0x2f, 0x74, 0x22, 0x37, 0xdc, 0x70, 0x99, 0x01, 0x9d, 0xcf, 0x1b, - 0x99, 0x60, 0x7e, 0xea, 0x56, 0x92, 0xe0, 0x60, 0xaf, 0x74, 0xda, 0x00, 0xc4, 0x4d, 0xe6, 0x1b, - 0x09, 0x4e, 0x33, 0x4d, 0xe7, 0x36, 0xea, 0x7b, 0xc8, 0xb9, 0x8d, 0x9a, 0xae, 0x70, 0xbb, 0x91, - 0x8f, 0x1d, 0xd8, 0xb5, 0x75, 0x55, 0x41, 0xb1, 0x46, 0x81, 0x3e, 0x0d, 0x48, 0x4f, 0x4e, 0x67, - 0xc4, 0x40, 0x7d, 0x7e, 0x7f, 0xaf, 0x84, 0xd6, 0x52, 0xd8, 0x83, 0xbd, 0xd2, 0x34, 0x85, 0x96, - 0x3d, 0x7a, 0xfd, 0x8d, 0x03, 0xc7, 0x65, 0x30, 0x42, 0xb7, 0x60, 0x92, 0x42, 0xd9, 0x8a, 0x92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18, 0x15, 0x32, 0xf3, 0x4b, 0x26, 0x19, 0xce, - 0xae, 0x8e, 0x76, 0x74, 0x70, 0xbb, 0xde, 0x29, 0x93, 0x4c, 0x22, 0x7c, 0x0e, 0xef, 0x68, 0xbc, - 0xb0, 0x84, 0x69, 0x41, 0xb4, 0x0e, 0xb0, 0xd1, 0x20, 0x22, 0x2e, 0xa1, 0x70, 0x8a, 0xca, 0x3c, - 0xfd, 0x57, 0x14, 0x95, 0xe0, 0xc3, 0x6e, 0xa2, 0x31, 0x14, 0x6b, 0x7c, 0xe8, 0x54, 0xaa, 0xb9, - 0x5e, 0x9d, 0x04, 0xcc, 0xb8, 0x95, 0x33, 0x95, 0x16, 0x19, 0x45, 0x7a, 0x2a, 0x71, 0x38, 0x16, - 0x1c, 0x18, 0x2f, 0xd2, 0xda, 0xda, 0x08, 0x3b, 0x25, 0x46, 0x58, 0x24, 0xad, 0xad, 0xc4, 0x84, - 0xe2, 0xbc, 0x18, 0x1c, 0x0b, 0x0e, 0x74, 0xc9, 0x6c, 0xd0, 0x05, 0x44, 0x82, 0x99, 0x89, 0xfc, - 0x25, 0xb3, 0xc2, 0x49, 0xd2, 0x4b, 0x46, 0x20, 0xb0, 0x64, 0x82, 0x3e, 0x63, 0x4a, 0x3b, 0x93, - 0x8c, 0xe7, 0xb3, 0x5d, 0xa4, 0x1d, 0x83, 0x6f, 0x67, 0x79, 0xe7, 0x55, 0x28, 0x6c, 0xd4, 0x98, - 0x51, 0x2c, 0xc7, 0x66, 0xb0, 0xb2, 0x68, 0x70, 0x63, 0x81, 0xc6, 0x57, 0x16, 0x71, 0x61, 0xa3, - 0x46, 0xa7, 0xbe, 0x73, 0xaf, 0x1d, 0x90, 0x15, 0xb7, 0x41, 0x44, 0x92, 0x84, 0xcc, 0xa9, 0x3f, - 0x2f, 0x89, 0xd2, 0x53, 0x5f, 0xa1, 0x70, 0xcc, 0x8a, 0xf2, 0x8d, 0x65, 0xb0, 0xe9, 0x7c, 0xbe, - 0x4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, 0xbd, 0x0e, 0x45, 0x6f, 0x23, 0x14, 0x61, 0xd2, 0xb2, 0xdd, 0x52, 0x4d, + 0xc7, 0x5f, 0x1e, 0x06, 0x68, 0x6d, 0xa5, 0x8a, 0x69, 0x41, 0x74, 0x19, 0x8a, 0xc1, 0xad, 0xba, + 0xb0, 0x7e, 0x64, 0x2e, 0x52, 0xbc, 0xb0, 0x94, 0xd3, 0x2a, 0xc6, 0x09, 0x2f, 0x2c, 0x61, 0xca, + 0x02, 0x55, 0xa0, 0x9f, 0x3d, 0xa1, 0x15, 0xa2, 0x6d, 0xe6, 0x55, 0xbe, 0xc3, 0x53, 0x74, 0xfe, + 0x3c, 0x8f, 0x11, 0x60, 0xce, 0x08, 0xad, 0xc3, 0x40, 0x8d, 0x65, 0xcb, 0x17, 0xb2, 0xec, 0x07, + 0x33, 0xed, 0x1c, 0x8c, 0x22, 0x87, 0x27, 0x57, 0xfb, 0x33, 0x0a, 0x2c, 0x78, 0x31, 0xae, 0xa4, + 0xb5, 0xb5, 0x21, 0x4f, 0xac, 0x6c, 0xae, 0xa4, 0xb5, 0xb5, 0x52, 0xed, 0xc8, 0x95, 0x51, 0x60, + 0xc1, 0x0b, 0xbd, 0x02, 0x85, 0x8d, 0x9a, 0x78, 0x1e, 0x9b, 0x69, 0xf0, 0x30, 0x23, 0x39, 0x2d, + 0x0c, 0xdc, 0xdb, 0x2b, 0x15, 0x56, 0x16, 0x71, 0x61, 0xa3, 0x86, 0xd6, 0x60, 0x70, 0x83, 0xc7, + 0x7e, 0x11, 0x36, 0x8d, 0x27, 0xb3, 0xc3, 0xd2, 0xa4, 0xc2, 0xc3, 0xf0, 0xa7, 0x96, 0x02, 0x81, + 0x25, 0x13, 0x96, 0x81, 0x48, 0xc5, 0xb0, 0x11, 0x21, 0x34, 0xe7, 0x0e, 0x16, 0x77, 0x88, 0x5f, + 0x35, 0xe2, 0x48, 0x38, 0x58, 0xe3, 0x48, 0x67, 0xb5, 0x73, 0xb7, 0x1d, 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x43, 0x59, 0x9f, 0x4a, 0xaf, 0x3a, 0xd6, 0x31, 0xab, 0xea, 0x26, 0x9c, 0xd2, 0xb2, 0x53, + 0x5e, 0x0a, 0x1c, 0xe6, 0xce, 0xe3, 0xb2, 0x83, 0x42, 0x93, 0x25, 0x1f, 0xbd, 0xb7, 0x57, 0x3a, + 0xb5, 0xde, 0x89, 0x10, 0x77, 0xe6, 0x83, 0xae, 0xc1, 0x51, 0x1e, 0x45, 0x64, 0x89, 0x38, 0xf5, + 0x86, 0xeb, 0x29, 0x61, 0x95, 0x6f, 0x2b, 0x27, 0xee, 0xed, 0x95, 0x8e, 0xce, 0x67, 0x11, 0xe0, + 0xec, 0x72, 0xe8, 0x35, 0x18, 0xae, 0x7b, 0x72, 0x03, 0x1c, 0x30, 0x12, 0x80, 0x0e, 0x2f, 0xad, + 0x55, 0xd5, 0xf7, 0xc7, 0x7f, 0x70, 0x5c, 0x00, 0x6d, 0x72, 0x6b, 0x91, 0x52, 0xf1, 0x0d, 0xa6, + 0x82, 0x4b, 0x26, 0xb5, 0xe0, 0x46, 0xf4, 0x00, 0x6e, 0x26, 0x55, 0x2f, 0xdd, 0x8c, 0xc0, 0x02, + 0x06, 0x63, 0xf4, 0x06, 0x20, 0x91, 0x68, 0x66, 0xbe, 0xc6, 0xf2, 0xa2, 0x69, 0x2e, 0x9c, 0xea, + 0xe6, 0x5e, 0x4d, 0x51, 0xe0, 0x8c, 0x52, 0xe8, 0x32, 0xdd, 0xb9, 0x74, 0xa8, 0xd8, 0x19, 0x55, + 0x9a, 0xe9, 0x25, 0xd2, 0x0a, 0x08, 0xf3, 0x3a, 0x34, 0x39, 0xe2, 0x44, 0x39, 0x54, 0x87, 0x93, + 0x4e, 0x3b, 0xf2, 0x99, 0x21, 0xce, 0x24, 0x5d, 0xf7, 0xb7, 0x89, 0xc7, 0x6c, 0xe0, 0x43, 0x2c, + 0x68, 0xe5, 0xc9, 0xf9, 0x0e, 0x74, 0xb8, 0x23, 0x17, 0x7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92, 0xdb, 0xc7, 0x87, 0x7a, 0x6e, 0x80, 0x38, 0xea, 0xc2, 0x84, 0xf7, 0x92, 0x04, + 0x77, 0xf7, 0x5e, 0x92, 0x35, 0xa3, 0x32, 0x0c, 0xd4, 0xb8, 0x5b, 0x4c, 0xb1, 0xfb, 0x16, 0xc6, + 0x7d, 0x62, 0xd4, 0x06, 0x2c, 0x7c, 0x61, 0x04, 0x83, 0x59, 0x17, 0x46, 0xb4, 0x8e, 0x79, 0xa8, + 0x93, 0x67, 0x9b, 0x1e, 0x7c, 0x5a, 0x17, 0x3c, 0xd4, 0x09, 0xf4, 0x93, 0x16, 0x24, 0x5e, 0xfd, + 0x28, 0xfd, 0x9d, 0x95, 0xab, 0xbf, 0x3b, 0x03, 0x7d, 0x81, 0xdf, 0x20, 0xc9, 0xc4, 0xe3, 0xd8, + 0x6f, 0x10, 0xcc, 0x30, 0x94, 0x22, 0x8a, 0xb5, 0x32, 0xa3, 0xfa, 0x8d, 0x53, 0xdc, 0x25, 0x1f, + 0x83, 0xfe, 0x06, 0xd9, 0x21, 0x8d, 0x64, 0x7e, 0xc8, 0xab, 0x14, 0x88, 0x39, 0xce, 0xfe, 0xd5, + 0x3e, 0x38, 0xd5, 0x31, 0x94, 0x18, 0x95, 0x98, 0x36, 0x9d, 0x88, 0xdc, 0x76, 0x76, 0x93, 0xe9, + 0xdb, 0x2e, 0x71, 0x30, 0x96, 0x78, 0xf6, 0xba, 0x96, 0xa7, 0x46, 0x49, 0x68, 0x3b, 0x45, 0x46, + 0x14, 0x81, 0x35, 0xb5, 0x67, 0xc5, 0x07, 0xa1, 0x3d, 0x7b, 0x1e, 0x20, 0x0c, 0x1b, 0xdc, 0x83, + 0xb0, 0x2e, 0x9e, 0xed, 0xc6, 0x29, 0x74, 0xaa, 0x57, 0x05, 0x06, 0x6b, 0x54, 0x68, 0x09, 0x26, + 0x5b, 0x81, 0x1f, 0x71, 0xe5, 0xf1, 0x12, 0x77, 0xb2, 0xed, 0x37, 0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 0xb1, 0xa8, 0x8d, 0xb4, 0xe3, 0xaa, 0xad, 0x09, 0x04, 0x4e, 0x32, + 0xb5, 0x7f, 0xbe, 0x00, 0xa7, 0x3a, 0xfa, 0xc5, 0x23, 0x0c, 0xc7, 0x36, 0x9b, 0xa1, 0xb3, 0x18, + 0x90, 0x3a, 0xf1, 0x22, 0xd7, 0x69, 0x54, 0x5b, 0xa4, 0xa6, 0x59, 0x2f, 0x99, 0x83, 0xf9, 0xa5, + 0xd5, 0xea, 0x7c, 0x9a, 0x02, 0xe7, 0x94, 0x44, 0x2b, 0x80, 0xd2, 0x18, 0x31, 0xc2, 0xec, 0x6a, + 0x9a, 0xe6, 0x87, 0x33, 0x4a, 0xa0, 0x97, 0x61, 0x4c, 0xf9, 0xdb, 0x6b, 0x23, 0xce, 0x36, 0x76, + 0xac, 0x23, 0xb0, 0x49, 0x87, 0x2e, 0xf0, 0x44, 0x3b, 0x22, 0x25, 0x93, 0x30, 0x75, 0x4e, 0xc8, + 0x2c, 0x3a, 0x02, 0x8c, 0x75, 0x9a, 0x85, 0x8b, 0xbf, 0xff, 0xad, 0xd3, 0x1f, 0xf8, 0xa3, 0x6f, + 0x9d, 0xfe, 0xc0, 0x9f, 0x7c, 0xeb, 0xf4, 0x07, 0x7e, 0xe0, 0xde, 0x69, 0xeb, 0xf7, 0xef, 0x9d, + 0xb6, 0xfe, 0xe8, 0xde, 0x69, 0xeb, 0x4f, 0xee, 0x9d, 0xb6, 0xfe, 0xfd, 0xbd, 0xd3, 0xd6, 0x97, + 0xfe, 0xfc, 0xf4, 0x07, 0xde, 0x42, 0x71, 0xa8, 0xe4, 0xf3, 0x74, 0x74, 0xce, 0xef, 0x5c, 0xf8, + 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x47, 0x57, 0x09, 0x4d, 0x20, 0x01, 0x00, } func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) { @@ -17971,6 +17971,11 @@ func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Request))) + i-- + dAtA[i] = 0x12 i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) @@ -25159,6 +25164,8 @@ func (m *ResourceClaim) Size() (n int) { _ = l l = len(m.Name) n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Request) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -29258,6 +29265,7 @@ func (this *ResourceClaim) String() string { } s := strings.Join([]string{`&ResourceClaim{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Request:` + fmt.Sprintf("%v", this.Request) + `,`, `}`, }, "") return s @@ -63015,6 +63023,38 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/staging/src/k8s.io/api/core/v1/generated.proto b/staging/src/k8s.io/api/core/v1/generated.proto index fa70d7981b558..13407ca271458 100644 --- a/staging/src/k8s.io/api/core/v1/generated.proto +++ b/staging/src/k8s.io/api/core/v1/generated.proto @@ -4958,6 +4958,13 @@ message ResourceClaim { // the Pod where this field is used. It makes that resource available // inside a container. optional string name = 1; + + // Request is the name chosen for a request in the referenced claim. + // If empty, everything from the claim is made available, otherwise + // only the result of this request. + // + // +optional + optional string request = 2; } // ResourceFieldSelector represents container resources (cpu, memory) and their output format diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index ba69881b36d36..7042f63eca07a 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -2649,6 +2649,13 @@ type ResourceClaim struct { // the Pod where this field is used. It makes that resource available // inside a container. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // Request is the name chosen for a request in the referenced claim. + // If empty, everything from the claim is made available, otherwise + // only the result of this request. + // + // +optional + Request string `json:"request,omitempty" protobuf:"bytes,2,opt,name=request"` } const ( diff --git a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go index 0e30088853c5a..8f9b038d8baf3 100644 --- a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -2082,8 +2082,9 @@ func (ReplicationControllerStatus) SwaggerDoc() map[string]string { } var map_ResourceClaim = map[string]string{ - "": "ResourceClaim references one entry in PodSpec.ResourceClaims.", - "name": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", + "": "ResourceClaim references one entry in PodSpec.ResourceClaims.", + "name": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", + "request": "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", } func (ResourceClaim) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/api/resource/v1alpha2/generated.proto b/staging/src/k8s.io/api/resource/v1alpha2/generated.proto deleted file mode 100644 index 8c46531086d36..0000000000000 --- a/staging/src/k8s.io/api/resource/v1alpha2/generated.proto +++ /dev/null @@ -1,749 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.api.resource.v1alpha2; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "k8s.io/api/resource/v1alpha2"; - -// AllocationResult contains attributes of an allocated resource. -message AllocationResult { - // ResourceHandles contain the state associated with an allocation that - // should be maintained throughout the lifetime of a claim. Each - // ResourceHandle contains data that should be passed to a specific kubelet - // plugin once it lands on a node. This data is returned by the driver - // after a successful allocation and is opaque to Kubernetes. Driver - // documentation may explain to users how to interpret this data if needed. - // - // Setting this field is optional. It has a maximum size of 32 entries. - // If null (or empty), it is assumed this allocation will be processed by a - // single kubelet plugin with no ResourceHandle data attached. The name of - // the kubelet plugin invoked will match the DriverName set in the - // ResourceClaimStatus this AllocationResult is embedded in. - // - // +listType=atomic - // +optional - repeated ResourceHandle resourceHandles = 1; - - // This field will get set by the resource driver after it has allocated - // the resource to inform the scheduler where it can schedule Pods using - // the ResourceClaim. - // - // Setting this field is optional. If null, the resource is available - // everywhere. - // +optional - optional .k8s.io.api.core.v1.NodeSelector availableOnNodes = 2; - - // Shareable determines whether the resource supports more - // than one consumer at a time. - // +optional - optional bool shareable = 3; -} - -// AllocationResultModel must have one and only one field set. -message AllocationResultModel { - // NamedResources describes the allocation result when using the named resources model. - // - // +optional - optional NamedResourcesAllocationResult namedResources = 1; -} - -// DriverAllocationResult contains vendor parameters and the allocation result for -// one request. -message DriverAllocationResult { - // VendorRequestParameters are the per-request configuration parameters - // from the time that the claim was allocated. - // - // +optional - optional .k8s.io.apimachinery.pkg.runtime.RawExtension vendorRequestParameters = 1; - - optional AllocationResultModel allocationResultModel = 2; -} - -// DriverRequests describes all resources that are needed from one particular driver. -message DriverRequests { - // DriverName is the name used by the DRA driver kubelet plugin. - optional string driverName = 1; - - // VendorParameters are arbitrary setup parameters for all requests of the - // claim. They are ignored while allocating the claim. - // - // +optional - optional .k8s.io.apimachinery.pkg.runtime.RawExtension vendorParameters = 2; - - // Requests describes all resources that are needed from the driver. - // +listType=atomic - repeated ResourceRequest requests = 3; -} - -// NamedResourcesAllocationResult is used in AllocationResultModel. -message NamedResourcesAllocationResult { - // Name is the name of the selected resource instance. - optional string name = 1; -} - -// NamedResourcesAttribute is a combination of an attribute name and its value. -message NamedResourcesAttribute { - // Name is unique identifier among all resource instances managed by - // the driver on the node. It must be a DNS subdomain. - optional string name = 1; - - optional NamedResourcesAttributeValue attributeValue = 2; -} - -// NamedResourcesAttributeValue must have one and only one field set. -message NamedResourcesAttributeValue { - // QuantityValue is a quantity. - optional .k8s.io.apimachinery.pkg.api.resource.Quantity quantity = 6; - - // BoolValue is a true/false value. - optional bool bool = 2; - - // IntValue is a 64-bit integer. - optional int64 int = 7; - - // IntSliceValue is an array of 64-bit integers. - optional NamedResourcesIntSlice intSlice = 8; - - // StringValue is a string. - optional string string = 5; - - // StringSliceValue is an array of strings. - optional NamedResourcesStringSlice stringSlice = 9; - - // VersionValue is a semantic version according to semver.org spec 2.0.0. - optional string version = 10; -} - -// NamedResourcesFilter is used in ResourceFilterModel. -message NamedResourcesFilter { - // Selector is a CEL expression which must evaluate to true if a - // resource instance is suitable. The language is as defined in - // https://kubernetes.io/docs/reference/using-api/cel/ - // - // In addition, for each type in NamedResourcesAttributeValue there is a map that - // resolves to the corresponding value of the instance under evaluation. - // For example: - // - // attributes.quantity["a"].isGreaterThan(quantity("0")) && - // attributes.stringslice["b"].isSorted() - optional string selector = 1; -} - -// NamedResourcesInstance represents one individual hardware instance that can be selected based -// on its attributes. -message NamedResourcesInstance { - // Name is unique identifier among all resource instances managed by - // the driver on the node. It must be a DNS subdomain. - optional string name = 1; - - // Attributes defines the attributes of this resource instance. - // The name of each attribute must be unique. - // - // +listType=atomic - // +optional - repeated NamedResourcesAttribute attributes = 2; -} - -// NamedResourcesIntSlice contains a slice of 64-bit integers. -message NamedResourcesIntSlice { - // Ints is the slice of 64-bit integers. - // - // +listType=atomic - repeated int64 ints = 1; -} - -// NamedResourcesRequest is used in ResourceRequestModel. -message NamedResourcesRequest { - // Selector is a CEL expression which must evaluate to true if a - // resource instance is suitable. The language is as defined in - // https://kubernetes.io/docs/reference/using-api/cel/ - // - // In addition, for each type NamedResourcesin AttributeValue there is a map that - // resolves to the corresponding value of the instance under evaluation. - // For example: - // - // attributes.quantity["a"].isGreaterThan(quantity("0")) && - // attributes.stringslice["b"].isSorted() - optional string selector = 1; -} - -// NamedResourcesResources is used in ResourceModel. -message NamedResourcesResources { - // The list of all individual resources instances currently available. - // - // +listType=atomic - repeated NamedResourcesInstance instances = 1; -} - -// NamedResourcesStringSlice contains a slice of strings. -message NamedResourcesStringSlice { - // Strings is the slice of strings. - // - // +listType=atomic - repeated string strings = 1; -} - -// PodSchedulingContext objects hold information that is needed to schedule -// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation -// mode. -// -// This is an alpha type and requires enabling the DynamicResourceAllocation -// feature gate. -message PodSchedulingContext { - // Standard object metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec describes where resources for the Pod are needed. - optional PodSchedulingContextSpec spec = 2; - - // Status describes where resources for the Pod can be allocated. - // +optional - optional PodSchedulingContextStatus status = 3; -} - -// PodSchedulingContextList is a collection of Pod scheduling objects. -message PodSchedulingContextList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of PodSchedulingContext objects. - repeated PodSchedulingContext items = 2; -} - -// PodSchedulingContextSpec describes where resources for the Pod are needed. -message PodSchedulingContextSpec { - // SelectedNode is the node for which allocation of ResourceClaims that - // are referenced by the Pod and that use "WaitForFirstConsumer" - // allocation is to be attempted. - // +optional - optional string selectedNode = 1; - - // PotentialNodes lists nodes where the Pod might be able to run. - // - // The size of this field is limited to 128. This is large enough for - // many clusters. Larger clusters may need more attempts to find a node - // that suits all pending resources. This may get increased in the - // future, but not reduced. - // - // +listType=atomic - // +optional - repeated string potentialNodes = 2; -} - -// PodSchedulingContextStatus describes where resources for the Pod can be allocated. -message PodSchedulingContextStatus { - // ResourceClaims describes resource availability for each - // pod.spec.resourceClaim entry where the corresponding ResourceClaim - // uses "WaitForFirstConsumer" allocation mode. - // - // +listType=map - // +listMapKey=name - // +optional - repeated ResourceClaimSchedulingStatus resourceClaims = 1; -} - -// ResourceClaim describes which resources are needed by a resource consumer. -// Its status tracks whether the resource has been allocated and what the -// resulting attributes are. -// -// This is an alpha type and requires enabling the DynamicResourceAllocation -// feature gate. -message ResourceClaim { - // Standard object metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec describes the desired attributes of a resource that then needs - // to be allocated. It can only be set once when creating the - // ResourceClaim. - optional ResourceClaimSpec spec = 2; - - // Status describes whether the resource is available and with which - // attributes. - // +optional - optional ResourceClaimStatus status = 3; -} - -// ResourceClaimConsumerReference contains enough information to let you -// locate the consumer of a ResourceClaim. The user must be a resource in the same -// namespace as the ResourceClaim. -message ResourceClaimConsumerReference { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - optional string apiGroup = 1; - - // Resource is the type of resource being referenced, for example "pods". - optional string resource = 3; - - // Name is the name of resource being referenced. - optional string name = 4; - - // UID identifies exactly one incarnation of the resource. - optional string uid = 5; -} - -// ResourceClaimList is a collection of claims. -message ResourceClaimList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of resource claims. - repeated ResourceClaim items = 2; -} - -// ResourceClaimParameters defines resource requests for a ResourceClaim in an -// in-tree format understood by Kubernetes. -message ResourceClaimParameters { - // Standard object metadata - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // If this object was created from some other resource, then this links - // back to that resource. This field is used to find the in-tree representation - // of the claim parameters when the parameter reference of the claim refers - // to some unknown type. - // +optional - optional ResourceClaimParametersReference generatedFrom = 2; - - // Shareable indicates whether the allocated claim is meant to be shareable - // by multiple consumers at the same time. - // +optional - optional bool shareable = 3; - - // DriverRequests describes all resources that are needed for the - // allocated claim. A single claim may use resources coming from - // different drivers. For each driver, this array has at most one - // entry which then may have one or more per-driver requests. - // - // May be empty, in which case the claim can always be allocated. - // - // +listType=atomic - repeated DriverRequests driverRequests = 4; -} - -// ResourceClaimParametersList is a collection of ResourceClaimParameters. -message ResourceClaimParametersList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of node resource capacity objects. - repeated ResourceClaimParameters items = 2; -} - -// ResourceClaimParametersReference contains enough information to let you -// locate the parameters for a ResourceClaim. The object must be in the same -// namespace as the ResourceClaim. -message ResourceClaimParametersReference { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - optional string apiGroup = 1; - - // Kind is the type of resource being referenced. This is the same - // value as in the parameter object's metadata, for example "ConfigMap". - optional string kind = 2; - - // Name is the name of resource being referenced. - optional string name = 3; -} - -// ResourceClaimSchedulingStatus contains information about one particular -// ResourceClaim with "WaitForFirstConsumer" allocation mode. -message ResourceClaimSchedulingStatus { - // Name matches the pod.spec.resourceClaims[*].Name field. - // +optional - optional string name = 1; - - // UnsuitableNodes lists nodes that the ResourceClaim cannot be - // allocated for. - // - // The size of this field is limited to 128, the same as for - // PodSchedulingSpec.PotentialNodes. This may get increased in the - // future, but not reduced. - // - // +listType=atomic - // +optional - repeated string unsuitableNodes = 2; -} - -// ResourceClaimSpec defines how a resource is to be allocated. -message ResourceClaimSpec { - // ResourceClassName references the driver and additional parameters - // via the name of a ResourceClass that was created as part of the - // driver deployment. - optional string resourceClassName = 1; - - // ParametersRef references a separate object with arbitrary parameters - // that will be used by the driver when allocating a resource for the - // claim. - // - // The object must be in the same namespace as the ResourceClaim. - // +optional - optional ResourceClaimParametersReference parametersRef = 2; - - // Allocation can start immediately or when a Pod wants to use the - // resource. "WaitForFirstConsumer" is the default. - // +optional - optional string allocationMode = 3; -} - -// ResourceClaimStatus tracks whether the resource has been allocated and what -// the resulting attributes are. -message ResourceClaimStatus { - // DriverName is a copy of the driver name from the ResourceClass at - // the time when allocation started. - // +optional - optional string driverName = 1; - - // Allocation is set by the resource driver once a resource or set of - // resources has been allocated successfully. If this is not specified, the - // resources have not been allocated yet. - // +optional - optional AllocationResult allocation = 2; - - // ReservedFor indicates which entities are currently allowed to use - // the claim. A Pod which references a ResourceClaim which is not - // reserved for that Pod will not be started. - // - // There can be at most 32 such reservations. This may get increased in - // the future, but not reduced. - // - // +listType=map - // +listMapKey=uid - // +patchStrategy=merge - // +patchMergeKey=uid - // +optional - repeated ResourceClaimConsumerReference reservedFor = 3; - - // DeallocationRequested indicates that a ResourceClaim is to be - // deallocated. - // - // The driver then must deallocate this claim and reset the field - // together with clearing the Allocation field. - // - // While DeallocationRequested is set, no new consumers may be added to - // ReservedFor. - // +optional - optional bool deallocationRequested = 4; -} - -// ResourceClaimTemplate is used to produce ResourceClaim objects. -message ResourceClaimTemplate { - // Standard object metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Describes the ResourceClaim that is to be generated. - // - // This field is immutable. A ResourceClaim will get created by the - // control plane for a Pod when needed and then not get updated - // anymore. - optional ResourceClaimTemplateSpec spec = 2; -} - -// ResourceClaimTemplateList is a collection of claim templates. -message ResourceClaimTemplateList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of resource claim templates. - repeated ResourceClaimTemplate items = 2; -} - -// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. -message ResourceClaimTemplateSpec { - // ObjectMeta may contain labels and annotations that will be copied into the PVC - // when creating it. No other fields are allowed and will be rejected during - // validation. - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec for the ResourceClaim. The entire content is copied unchanged - // into the ResourceClaim that gets created from this template. The - // same fields as in a ResourceClaim are also valid here. - optional ResourceClaimSpec spec = 2; -} - -// ResourceClass is used by administrators to influence how resources -// are allocated. -// -// This is an alpha type and requires enabling the DynamicResourceAllocation -// feature gate. -message ResourceClass { - // Standard object metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // DriverName defines the name of the dynamic resource driver that is - // used for allocation of a ResourceClaim that uses this class. - // - // Resource drivers have a unique name in forward domain order - // (acme.example.com). - optional string driverName = 2; - - // ParametersRef references an arbitrary separate object that may hold - // parameters that will be used by the driver when allocating a - // resource that uses this class. A dynamic resource driver can - // distinguish between parameters stored here and and those stored in - // ResourceClaimSpec. - // +optional - optional ResourceClassParametersReference parametersRef = 3; - - // Only nodes matching the selector will be considered by the scheduler - // when trying to find a Node that fits a Pod when that Pod uses - // a ResourceClaim that has not been allocated yet. - // - // Setting this field is optional. If null, all nodes are candidates. - // +optional - optional .k8s.io.api.core.v1.NodeSelector suitableNodes = 4; - - // If and only if allocation of claims using this class is handled - // via structured parameters, then StructuredParameters must be set to true. - // +optional - optional bool structuredParameters = 5; -} - -// ResourceClassList is a collection of classes. -message ResourceClassList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of resource classes. - repeated ResourceClass items = 2; -} - -// ResourceClassParameters defines resource requests for a ResourceClass in an -// in-tree format understood by Kubernetes. -message ResourceClassParameters { - // Standard object metadata - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // If this object was created from some other resource, then this links - // back to that resource. This field is used to find the in-tree representation - // of the class parameters when the parameter reference of the class refers - // to some unknown type. - // +optional - optional ResourceClassParametersReference generatedFrom = 2; - - // VendorParameters are arbitrary setup parameters for all claims using - // this class. They are ignored while allocating the claim. There must - // not be more than one entry per driver. - // - // +listType=atomic - // +optional - repeated VendorParameters vendorParameters = 3; - - // Filters describes additional contraints that must be met when using the class. - // - // +listType=atomic - repeated ResourceFilter filters = 4; -} - -// ResourceClassParametersList is a collection of ResourceClassParameters. -message ResourceClassParametersList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of node resource capacity objects. - repeated ResourceClassParameters items = 2; -} - -// ResourceClassParametersReference contains enough information to let you -// locate the parameters for a ResourceClass. -message ResourceClassParametersReference { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - optional string apiGroup = 1; - - // Kind is the type of resource being referenced. This is the same - // value as in the parameter object's metadata. - optional string kind = 2; - - // Name is the name of resource being referenced. - optional string name = 3; - - // Namespace that contains the referenced resource. Must be empty - // for cluster-scoped resources and non-empty for namespaced - // resources. - // +optional - optional string namespace = 4; -} - -// ResourceFilter is a filter for resources from one particular driver. -message ResourceFilter { - // DriverName is the name used by the DRA driver kubelet plugin. - optional string driverName = 1; - - optional ResourceFilterModel resourceFilterModel = 2; -} - -// ResourceFilterModel must have one and only one field set. -message ResourceFilterModel { - // NamedResources describes a resource filter using the named resources model. - // - // +optional - optional NamedResourcesFilter namedResources = 1; -} - -// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin. -message ResourceHandle { - // DriverName specifies the name of the resource driver whose kubelet - // plugin should be invoked to process this ResourceHandle's data once it - // lands on a node. This may differ from the DriverName set in - // ResourceClaimStatus this ResourceHandle is embedded in. - optional string driverName = 1; - - // Data contains the opaque data associated with this ResourceHandle. It is - // set by the controller component of the resource driver whose name - // matches the DriverName set in the ResourceClaimStatus this - // ResourceHandle is embedded in. It is set at allocation time and is - // intended for processing by the kubelet plugin whose name matches - // the DriverName set in this ResourceHandle. - // - // The maximum size of this field is 16KiB. This may get increased in the - // future, but not reduced. - // +optional - optional string data = 2; - - // If StructuredData is set, then it needs to be used instead of Data. - // - // +optional - optional StructuredResourceHandle structuredData = 5; -} - -// ResourceModel must have one and only one field set. -message ResourceModel { - // NamedResources describes available resources using the named resources model. - // - // +optional - optional NamedResourcesResources namedResources = 1; -} - -// ResourceRequest is a request for resources from one particular driver. -message ResourceRequest { - // VendorParameters are arbitrary setup parameters for the requested - // resource. They are ignored while allocating a claim. - // - // +optional - optional .k8s.io.apimachinery.pkg.runtime.RawExtension vendorParameters = 1; - - optional ResourceRequestModel resourceRequestModel = 2; -} - -// ResourceRequestModel must have one and only one field set. -message ResourceRequestModel { - // NamedResources describes a request for resources with the named resources model. - // - // +optional - optional NamedResourcesRequest namedResources = 1; -} - -// ResourceSlice provides information about available -// resources on individual nodes. -message ResourceSlice { - // Standard object metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // NodeName identifies the node which provides the resources - // if they are local to a node. - // - // A field selector can be used to list only ResourceSlice - // objects with a certain node name. - // - // +optional - optional string nodeName = 2; - - // DriverName identifies the DRA driver providing the capacity information. - // A field selector can be used to list only ResourceSlice - // objects with a certain driver name. - optional string driverName = 3; - - optional ResourceModel resourceModel = 4; -} - -// ResourceSliceList is a collection of ResourceSlices. -message ResourceSliceList { - // Standard list metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of node resource capacity objects. - repeated ResourceSlice items = 2; -} - -// StructuredResourceHandle is the in-tree representation of the allocation result. -message StructuredResourceHandle { - // VendorClassParameters are the per-claim configuration parameters - // from the resource class at the time that the claim was allocated. - // - // +optional - optional .k8s.io.apimachinery.pkg.runtime.RawExtension vendorClassParameters = 1; - - // VendorClaimParameters are the per-claim configuration parameters - // from the resource claim parameters at the time that the claim was - // allocated. - // - // +optional - optional .k8s.io.apimachinery.pkg.runtime.RawExtension vendorClaimParameters = 2; - - // NodeName is the name of the node providing the necessary resources - // if the resources are local to a node. - // - // +optional - optional string nodeName = 4; - - // Results lists all allocated driver resources. - // - // +listType=atomic - repeated DriverAllocationResult results = 5; -} - -// VendorParameters are opaque parameters for one particular driver. -message VendorParameters { - // DriverName is the name used by the DRA driver kubelet plugin. - optional string driverName = 1; - - // Parameters can be arbitrary setup parameters. They are ignored while - // allocating a claim. - // - // +optional - optional .k8s.io.apimachinery.pkg.runtime.RawExtension parameters = 2; -} - diff --git a/staging/src/k8s.io/api/resource/v1alpha2/namedresources.go b/staging/src/k8s.io/api/resource/v1alpha2/namedresources.go deleted file mode 100644 index 7c255b45cba49..0000000000000 --- a/staging/src/k8s.io/api/resource/v1alpha2/namedresources.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2023 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. -*/ - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/api/resource" -) - -// NamedResourcesResources is used in ResourceModel. -type NamedResourcesResources struct { - // The list of all individual resources instances currently available. - // - // +listType=atomic - Instances []NamedResourcesInstance `json:"instances" protobuf:"bytes,1,name=instances"` -} - -// NamedResourcesInstance represents one individual hardware instance that can be selected based -// on its attributes. -type NamedResourcesInstance struct { - // Name is unique identifier among all resource instances managed by - // the driver on the node. It must be a DNS subdomain. - Name string `json:"name" protobuf:"bytes,1,name=name"` - - // Attributes defines the attributes of this resource instance. - // The name of each attribute must be unique. - // - // +listType=atomic - // +optional - Attributes []NamedResourcesAttribute `json:"attributes,omitempty" protobuf:"bytes,2,opt,name=attributes"` -} - -// NamedResourcesAttribute is a combination of an attribute name and its value. -type NamedResourcesAttribute struct { - // Name is unique identifier among all resource instances managed by - // the driver on the node. It must be a DNS subdomain. - Name string `json:"name" protobuf:"bytes,1,name=name"` - - NamedResourcesAttributeValue `json:",inline" protobuf:"bytes,2,opt,name=attributeValue"` -} - -// The Go field names below have a Value suffix to avoid a conflict between the -// field "String" and the corresponding method. That method is required. -// The Kubernetes API is defined without that suffix to keep it more natural. - -// NamedResourcesAttributeValue must have one and only one field set. -type NamedResourcesAttributeValue struct { - // QuantityValue is a quantity. - QuantityValue *resource.Quantity `json:"quantity,omitempty" protobuf:"bytes,6,opt,name=quantity"` - // BoolValue is a true/false value. - BoolValue *bool `json:"bool,omitempty" protobuf:"bytes,2,opt,name=bool"` - // IntValue is a 64-bit integer. - IntValue *int64 `json:"int,omitempty" protobuf:"varint,7,opt,name=int"` - // IntSliceValue is an array of 64-bit integers. - IntSliceValue *NamedResourcesIntSlice `json:"intSlice,omitempty" protobuf:"varint,8,rep,name=intSlice"` - // StringValue is a string. - StringValue *string `json:"string,omitempty" protobuf:"bytes,5,opt,name=string"` - // StringSliceValue is an array of strings. - StringSliceValue *NamedResourcesStringSlice `json:"stringSlice,omitempty" protobuf:"bytes,9,rep,name=stringSlice"` - // VersionValue is a semantic version according to semver.org spec 2.0.0. - VersionValue *string `json:"version,omitempty" protobuf:"bytes,10,opt,name=version"` -} - -// NamedResourcesIntSlice contains a slice of 64-bit integers. -type NamedResourcesIntSlice struct { - // Ints is the slice of 64-bit integers. - // - // +listType=atomic - Ints []int64 `json:"ints" protobuf:"bytes,1,opt,name=ints"` -} - -// NamedResourcesStringSlice contains a slice of strings. -type NamedResourcesStringSlice struct { - // Strings is the slice of strings. - // - // +listType=atomic - Strings []string `json:"strings" protobuf:"bytes,1,opt,name=strings"` -} - -// NamedResourcesRequest is used in ResourceRequestModel. -type NamedResourcesRequest struct { - // Selector is a CEL expression which must evaluate to true if a - // resource instance is suitable. The language is as defined in - // https://kubernetes.io/docs/reference/using-api/cel/ - // - // In addition, for each type NamedResourcesin AttributeValue there is a map that - // resolves to the corresponding value of the instance under evaluation. - // For example: - // - // attributes.quantity["a"].isGreaterThan(quantity("0")) && - // attributes.stringslice["b"].isSorted() - Selector string `json:"selector" protobuf:"bytes,1,name=selector"` -} - -// NamedResourcesFilter is used in ResourceFilterModel. -type NamedResourcesFilter struct { - // Selector is a CEL expression which must evaluate to true if a - // resource instance is suitable. The language is as defined in - // https://kubernetes.io/docs/reference/using-api/cel/ - // - // In addition, for each type in NamedResourcesAttributeValue there is a map that - // resolves to the corresponding value of the instance under evaluation. - // For example: - // - // attributes.quantity["a"].isGreaterThan(quantity("0")) && - // attributes.stringslice["b"].isSorted() - Selector string `json:"selector" protobuf:"bytes,1,name=selector"` -} - -// NamedResourcesAllocationResult is used in AllocationResultModel. -type NamedResourcesAllocationResult struct { - // Name is the name of the selected resource instance. - Name string `json:"name" protobuf:"bytes,1,name=name"` -} diff --git a/staging/src/k8s.io/api/resource/v1alpha2/types.go b/staging/src/k8s.io/api/resource/v1alpha2/types.go deleted file mode 100644 index fa0f2cd707f6c..0000000000000 --- a/staging/src/k8s.io/api/resource/v1alpha2/types.go +++ /dev/null @@ -1,739 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package v1alpha2 - -import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" -) - -const ( - // Finalizer is the finalizer that gets set for claims - // which were allocated through a builtin controller. - // Reserved for use by Kubernetes, DRA driver controllers must - // use their own finalizer. - Finalizer = "dra.k8s.io/delete-protection" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// ResourceClaim describes which resources are needed by a resource consumer. -// Its status tracks whether the resource has been allocated and what the -// resulting attributes are. -// -// This is an alpha type and requires enabling the DynamicResourceAllocation -// feature gate. -type ResourceClaim struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec describes the desired attributes of a resource that then needs - // to be allocated. It can only be set once when creating the - // ResourceClaim. - Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` - - // Status describes whether the resource is available and with which - // attributes. - // +optional - Status ResourceClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// ResourceClaimSpec defines how a resource is to be allocated. -type ResourceClaimSpec struct { - // ResourceClassName references the driver and additional parameters - // via the name of a ResourceClass that was created as part of the - // driver deployment. - ResourceClassName string `json:"resourceClassName" protobuf:"bytes,1,name=resourceClassName"` - - // ParametersRef references a separate object with arbitrary parameters - // that will be used by the driver when allocating a resource for the - // claim. - // - // The object must be in the same namespace as the ResourceClaim. - // +optional - ParametersRef *ResourceClaimParametersReference `json:"parametersRef,omitempty" protobuf:"bytes,2,opt,name=parametersRef"` - - // Allocation can start immediately or when a Pod wants to use the - // resource. "WaitForFirstConsumer" is the default. - // +optional - AllocationMode AllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"` -} - -// AllocationMode describes whether a ResourceClaim gets allocated immediately -// when it gets created (AllocationModeImmediate) or whether allocation is -// delayed until it is needed for a Pod -// (AllocationModeWaitForFirstConsumer). Other modes might get added in the -// future. -type AllocationMode string - -const ( - // When a ResourceClaim has AllocationModeWaitForFirstConsumer, allocation is - // delayed until a Pod gets scheduled that needs the ResourceClaim. The - // scheduler will consider all resource requirements of that Pod and - // trigger allocation for a node that fits the Pod. - AllocationModeWaitForFirstConsumer AllocationMode = "WaitForFirstConsumer" - - // When a ResourceClaim has AllocationModeImmediate, allocation starts - // as soon as the ResourceClaim gets created. This is done without - // considering the needs of Pods that will use the ResourceClaim - // because those Pods are not known yet. - AllocationModeImmediate AllocationMode = "Immediate" -) - -// ResourceClaimStatus tracks whether the resource has been allocated and what -// the resulting attributes are. -type ResourceClaimStatus struct { - // DriverName is a copy of the driver name from the ResourceClass at - // the time when allocation started. - // +optional - DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"` - - // Allocation is set by the resource driver once a resource or set of - // resources has been allocated successfully. If this is not specified, the - // resources have not been allocated yet. - // +optional - Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,2,opt,name=allocation"` - - // ReservedFor indicates which entities are currently allowed to use - // the claim. A Pod which references a ResourceClaim which is not - // reserved for that Pod will not be started. - // - // There can be at most 32 such reservations. This may get increased in - // the future, but not reduced. - // - // +listType=map - // +listMapKey=uid - // +patchStrategy=merge - // +patchMergeKey=uid - // +optional - ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,3,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"` - - // DeallocationRequested indicates that a ResourceClaim is to be - // deallocated. - // - // The driver then must deallocate this claim and reset the field - // together with clearing the Allocation field. - // - // While DeallocationRequested is set, no new consumers may be added to - // ReservedFor. - // +optional - DeallocationRequested bool `json:"deallocationRequested,omitempty" protobuf:"varint,4,opt,name=deallocationRequested"` -} - -// ReservedForMaxSize is the maximum number of entries in -// claim.status.reservedFor. -const ResourceClaimReservedForMaxSize = 32 - -// AllocationResult contains attributes of an allocated resource. -type AllocationResult struct { - // ResourceHandles contain the state associated with an allocation that - // should be maintained throughout the lifetime of a claim. Each - // ResourceHandle contains data that should be passed to a specific kubelet - // plugin once it lands on a node. This data is returned by the driver - // after a successful allocation and is opaque to Kubernetes. Driver - // documentation may explain to users how to interpret this data if needed. - // - // Setting this field is optional. It has a maximum size of 32 entries. - // If null (or empty), it is assumed this allocation will be processed by a - // single kubelet plugin with no ResourceHandle data attached. The name of - // the kubelet plugin invoked will match the DriverName set in the - // ResourceClaimStatus this AllocationResult is embedded in. - // - // +listType=atomic - // +optional - ResourceHandles []ResourceHandle `json:"resourceHandles,omitempty" protobuf:"bytes,1,opt,name=resourceHandles"` - - // This field will get set by the resource driver after it has allocated - // the resource to inform the scheduler where it can schedule Pods using - // the ResourceClaim. - // - // Setting this field is optional. If null, the resource is available - // everywhere. - // +optional - AvailableOnNodes *v1.NodeSelector `json:"availableOnNodes,omitempty" protobuf:"bytes,2,opt,name=availableOnNodes"` - - // Shareable determines whether the resource supports more - // than one consumer at a time. - // +optional - Shareable bool `json:"shareable,omitempty" protobuf:"varint,3,opt,name=shareable"` -} - -// AllocationResultResourceHandlesMaxSize represents the maximum number of -// entries in allocation.resourceHandles. -const AllocationResultResourceHandlesMaxSize = 32 - -// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin. -type ResourceHandle struct { - // DriverName specifies the name of the resource driver whose kubelet - // plugin should be invoked to process this ResourceHandle's data once it - // lands on a node. This may differ from the DriverName set in - // ResourceClaimStatus this ResourceHandle is embedded in. - DriverName string `json:"driverName" protobuf:"bytes,1,name=driverName"` - - // Data contains the opaque data associated with this ResourceHandle. It is - // set by the controller component of the resource driver whose name - // matches the DriverName set in the ResourceClaimStatus this - // ResourceHandle is embedded in. It is set at allocation time and is - // intended for processing by the kubelet plugin whose name matches - // the DriverName set in this ResourceHandle. - // - // The maximum size of this field is 16KiB. This may get increased in the - // future, but not reduced. - // +optional - Data string `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"` - - // If StructuredData is set, then it needs to be used instead of Data. - // - // +optional - StructuredData *StructuredResourceHandle `json:"structuredData,omitempty" protobuf:"bytes,5,opt,name=structuredData"` -} - -// ResourceHandleDataMaxSize represents the maximum size of resourceHandle.data. -const ResourceHandleDataMaxSize = 16 * 1024 - -// StructuredResourceHandle is the in-tree representation of the allocation result. -type StructuredResourceHandle struct { - // VendorClassParameters are the per-claim configuration parameters - // from the resource class at the time that the claim was allocated. - // - // +optional - VendorClassParameters runtime.RawExtension `json:"vendorClassParameters,omitempty" protobuf:"bytes,1,opt,name=vendorClassParameters"` - - // VendorClaimParameters are the per-claim configuration parameters - // from the resource claim parameters at the time that the claim was - // allocated. - // - // +optional - VendorClaimParameters runtime.RawExtension `json:"vendorClaimParameters,omitempty" protobuf:"bytes,2,opt,name=vendorClaimParameters"` - - // NodeName is the name of the node providing the necessary resources - // if the resources are local to a node. - // - // +optional - NodeName string `json:"nodeName,omitempty" protobuf:"bytes,4,name=nodeName"` - - // Results lists all allocated driver resources. - // - // +listType=atomic - Results []DriverAllocationResult `json:"results" protobuf:"bytes,5,name=results"` -} - -// DriverAllocationResult contains vendor parameters and the allocation result for -// one request. -type DriverAllocationResult struct { - // VendorRequestParameters are the per-request configuration parameters - // from the time that the claim was allocated. - // - // +optional - VendorRequestParameters runtime.RawExtension `json:"vendorRequestParameters,omitempty" protobuf:"bytes,1,opt,name=vendorRequestParameters"` - - AllocationResultModel `json:",inline" protobuf:"bytes,2,name=allocationResultModel"` -} - -// AllocationResultModel must have one and only one field set. -type AllocationResultModel struct { - // NamedResources describes the allocation result when using the named resources model. - // - // +optional - NamedResources *NamedResourcesAllocationResult `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// ResourceClaimList is a collection of claims. -type ResourceClaimList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of resource claims. - Items []ResourceClaim `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// PodSchedulingContext objects hold information that is needed to schedule -// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation -// mode. -// -// This is an alpha type and requires enabling the DynamicResourceAllocation -// feature gate. -type PodSchedulingContext struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec describes where resources for the Pod are needed. - Spec PodSchedulingContextSpec `json:"spec" protobuf:"bytes,2,name=spec"` - - // Status describes where resources for the Pod can be allocated. - // +optional - Status PodSchedulingContextStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// PodSchedulingContextSpec describes where resources for the Pod are needed. -type PodSchedulingContextSpec struct { - // SelectedNode is the node for which allocation of ResourceClaims that - // are referenced by the Pod and that use "WaitForFirstConsumer" - // allocation is to be attempted. - // +optional - SelectedNode string `json:"selectedNode,omitempty" protobuf:"bytes,1,opt,name=selectedNode"` - - // PotentialNodes lists nodes where the Pod might be able to run. - // - // The size of this field is limited to 128. This is large enough for - // many clusters. Larger clusters may need more attempts to find a node - // that suits all pending resources. This may get increased in the - // future, but not reduced. - // - // +listType=atomic - // +optional - PotentialNodes []string `json:"potentialNodes,omitempty" protobuf:"bytes,2,opt,name=potentialNodes"` -} - -// PodSchedulingContextStatus describes where resources for the Pod can be allocated. -type PodSchedulingContextStatus struct { - // ResourceClaims describes resource availability for each - // pod.spec.resourceClaim entry where the corresponding ResourceClaim - // uses "WaitForFirstConsumer" allocation mode. - // - // +listType=map - // +listMapKey=name - // +optional - ResourceClaims []ResourceClaimSchedulingStatus `json:"resourceClaims,omitempty" protobuf:"bytes,1,opt,name=resourceClaims"` - - // If there ever is a need to support other kinds of resources - // than ResourceClaim, then new fields could get added here - // for those other resources. -} - -// ResourceClaimSchedulingStatus contains information about one particular -// ResourceClaim with "WaitForFirstConsumer" allocation mode. -type ResourceClaimSchedulingStatus struct { - // Name matches the pod.spec.resourceClaims[*].Name field. - // +optional - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - - // UnsuitableNodes lists nodes that the ResourceClaim cannot be - // allocated for. - // - // The size of this field is limited to 128, the same as for - // PodSchedulingSpec.PotentialNodes. This may get increased in the - // future, but not reduced. - // - // +listType=atomic - // +optional - UnsuitableNodes []string `json:"unsuitableNodes,omitempty" protobuf:"bytes,2,opt,name=unsuitableNodes"` -} - -// PodSchedulingNodeListMaxSize defines the maximum number of entries in the -// node lists that are stored in PodSchedulingContext objects. This limit is part -// of the API. -const PodSchedulingNodeListMaxSize = 128 - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// PodSchedulingContextList is a collection of Pod scheduling objects. -type PodSchedulingContextList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of PodSchedulingContext objects. - Items []PodSchedulingContext `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// ResourceClass is used by administrators to influence how resources -// are allocated. -// -// This is an alpha type and requires enabling the DynamicResourceAllocation -// feature gate. -type ResourceClass struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // DriverName defines the name of the dynamic resource driver that is - // used for allocation of a ResourceClaim that uses this class. - // - // Resource drivers have a unique name in forward domain order - // (acme.example.com). - DriverName string `json:"driverName" protobuf:"bytes,2,name=driverName"` - - // ParametersRef references an arbitrary separate object that may hold - // parameters that will be used by the driver when allocating a - // resource that uses this class. A dynamic resource driver can - // distinguish between parameters stored here and and those stored in - // ResourceClaimSpec. - // +optional - ParametersRef *ResourceClassParametersReference `json:"parametersRef,omitempty" protobuf:"bytes,3,opt,name=parametersRef"` - - // Only nodes matching the selector will be considered by the scheduler - // when trying to find a Node that fits a Pod when that Pod uses - // a ResourceClaim that has not been allocated yet. - // - // Setting this field is optional. If null, all nodes are candidates. - // +optional - SuitableNodes *v1.NodeSelector `json:"suitableNodes,omitempty" protobuf:"bytes,4,opt,name=suitableNodes"` - - // If and only if allocation of claims using this class is handled - // via structured parameters, then StructuredParameters must be set to true. - // +optional - StructuredParameters *bool `json:"structuredParameters,omitempty" protobuf:"bytes,5,opt,name=structuredParameters"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// ResourceClassList is a collection of classes. -type ResourceClassList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of resource classes. - Items []ResourceClass `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// ResourceClassParametersReference contains enough information to let you -// locate the parameters for a ResourceClass. -type ResourceClassParametersReference struct { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` - // Kind is the type of resource being referenced. This is the same - // value as in the parameter object's metadata. - Kind string `json:"kind" protobuf:"bytes,2,name=kind"` - // Name is the name of resource being referenced. - Name string `json:"name" protobuf:"bytes,3,name=name"` - // Namespace that contains the referenced resource. Must be empty - // for cluster-scoped resources and non-empty for namespaced - // resources. - // +optional - Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"` -} - -// ResourceClaimParametersReference contains enough information to let you -// locate the parameters for a ResourceClaim. The object must be in the same -// namespace as the ResourceClaim. -type ResourceClaimParametersReference struct { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` - // Kind is the type of resource being referenced. This is the same - // value as in the parameter object's metadata, for example "ConfigMap". - Kind string `json:"kind" protobuf:"bytes,2,name=kind"` - // Name is the name of resource being referenced. - Name string `json:"name" protobuf:"bytes,3,name=name"` -} - -// ResourceClaimConsumerReference contains enough information to let you -// locate the consumer of a ResourceClaim. The user must be a resource in the same -// namespace as the ResourceClaim. -type ResourceClaimConsumerReference struct { - // APIGroup is the group for the resource being referenced. It is - // empty for the core API. This matches the group in the APIVersion - // that is used when creating the resources. - // +optional - APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` - // Resource is the type of resource being referenced, for example "pods". - Resource string `json:"resource" protobuf:"bytes,3,name=resource"` - // Name is the name of resource being referenced. - Name string `json:"name" protobuf:"bytes,4,name=name"` - // UID identifies exactly one incarnation of the resource. - UID types.UID `json:"uid" protobuf:"bytes,5,name=uid"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// ResourceClaimTemplate is used to produce ResourceClaim objects. -type ResourceClaimTemplate struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Describes the ResourceClaim that is to be generated. - // - // This field is immutable. A ResourceClaim will get created by the - // control plane for a Pod when needed and then not get updated - // anymore. - Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"` -} - -// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. -type ResourceClaimTemplateSpec struct { - // ObjectMeta may contain labels and annotations that will be copied into the PVC - // when creating it. No other fields are allowed and will be rejected during - // validation. - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec for the ResourceClaim. The entire content is copied unchanged - // into the ResourceClaim that gets created from this template. The - // same fields as in a ResourceClaim are also valid here. - Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 - -// ResourceClaimTemplateList is a collection of claim templates. -type ResourceClaimTemplateList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of resource claim templates. - Items []ResourceClaimTemplate `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.30 - -// ResourceSlice provides information about available -// resources on individual nodes. -type ResourceSlice struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // NodeName identifies the node which provides the resources - // if they are local to a node. - // - // A field selector can be used to list only ResourceSlice - // objects with a certain node name. - // - // +optional - NodeName string `json:"nodeName,omitempty" protobuf:"bytes,2,opt,name=nodeName"` - - // DriverName identifies the DRA driver providing the capacity information. - // A field selector can be used to list only ResourceSlice - // objects with a certain driver name. - DriverName string `json:"driverName" protobuf:"bytes,3,name=driverName"` - - ResourceModel `json:",inline" protobuf:"bytes,4,name=resourceModel"` -} - -// ResourceModel must have one and only one field set. -type ResourceModel struct { - // NamedResources describes available resources using the named resources model. - // - // +optional - NamedResources *NamedResourcesResources `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.30 - -// ResourceSliceList is a collection of ResourceSlices. -type ResourceSliceList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of node resource capacity objects. - Items []ResourceSlice `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.30 - -// ResourceClaimParameters defines resource requests for a ResourceClaim in an -// in-tree format understood by Kubernetes. -type ResourceClaimParameters struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // If this object was created from some other resource, then this links - // back to that resource. This field is used to find the in-tree representation - // of the claim parameters when the parameter reference of the claim refers - // to some unknown type. - // +optional - GeneratedFrom *ResourceClaimParametersReference `json:"generatedFrom,omitempty" protobuf:"bytes,2,opt,name=generatedFrom"` - - // Shareable indicates whether the allocated claim is meant to be shareable - // by multiple consumers at the same time. - // +optional - Shareable bool `json:"shareable,omitempty" protobuf:"bytes,3,opt,name=shareable"` - - // DriverRequests describes all resources that are needed for the - // allocated claim. A single claim may use resources coming from - // different drivers. For each driver, this array has at most one - // entry which then may have one or more per-driver requests. - // - // May be empty, in which case the claim can always be allocated. - // - // +listType=atomic - DriverRequests []DriverRequests `json:"driverRequests,omitempty" protobuf:"bytes,4,opt,name=driverRequests"` -} - -// DriverRequests describes all resources that are needed from one particular driver. -type DriverRequests struct { - // DriverName is the name used by the DRA driver kubelet plugin. - DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"` - - // VendorParameters are arbitrary setup parameters for all requests of the - // claim. They are ignored while allocating the claim. - // - // +optional - VendorParameters runtime.RawExtension `json:"vendorParameters,omitempty" protobuf:"bytes,2,opt,name=vendorParameters"` - - // Requests describes all resources that are needed from the driver. - // +listType=atomic - Requests []ResourceRequest `json:"requests,omitempty" protobuf:"bytes,3,opt,name=requests"` -} - -// ResourceRequest is a request for resources from one particular driver. -type ResourceRequest struct { - // VendorParameters are arbitrary setup parameters for the requested - // resource. They are ignored while allocating a claim. - // - // +optional - VendorParameters runtime.RawExtension `json:"vendorParameters,omitempty" protobuf:"bytes,1,opt,name=vendorParameters"` - - ResourceRequestModel `json:",inline" protobuf:"bytes,2,name=resourceRequestModel"` -} - -// ResourceRequestModel must have one and only one field set. -type ResourceRequestModel struct { - // NamedResources describes a request for resources with the named resources model. - // - // +optional - NamedResources *NamedResourcesRequest `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.30 - -// ResourceClaimParametersList is a collection of ResourceClaimParameters. -type ResourceClaimParametersList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of node resource capacity objects. - Items []ResourceClaimParameters `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.30 - -// ResourceClassParameters defines resource requests for a ResourceClass in an -// in-tree format understood by Kubernetes. -type ResourceClassParameters struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // If this object was created from some other resource, then this links - // back to that resource. This field is used to find the in-tree representation - // of the class parameters when the parameter reference of the class refers - // to some unknown type. - // +optional - GeneratedFrom *ResourceClassParametersReference `json:"generatedFrom,omitempty" protobuf:"bytes,2,opt,name=generatedFrom"` - - // VendorParameters are arbitrary setup parameters for all claims using - // this class. They are ignored while allocating the claim. There must - // not be more than one entry per driver. - // - // +listType=atomic - // +optional - VendorParameters []VendorParameters `json:"vendorParameters,omitempty" protobuf:"bytes,3,opt,name=vendorParameters"` - - // Filters describes additional contraints that must be met when using the class. - // - // +listType=atomic - Filters []ResourceFilter `json:"filters,omitempty" protobuf:"bytes,4,opt,name=filters"` -} - -// ResourceFilter is a filter for resources from one particular driver. -type ResourceFilter struct { - // DriverName is the name used by the DRA driver kubelet plugin. - DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"` - - ResourceFilterModel `json:",inline" protobuf:"bytes,2,name=resourceFilterModel"` -} - -// ResourceFilterModel must have one and only one field set. -type ResourceFilterModel struct { - // NamedResources describes a resource filter using the named resources model. - // - // +optional - NamedResources *NamedResourcesFilter `json:"namedResources,omitempty" protobuf:"bytes,1,opt,name=namedResources"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.30 - -// ResourceClassParametersList is a collection of ResourceClassParameters. -type ResourceClassParametersList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of node resource capacity objects. - Items []ResourceClassParameters `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// VendorParameters are opaque parameters for one particular driver. -type VendorParameters struct { - // DriverName is the name used by the DRA driver kubelet plugin. - DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"` - - // Parameters can be arbitrary setup parameters. They are ignored while - // allocating a claim. - // - // +optional - Parameters runtime.RawExtension `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` -} diff --git a/staging/src/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go b/staging/src/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go deleted file mode 100644 index 11f9ffbead2a1..0000000000000 --- a/staging/src/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-codegen.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -var map_AllocationResult = map[string]string{ - "": "AllocationResult contains attributes of an allocated resource.", - "resourceHandles": "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.", - "availableOnNodes": "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere.", - "shareable": "Shareable determines whether the resource supports more than one consumer at a time.", -} - -func (AllocationResult) SwaggerDoc() map[string]string { - return map_AllocationResult -} - -var map_AllocationResultModel = map[string]string{ - "": "AllocationResultModel must have one and only one field set.", - "namedResources": "NamedResources describes the allocation result when using the named resources model.", -} - -func (AllocationResultModel) SwaggerDoc() map[string]string { - return map_AllocationResultModel -} - -var map_DriverAllocationResult = map[string]string{ - "": "DriverAllocationResult contains vendor parameters and the allocation result for one request.", - "vendorRequestParameters": "VendorRequestParameters are the per-request configuration parameters from the time that the claim was allocated.", -} - -func (DriverAllocationResult) SwaggerDoc() map[string]string { - return map_DriverAllocationResult -} - -var map_DriverRequests = map[string]string{ - "": "DriverRequests describes all resources that are needed from one particular driver.", - "driverName": "DriverName is the name used by the DRA driver kubelet plugin.", - "vendorParameters": "VendorParameters are arbitrary setup parameters for all requests of the claim. They are ignored while allocating the claim.", - "requests": "Requests describes all resources that are needed from the driver.", -} - -func (DriverRequests) SwaggerDoc() map[string]string { - return map_DriverRequests -} - -var map_PodSchedulingContext = map[string]string{ - "": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", - "metadata": "Standard object metadata", - "spec": "Spec describes where resources for the Pod are needed.", - "status": "Status describes where resources for the Pod can be allocated.", -} - -func (PodSchedulingContext) SwaggerDoc() map[string]string { - return map_PodSchedulingContext -} - -var map_PodSchedulingContextList = map[string]string{ - "": "PodSchedulingContextList is a collection of Pod scheduling objects.", - "metadata": "Standard list metadata", - "items": "Items is the list of PodSchedulingContext objects.", -} - -func (PodSchedulingContextList) SwaggerDoc() map[string]string { - return map_PodSchedulingContextList -} - -var map_PodSchedulingContextSpec = map[string]string{ - "": "PodSchedulingContextSpec describes where resources for the Pod are needed.", - "selectedNode": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", - "potentialNodes": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", -} - -func (PodSchedulingContextSpec) SwaggerDoc() map[string]string { - return map_PodSchedulingContextSpec -} - -var map_PodSchedulingContextStatus = map[string]string{ - "": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", - "resourceClaims": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", -} - -func (PodSchedulingContextStatus) SwaggerDoc() map[string]string { - return map_PodSchedulingContextStatus -} - -var map_ResourceClaim = map[string]string{ - "": "ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", - "metadata": "Standard object metadata", - "spec": "Spec describes the desired attributes of a resource that then needs to be allocated. It can only be set once when creating the ResourceClaim.", - "status": "Status describes whether the resource is available and with which attributes.", -} - -func (ResourceClaim) SwaggerDoc() map[string]string { - return map_ResourceClaim -} - -var map_ResourceClaimConsumerReference = map[string]string{ - "": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", - "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "resource": "Resource is the type of resource being referenced, for example \"pods\".", - "name": "Name is the name of resource being referenced.", - "uid": "UID identifies exactly one incarnation of the resource.", -} - -func (ResourceClaimConsumerReference) SwaggerDoc() map[string]string { - return map_ResourceClaimConsumerReference -} - -var map_ResourceClaimList = map[string]string{ - "": "ResourceClaimList is a collection of claims.", - "metadata": "Standard list metadata", - "items": "Items is the list of resource claims.", -} - -func (ResourceClaimList) SwaggerDoc() map[string]string { - return map_ResourceClaimList -} - -var map_ResourceClaimParameters = map[string]string{ - "": "ResourceClaimParameters defines resource requests for a ResourceClaim in an in-tree format understood by Kubernetes.", - "metadata": "Standard object metadata", - "generatedFrom": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the claim parameters when the parameter reference of the claim refers to some unknown type.", - "shareable": "Shareable indicates whether the allocated claim is meant to be shareable by multiple consumers at the same time.", - "driverRequests": "DriverRequests describes all resources that are needed for the allocated claim. A single claim may use resources coming from different drivers. For each driver, this array has at most one entry which then may have one or more per-driver requests.\n\nMay be empty, in which case the claim can always be allocated.", -} - -func (ResourceClaimParameters) SwaggerDoc() map[string]string { - return map_ResourceClaimParameters -} - -var map_ResourceClaimParametersList = map[string]string{ - "": "ResourceClaimParametersList is a collection of ResourceClaimParameters.", - "metadata": "Standard list metadata", - "items": "Items is the list of node resource capacity objects.", -} - -func (ResourceClaimParametersList) SwaggerDoc() map[string]string { - return map_ResourceClaimParametersList -} - -var map_ResourceClaimParametersReference = map[string]string{ - "": "ResourceClaimParametersReference contains enough information to let you locate the parameters for a ResourceClaim. The object must be in the same namespace as the ResourceClaim.", - "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "kind": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata, for example \"ConfigMap\".", - "name": "Name is the name of resource being referenced.", -} - -func (ResourceClaimParametersReference) SwaggerDoc() map[string]string { - return map_ResourceClaimParametersReference -} - -var map_ResourceClaimSchedulingStatus = map[string]string{ - "": "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.", - "name": "Name matches the pod.spec.resourceClaims[*].Name field.", - "unsuitableNodes": "UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for.\n\nThe size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced.", -} - -func (ResourceClaimSchedulingStatus) SwaggerDoc() map[string]string { - return map_ResourceClaimSchedulingStatus -} - -var map_ResourceClaimSpec = map[string]string{ - "": "ResourceClaimSpec defines how a resource is to be allocated.", - "resourceClassName": "ResourceClassName references the driver and additional parameters via the name of a ResourceClass that was created as part of the driver deployment.", - "parametersRef": "ParametersRef references a separate object with arbitrary parameters that will be used by the driver when allocating a resource for the claim.\n\nThe object must be in the same namespace as the ResourceClaim.", - "allocationMode": "Allocation can start immediately or when a Pod wants to use the resource. \"WaitForFirstConsumer\" is the default.", -} - -func (ResourceClaimSpec) SwaggerDoc() map[string]string { - return map_ResourceClaimSpec -} - -var map_ResourceClaimStatus = map[string]string{ - "": "ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.", - "driverName": "DriverName is a copy of the driver name from the ResourceClass at the time when allocation started.", - "allocation": "Allocation is set by the resource driver once a resource or set of resources has been allocated successfully. If this is not specified, the resources have not been allocated yet.", - "reservedFor": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", - "deallocationRequested": "DeallocationRequested indicates that a ResourceClaim is to be deallocated.\n\nThe driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nWhile DeallocationRequested is set, no new consumers may be added to ReservedFor.", -} - -func (ResourceClaimStatus) SwaggerDoc() map[string]string { - return map_ResourceClaimStatus -} - -var map_ResourceClaimTemplate = map[string]string{ - "": "ResourceClaimTemplate is used to produce ResourceClaim objects.", - "metadata": "Standard object metadata", - "spec": "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.", -} - -func (ResourceClaimTemplate) SwaggerDoc() map[string]string { - return map_ResourceClaimTemplate -} - -var map_ResourceClaimTemplateList = map[string]string{ - "": "ResourceClaimTemplateList is a collection of claim templates.", - "metadata": "Standard list metadata", - "items": "Items is the list of resource claim templates.", -} - -func (ResourceClaimTemplateList) SwaggerDoc() map[string]string { - return map_ResourceClaimTemplateList -} - -var map_ResourceClaimTemplateSpec = map[string]string{ - "": "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.", - "metadata": "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.", - "spec": "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here.", -} - -func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string { - return map_ResourceClaimTemplateSpec -} - -var map_ResourceClass = map[string]string{ - "": "ResourceClass is used by administrators to influence how resources are allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", - "metadata": "Standard object metadata", - "driverName": "DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.\n\nResource drivers have a unique name in forward domain order (acme.example.com).", - "parametersRef": "ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.", - "suitableNodes": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.\n\nSetting this field is optional. If null, all nodes are candidates.", - "structuredParameters": "If and only if allocation of claims using this class is handled via structured parameters, then StructuredParameters must be set to true.", -} - -func (ResourceClass) SwaggerDoc() map[string]string { - return map_ResourceClass -} - -var map_ResourceClassList = map[string]string{ - "": "ResourceClassList is a collection of classes.", - "metadata": "Standard list metadata", - "items": "Items is the list of resource classes.", -} - -func (ResourceClassList) SwaggerDoc() map[string]string { - return map_ResourceClassList -} - -var map_ResourceClassParameters = map[string]string{ - "": "ResourceClassParameters defines resource requests for a ResourceClass in an in-tree format understood by Kubernetes.", - "metadata": "Standard object metadata", - "generatedFrom": "If this object was created from some other resource, then this links back to that resource. This field is used to find the in-tree representation of the class parameters when the parameter reference of the class refers to some unknown type.", - "vendorParameters": "VendorParameters are arbitrary setup parameters for all claims using this class. They are ignored while allocating the claim. There must not be more than one entry per driver.", - "filters": "Filters describes additional contraints that must be met when using the class.", -} - -func (ResourceClassParameters) SwaggerDoc() map[string]string { - return map_ResourceClassParameters -} - -var map_ResourceClassParametersList = map[string]string{ - "": "ResourceClassParametersList is a collection of ResourceClassParameters.", - "metadata": "Standard list metadata", - "items": "Items is the list of node resource capacity objects.", -} - -func (ResourceClassParametersList) SwaggerDoc() map[string]string { - return map_ResourceClassParametersList -} - -var map_ResourceClassParametersReference = map[string]string{ - "": "ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass.", - "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", - "kind": "Kind is the type of resource being referenced. This is the same value as in the parameter object's metadata.", - "name": "Name is the name of resource being referenced.", - "namespace": "Namespace that contains the referenced resource. Must be empty for cluster-scoped resources and non-empty for namespaced resources.", -} - -func (ResourceClassParametersReference) SwaggerDoc() map[string]string { - return map_ResourceClassParametersReference -} - -var map_ResourceFilter = map[string]string{ - "": "ResourceFilter is a filter for resources from one particular driver.", - "driverName": "DriverName is the name used by the DRA driver kubelet plugin.", -} - -func (ResourceFilter) SwaggerDoc() map[string]string { - return map_ResourceFilter -} - -var map_ResourceFilterModel = map[string]string{ - "": "ResourceFilterModel must have one and only one field set.", - "namedResources": "NamedResources describes a resource filter using the named resources model.", -} - -func (ResourceFilterModel) SwaggerDoc() map[string]string { - return map_ResourceFilterModel -} - -var map_ResourceHandle = map[string]string{ - "": "ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.", - "driverName": "DriverName specifies the name of the resource driver whose kubelet plugin should be invoked to process this ResourceHandle's data once it lands on a node. This may differ from the DriverName set in ResourceClaimStatus this ResourceHandle is embedded in.", - "data": "Data contains the opaque data associated with this ResourceHandle. It is set by the controller component of the resource driver whose name matches the DriverName set in the ResourceClaimStatus this ResourceHandle is embedded in. It is set at allocation time and is intended for processing by the kubelet plugin whose name matches the DriverName set in this ResourceHandle.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.", - "structuredData": "If StructuredData is set, then it needs to be used instead of Data.", -} - -func (ResourceHandle) SwaggerDoc() map[string]string { - return map_ResourceHandle -} - -var map_ResourceModel = map[string]string{ - "": "ResourceModel must have one and only one field set.", - "namedResources": "NamedResources describes available resources using the named resources model.", -} - -func (ResourceModel) SwaggerDoc() map[string]string { - return map_ResourceModel -} - -var map_ResourceRequest = map[string]string{ - "": "ResourceRequest is a request for resources from one particular driver.", - "vendorParameters": "VendorParameters are arbitrary setup parameters for the requested resource. They are ignored while allocating a claim.", -} - -func (ResourceRequest) SwaggerDoc() map[string]string { - return map_ResourceRequest -} - -var map_ResourceRequestModel = map[string]string{ - "": "ResourceRequestModel must have one and only one field set.", - "namedResources": "NamedResources describes a request for resources with the named resources model.", -} - -func (ResourceRequestModel) SwaggerDoc() map[string]string { - return map_ResourceRequestModel -} - -var map_ResourceSlice = map[string]string{ - "": "ResourceSlice provides information about available resources on individual nodes.", - "metadata": "Standard object metadata", - "nodeName": "NodeName identifies the node which provides the resources if they are local to a node.\n\nA field selector can be used to list only ResourceSlice objects with a certain node name.", - "driverName": "DriverName identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.", -} - -func (ResourceSlice) SwaggerDoc() map[string]string { - return map_ResourceSlice -} - -var map_ResourceSliceList = map[string]string{ - "": "ResourceSliceList is a collection of ResourceSlices.", - "metadata": "Standard list metadata", - "items": "Items is the list of node resource capacity objects.", -} - -func (ResourceSliceList) SwaggerDoc() map[string]string { - return map_ResourceSliceList -} - -var map_StructuredResourceHandle = map[string]string{ - "": "StructuredResourceHandle is the in-tree representation of the allocation result.", - "vendorClassParameters": "VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated.", - "vendorClaimParameters": "VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated.", - "nodeName": "NodeName is the name of the node providing the necessary resources if the resources are local to a node.", - "results": "Results lists all allocated driver resources.", -} - -func (StructuredResourceHandle) SwaggerDoc() map[string]string { - return map_StructuredResourceHandle -} - -var map_VendorParameters = map[string]string{ - "": "VendorParameters are opaque parameters for one particular driver.", - "driverName": "DriverName is the name used by the DRA driver kubelet plugin.", - "parameters": "Parameters can be arbitrary setup parameters. They are ignored while allocating a claim.", -} - -func (VendorParameters) SwaggerDoc() map[string]string { - return map_VendorParameters -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/staging/src/k8s.io/api/resource/v1alpha2/doc.go b/staging/src/k8s.io/api/resource/v1alpha3/doc.go similarity index 84% rename from staging/src/k8s.io/api/resource/v1alpha2/doc.go rename to staging/src/k8s.io/api/resource/v1alpha3/doc.go index d9c20e089d972..aeb66561fb8a7 100644 --- a/staging/src/k8s.io/api/resource/v1alpha2/doc.go +++ b/staging/src/k8s.io/api/resource/v1alpha3/doc.go @@ -20,5 +20,5 @@ limitations under the License. // +groupName=resource.k8s.io -// Package v1alpha2 is the v1alpha2 version of the resource API. -package v1alpha2 // import "k8s.io/api/resource/v1alpha2" +// Package v1alpha3 is the v1alpha3 version of the resource API. +package v1alpha3 // import "k8s.io/api/resource/v1alpha3" diff --git a/staging/src/k8s.io/api/resource/v1alpha2/generated.pb.go b/staging/src/k8s.io/api/resource/v1alpha3/generated.pb.go similarity index 60% rename from staging/src/k8s.io/api/resource/v1alpha2/generated.pb.go rename to staging/src/k8s.io/api/resource/v1alpha3/generated.pb.go index 6c6ba438e3869..c7a525c0963e1 100644 --- a/staging/src/k8s.io/api/resource/v1alpha2/generated.pb.go +++ b/staging/src/k8s.io/api/resource/v1alpha3/generated.pb.go @@ -15,9 +15,9 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/api/resource/v1alpha2/generated.proto +// source: k8s.io/api/resource/v1alpha3/generated.proto -package v1alpha2 +package v1alpha3 import ( fmt "fmt" @@ -25,6 +25,7 @@ import ( io "io" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" @@ -50,7 +51,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *AllocationResult) Reset() { *m = AllocationResult{} } func (*AllocationResult) ProtoMessage() {} func (*AllocationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{0} + return fileDescriptor_66649ee9bbcd89d2, []int{0} } func (m *AllocationResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,15 +76,15 @@ func (m *AllocationResult) XXX_DiscardUnknown() { var xxx_messageInfo_AllocationResult proto.InternalMessageInfo -func (m *AllocationResultModel) Reset() { *m = AllocationResultModel{} } -func (*AllocationResultModel) ProtoMessage() {} -func (*AllocationResultModel) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{1} +func (m *BasicDevice) Reset() { *m = BasicDevice{} } +func (*BasicDevice) ProtoMessage() {} +func (*BasicDevice) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{1} } -func (m *AllocationResultModel) XXX_Unmarshal(b []byte) error { +func (m *BasicDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllocationResultModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *BasicDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -91,27 +92,27 @@ func (m *AllocationResultModel) XXX_Marshal(b []byte, deterministic bool) ([]byt } return b[:n], nil } -func (m *AllocationResultModel) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllocationResultModel.Merge(m, src) +func (m *BasicDevice) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicDevice.Merge(m, src) } -func (m *AllocationResultModel) XXX_Size() int { +func (m *BasicDevice) XXX_Size() int { return m.Size() } -func (m *AllocationResultModel) XXX_DiscardUnknown() { - xxx_messageInfo_AllocationResultModel.DiscardUnknown(m) +func (m *BasicDevice) XXX_DiscardUnknown() { + xxx_messageInfo_BasicDevice.DiscardUnknown(m) } -var xxx_messageInfo_AllocationResultModel proto.InternalMessageInfo +var xxx_messageInfo_BasicDevice proto.InternalMessageInfo -func (m *DriverAllocationResult) Reset() { *m = DriverAllocationResult{} } -func (*DriverAllocationResult) ProtoMessage() {} -func (*DriverAllocationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{2} +func (m *CELDeviceSelector) Reset() { *m = CELDeviceSelector{} } +func (*CELDeviceSelector) ProtoMessage() {} +func (*CELDeviceSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{2} } -func (m *DriverAllocationResult) XXX_Unmarshal(b []byte) error { +func (m *CELDeviceSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DriverAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *CELDeviceSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -119,27 +120,27 @@ func (m *DriverAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]by } return b[:n], nil } -func (m *DriverAllocationResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_DriverAllocationResult.Merge(m, src) +func (m *CELDeviceSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_CELDeviceSelector.Merge(m, src) } -func (m *DriverAllocationResult) XXX_Size() int { +func (m *CELDeviceSelector) XXX_Size() int { return m.Size() } -func (m *DriverAllocationResult) XXX_DiscardUnknown() { - xxx_messageInfo_DriverAllocationResult.DiscardUnknown(m) +func (m *CELDeviceSelector) XXX_DiscardUnknown() { + xxx_messageInfo_CELDeviceSelector.DiscardUnknown(m) } -var xxx_messageInfo_DriverAllocationResult proto.InternalMessageInfo +var xxx_messageInfo_CELDeviceSelector proto.InternalMessageInfo -func (m *DriverRequests) Reset() { *m = DriverRequests{} } -func (*DriverRequests) ProtoMessage() {} -func (*DriverRequests) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{3} +func (m *Device) Reset() { *m = Device{} } +func (*Device) ProtoMessage() {} +func (*Device) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{3} } -func (m *DriverRequests) XXX_Unmarshal(b []byte) error { +func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DriverRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -147,27 +148,27 @@ func (m *DriverRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro } return b[:n], nil } -func (m *DriverRequests) XXX_Merge(src proto.Message) { - xxx_messageInfo_DriverRequests.Merge(m, src) +func (m *Device) XXX_Merge(src proto.Message) { + xxx_messageInfo_Device.Merge(m, src) } -func (m *DriverRequests) XXX_Size() int { +func (m *Device) XXX_Size() int { return m.Size() } -func (m *DriverRequests) XXX_DiscardUnknown() { - xxx_messageInfo_DriverRequests.DiscardUnknown(m) +func (m *Device) XXX_DiscardUnknown() { + xxx_messageInfo_Device.DiscardUnknown(m) } -var xxx_messageInfo_DriverRequests proto.InternalMessageInfo +var xxx_messageInfo_Device proto.InternalMessageInfo -func (m *NamedResourcesAllocationResult) Reset() { *m = NamedResourcesAllocationResult{} } -func (*NamedResourcesAllocationResult) ProtoMessage() {} -func (*NamedResourcesAllocationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{4} +func (m *DeviceAllocationConfiguration) Reset() { *m = DeviceAllocationConfiguration{} } +func (*DeviceAllocationConfiguration) ProtoMessage() {} +func (*DeviceAllocationConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{4} } -func (m *NamedResourcesAllocationResult) XXX_Unmarshal(b []byte) error { +func (m *DeviceAllocationConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceAllocationConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -175,27 +176,27 @@ func (m *NamedResourcesAllocationResult) XXX_Marshal(b []byte, deterministic boo } return b[:n], nil } -func (m *NamedResourcesAllocationResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesAllocationResult.Merge(m, src) +func (m *DeviceAllocationConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceAllocationConfiguration.Merge(m, src) } -func (m *NamedResourcesAllocationResult) XXX_Size() int { +func (m *DeviceAllocationConfiguration) XXX_Size() int { return m.Size() } -func (m *NamedResourcesAllocationResult) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesAllocationResult.DiscardUnknown(m) +func (m *DeviceAllocationConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceAllocationConfiguration.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesAllocationResult proto.InternalMessageInfo +var xxx_messageInfo_DeviceAllocationConfiguration proto.InternalMessageInfo -func (m *NamedResourcesAttribute) Reset() { *m = NamedResourcesAttribute{} } -func (*NamedResourcesAttribute) ProtoMessage() {} -func (*NamedResourcesAttribute) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{5} +func (m *DeviceAllocationResult) Reset() { *m = DeviceAllocationResult{} } +func (*DeviceAllocationResult) ProtoMessage() {} +func (*DeviceAllocationResult) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{5} } -func (m *NamedResourcesAttribute) XXX_Unmarshal(b []byte) error { +func (m *DeviceAllocationResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -203,27 +204,27 @@ func (m *NamedResourcesAttribute) XXX_Marshal(b []byte, deterministic bool) ([]b } return b[:n], nil } -func (m *NamedResourcesAttribute) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesAttribute.Merge(m, src) +func (m *DeviceAllocationResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceAllocationResult.Merge(m, src) } -func (m *NamedResourcesAttribute) XXX_Size() int { +func (m *DeviceAllocationResult) XXX_Size() int { return m.Size() } -func (m *NamedResourcesAttribute) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesAttribute.DiscardUnknown(m) +func (m *DeviceAllocationResult) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceAllocationResult.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesAttribute proto.InternalMessageInfo +var xxx_messageInfo_DeviceAllocationResult proto.InternalMessageInfo -func (m *NamedResourcesAttributeValue) Reset() { *m = NamedResourcesAttributeValue{} } -func (*NamedResourcesAttributeValue) ProtoMessage() {} -func (*NamedResourcesAttributeValue) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{6} +func (m *DeviceAttribute) Reset() { *m = DeviceAttribute{} } +func (*DeviceAttribute) ProtoMessage() {} +func (*DeviceAttribute) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{6} } -func (m *NamedResourcesAttributeValue) XXX_Unmarshal(b []byte) error { +func (m *DeviceAttribute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesAttributeValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -231,27 +232,27 @@ func (m *NamedResourcesAttributeValue) XXX_Marshal(b []byte, deterministic bool) } return b[:n], nil } -func (m *NamedResourcesAttributeValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesAttributeValue.Merge(m, src) +func (m *DeviceAttribute) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceAttribute.Merge(m, src) } -func (m *NamedResourcesAttributeValue) XXX_Size() int { +func (m *DeviceAttribute) XXX_Size() int { return m.Size() } -func (m *NamedResourcesAttributeValue) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesAttributeValue.DiscardUnknown(m) +func (m *DeviceAttribute) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceAttribute.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesAttributeValue proto.InternalMessageInfo +var xxx_messageInfo_DeviceAttribute proto.InternalMessageInfo -func (m *NamedResourcesFilter) Reset() { *m = NamedResourcesFilter{} } -func (*NamedResourcesFilter) ProtoMessage() {} -func (*NamedResourcesFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{7} +func (m *DeviceClaim) Reset() { *m = DeviceClaim{} } +func (*DeviceClaim) ProtoMessage() {} +func (*DeviceClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{7} } -func (m *NamedResourcesFilter) XXX_Unmarshal(b []byte) error { +func (m *DeviceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -259,27 +260,27 @@ func (m *NamedResourcesFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte } return b[:n], nil } -func (m *NamedResourcesFilter) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesFilter.Merge(m, src) +func (m *DeviceClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceClaim.Merge(m, src) } -func (m *NamedResourcesFilter) XXX_Size() int { +func (m *DeviceClaim) XXX_Size() int { return m.Size() } -func (m *NamedResourcesFilter) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesFilter.DiscardUnknown(m) +func (m *DeviceClaim) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceClaim.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesFilter proto.InternalMessageInfo +var xxx_messageInfo_DeviceClaim proto.InternalMessageInfo -func (m *NamedResourcesInstance) Reset() { *m = NamedResourcesInstance{} } -func (*NamedResourcesInstance) ProtoMessage() {} -func (*NamedResourcesInstance) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{8} +func (m *DeviceClaimConfiguration) Reset() { *m = DeviceClaimConfiguration{} } +func (*DeviceClaimConfiguration) ProtoMessage() {} +func (*DeviceClaimConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{8} } -func (m *NamedResourcesInstance) XXX_Unmarshal(b []byte) error { +func (m *DeviceClaimConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesInstance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceClaimConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -287,27 +288,27 @@ func (m *NamedResourcesInstance) XXX_Marshal(b []byte, deterministic bool) ([]by } return b[:n], nil } -func (m *NamedResourcesInstance) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesInstance.Merge(m, src) +func (m *DeviceClaimConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceClaimConfiguration.Merge(m, src) } -func (m *NamedResourcesInstance) XXX_Size() int { +func (m *DeviceClaimConfiguration) XXX_Size() int { return m.Size() } -func (m *NamedResourcesInstance) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesInstance.DiscardUnknown(m) +func (m *DeviceClaimConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceClaimConfiguration.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesInstance proto.InternalMessageInfo +var xxx_messageInfo_DeviceClaimConfiguration proto.InternalMessageInfo -func (m *NamedResourcesIntSlice) Reset() { *m = NamedResourcesIntSlice{} } -func (*NamedResourcesIntSlice) ProtoMessage() {} -func (*NamedResourcesIntSlice) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{9} +func (m *DeviceClass) Reset() { *m = DeviceClass{} } +func (*DeviceClass) ProtoMessage() {} +func (*DeviceClass) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{9} } -func (m *NamedResourcesIntSlice) XXX_Unmarshal(b []byte) error { +func (m *DeviceClass) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesIntSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -315,27 +316,27 @@ func (m *NamedResourcesIntSlice) XXX_Marshal(b []byte, deterministic bool) ([]by } return b[:n], nil } -func (m *NamedResourcesIntSlice) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesIntSlice.Merge(m, src) +func (m *DeviceClass) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceClass.Merge(m, src) } -func (m *NamedResourcesIntSlice) XXX_Size() int { +func (m *DeviceClass) XXX_Size() int { return m.Size() } -func (m *NamedResourcesIntSlice) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesIntSlice.DiscardUnknown(m) +func (m *DeviceClass) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceClass.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesIntSlice proto.InternalMessageInfo +var xxx_messageInfo_DeviceClass proto.InternalMessageInfo -func (m *NamedResourcesRequest) Reset() { *m = NamedResourcesRequest{} } -func (*NamedResourcesRequest) ProtoMessage() {} -func (*NamedResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{10} +func (m *DeviceClassConfiguration) Reset() { *m = DeviceClassConfiguration{} } +func (*DeviceClassConfiguration) ProtoMessage() {} +func (*DeviceClassConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{10} } -func (m *NamedResourcesRequest) XXX_Unmarshal(b []byte) error { +func (m *DeviceClassConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceClassConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -343,27 +344,27 @@ func (m *NamedResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt } return b[:n], nil } -func (m *NamedResourcesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesRequest.Merge(m, src) +func (m *DeviceClassConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceClassConfiguration.Merge(m, src) } -func (m *NamedResourcesRequest) XXX_Size() int { +func (m *DeviceClassConfiguration) XXX_Size() int { return m.Size() } -func (m *NamedResourcesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesRequest.DiscardUnknown(m) +func (m *DeviceClassConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceClassConfiguration.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesRequest proto.InternalMessageInfo +var xxx_messageInfo_DeviceClassConfiguration proto.InternalMessageInfo -func (m *NamedResourcesResources) Reset() { *m = NamedResourcesResources{} } -func (*NamedResourcesResources) ProtoMessage() {} -func (*NamedResourcesResources) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{11} +func (m *DeviceClassList) Reset() { *m = DeviceClassList{} } +func (*DeviceClassList) ProtoMessage() {} +func (*DeviceClassList) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{11} } -func (m *NamedResourcesResources) XXX_Unmarshal(b []byte) error { +func (m *DeviceClassList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -371,27 +372,27 @@ func (m *NamedResourcesResources) XXX_Marshal(b []byte, deterministic bool) ([]b } return b[:n], nil } -func (m *NamedResourcesResources) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesResources.Merge(m, src) +func (m *DeviceClassList) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceClassList.Merge(m, src) } -func (m *NamedResourcesResources) XXX_Size() int { +func (m *DeviceClassList) XXX_Size() int { return m.Size() } -func (m *NamedResourcesResources) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesResources.DiscardUnknown(m) +func (m *DeviceClassList) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceClassList.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesResources proto.InternalMessageInfo +var xxx_messageInfo_DeviceClassList proto.InternalMessageInfo -func (m *NamedResourcesStringSlice) Reset() { *m = NamedResourcesStringSlice{} } -func (*NamedResourcesStringSlice) ProtoMessage() {} -func (*NamedResourcesStringSlice) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{12} +func (m *DeviceClassSpec) Reset() { *m = DeviceClassSpec{} } +func (*DeviceClassSpec) ProtoMessage() {} +func (*DeviceClassSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{12} } -func (m *NamedResourcesStringSlice) XXX_Unmarshal(b []byte) error { +func (m *DeviceClassSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NamedResourcesStringSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeviceClassSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -399,22 +400,190 @@ func (m *NamedResourcesStringSlice) XXX_Marshal(b []byte, deterministic bool) ([ } return b[:n], nil } -func (m *NamedResourcesStringSlice) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResourcesStringSlice.Merge(m, src) +func (m *DeviceClassSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceClassSpec.Merge(m, src) } -func (m *NamedResourcesStringSlice) XXX_Size() int { +func (m *DeviceClassSpec) XXX_Size() int { return m.Size() } -func (m *NamedResourcesStringSlice) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResourcesStringSlice.DiscardUnknown(m) +func (m *DeviceClassSpec) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceClassSpec.DiscardUnknown(m) } -var xxx_messageInfo_NamedResourcesStringSlice proto.InternalMessageInfo +var xxx_messageInfo_DeviceClassSpec proto.InternalMessageInfo + +func (m *DeviceConfiguration) Reset() { *m = DeviceConfiguration{} } +func (*DeviceConfiguration) ProtoMessage() {} +func (*DeviceConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{13} +} +func (m *DeviceConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceConfiguration.Merge(m, src) +} +func (m *DeviceConfiguration) XXX_Size() int { + return m.Size() +} +func (m *DeviceConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceConfiguration proto.InternalMessageInfo + +func (m *DeviceConstraint) Reset() { *m = DeviceConstraint{} } +func (*DeviceConstraint) ProtoMessage() {} +func (*DeviceConstraint) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{14} +} +func (m *DeviceConstraint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceConstraint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceConstraint) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceConstraint.Merge(m, src) +} +func (m *DeviceConstraint) XXX_Size() int { + return m.Size() +} +func (m *DeviceConstraint) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceConstraint.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceConstraint proto.InternalMessageInfo + +func (m *DeviceRequest) Reset() { *m = DeviceRequest{} } +func (*DeviceRequest) ProtoMessage() {} +func (*DeviceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{15} +} +func (m *DeviceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceRequest.Merge(m, src) +} +func (m *DeviceRequest) XXX_Size() int { + return m.Size() +} +func (m *DeviceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceRequest proto.InternalMessageInfo + +func (m *DeviceRequestAllocationResult) Reset() { *m = DeviceRequestAllocationResult{} } +func (*DeviceRequestAllocationResult) ProtoMessage() {} +func (*DeviceRequestAllocationResult) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{16} +} +func (m *DeviceRequestAllocationResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceRequestAllocationResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceRequestAllocationResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceRequestAllocationResult.Merge(m, src) +} +func (m *DeviceRequestAllocationResult) XXX_Size() int { + return m.Size() +} +func (m *DeviceRequestAllocationResult) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceRequestAllocationResult.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceRequestAllocationResult proto.InternalMessageInfo + +func (m *DeviceSelector) Reset() { *m = DeviceSelector{} } +func (*DeviceSelector) ProtoMessage() {} +func (*DeviceSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{17} +} +func (m *DeviceSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceSelector.Merge(m, src) +} +func (m *DeviceSelector) XXX_Size() int { + return m.Size() +} +func (m *DeviceSelector) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceSelector proto.InternalMessageInfo + +func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} } +func (*OpaqueDeviceConfiguration) ProtoMessage() {} +func (*OpaqueDeviceConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{18} +} +func (m *OpaqueDeviceConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OpaqueDeviceConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OpaqueDeviceConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_OpaqueDeviceConfiguration.Merge(m, src) +} +func (m *OpaqueDeviceConfiguration) XXX_Size() int { + return m.Size() +} +func (m *OpaqueDeviceConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_OpaqueDeviceConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_OpaqueDeviceConfiguration proto.InternalMessageInfo func (m *PodSchedulingContext) Reset() { *m = PodSchedulingContext{} } func (*PodSchedulingContext) ProtoMessage() {} func (*PodSchedulingContext) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{13} + return fileDescriptor_66649ee9bbcd89d2, []int{19} } func (m *PodSchedulingContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -442,7 +611,7 @@ var xxx_messageInfo_PodSchedulingContext proto.InternalMessageInfo func (m *PodSchedulingContextList) Reset() { *m = PodSchedulingContextList{} } func (*PodSchedulingContextList) ProtoMessage() {} func (*PodSchedulingContextList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{14} + return fileDescriptor_66649ee9bbcd89d2, []int{20} } func (m *PodSchedulingContextList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -470,7 +639,7 @@ var xxx_messageInfo_PodSchedulingContextList proto.InternalMessageInfo func (m *PodSchedulingContextSpec) Reset() { *m = PodSchedulingContextSpec{} } func (*PodSchedulingContextSpec) ProtoMessage() {} func (*PodSchedulingContextSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{15} + return fileDescriptor_66649ee9bbcd89d2, []int{21} } func (m *PodSchedulingContextSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +667,7 @@ var xxx_messageInfo_PodSchedulingContextSpec proto.InternalMessageInfo func (m *PodSchedulingContextStatus) Reset() { *m = PodSchedulingContextStatus{} } func (*PodSchedulingContextStatus) ProtoMessage() {} func (*PodSchedulingContextStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{16} + return fileDescriptor_66649ee9bbcd89d2, []int{22} } func (m *PodSchedulingContextStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,7 +695,7 @@ var xxx_messageInfo_PodSchedulingContextStatus proto.InternalMessageInfo func (m *ResourceClaim) Reset() { *m = ResourceClaim{} } func (*ResourceClaim) ProtoMessage() {} func (*ResourceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{17} + return fileDescriptor_66649ee9bbcd89d2, []int{23} } func (m *ResourceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -554,7 +723,7 @@ var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo func (m *ResourceClaimConsumerReference) Reset() { *m = ResourceClaimConsumerReference{} } func (*ResourceClaimConsumerReference) ProtoMessage() {} func (*ResourceClaimConsumerReference) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{18} + return fileDescriptor_66649ee9bbcd89d2, []int{24} } func (m *ResourceClaimConsumerReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -582,7 +751,7 @@ var xxx_messageInfo_ResourceClaimConsumerReference proto.InternalMessageInfo func (m *ResourceClaimList) Reset() { *m = ResourceClaimList{} } func (*ResourceClaimList) ProtoMessage() {} func (*ResourceClaimList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{19} + return fileDescriptor_66649ee9bbcd89d2, []int{25} } func (m *ResourceClaimList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -607,94 +776,10 @@ func (m *ResourceClaimList) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceClaimList proto.InternalMessageInfo -func (m *ResourceClaimParameters) Reset() { *m = ResourceClaimParameters{} } -func (*ResourceClaimParameters) ProtoMessage() {} -func (*ResourceClaimParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{20} -} -func (m *ResourceClaimParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceClaimParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceClaimParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClaimParameters.Merge(m, src) -} -func (m *ResourceClaimParameters) XXX_Size() int { - return m.Size() -} -func (m *ResourceClaimParameters) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClaimParameters.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceClaimParameters proto.InternalMessageInfo - -func (m *ResourceClaimParametersList) Reset() { *m = ResourceClaimParametersList{} } -func (*ResourceClaimParametersList) ProtoMessage() {} -func (*ResourceClaimParametersList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{21} -} -func (m *ResourceClaimParametersList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceClaimParametersList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceClaimParametersList) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClaimParametersList.Merge(m, src) -} -func (m *ResourceClaimParametersList) XXX_Size() int { - return m.Size() -} -func (m *ResourceClaimParametersList) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClaimParametersList.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceClaimParametersList proto.InternalMessageInfo - -func (m *ResourceClaimParametersReference) Reset() { *m = ResourceClaimParametersReference{} } -func (*ResourceClaimParametersReference) ProtoMessage() {} -func (*ResourceClaimParametersReference) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{22} -} -func (m *ResourceClaimParametersReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceClaimParametersReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceClaimParametersReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClaimParametersReference.Merge(m, src) -} -func (m *ResourceClaimParametersReference) XXX_Size() int { - return m.Size() -} -func (m *ResourceClaimParametersReference) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClaimParametersReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceClaimParametersReference proto.InternalMessageInfo - func (m *ResourceClaimSchedulingStatus) Reset() { *m = ResourceClaimSchedulingStatus{} } func (*ResourceClaimSchedulingStatus) ProtoMessage() {} func (*ResourceClaimSchedulingStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{23} + return fileDescriptor_66649ee9bbcd89d2, []int{26} } func (m *ResourceClaimSchedulingStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -722,7 +807,7 @@ var xxx_messageInfo_ResourceClaimSchedulingStatus proto.InternalMessageInfo func (m *ResourceClaimSpec) Reset() { *m = ResourceClaimSpec{} } func (*ResourceClaimSpec) ProtoMessage() {} func (*ResourceClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{24} + return fileDescriptor_66649ee9bbcd89d2, []int{27} } func (m *ResourceClaimSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -750,7 +835,7 @@ var xxx_messageInfo_ResourceClaimSpec proto.InternalMessageInfo func (m *ResourceClaimStatus) Reset() { *m = ResourceClaimStatus{} } func (*ResourceClaimStatus) ProtoMessage() {} func (*ResourceClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{25} + return fileDescriptor_66649ee9bbcd89d2, []int{28} } func (m *ResourceClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -778,7 +863,7 @@ var xxx_messageInfo_ResourceClaimStatus proto.InternalMessageInfo func (m *ResourceClaimTemplate) Reset() { *m = ResourceClaimTemplate{} } func (*ResourceClaimTemplate) ProtoMessage() {} func (*ResourceClaimTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{26} + return fileDescriptor_66649ee9bbcd89d2, []int{29} } func (m *ResourceClaimTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -806,7 +891,7 @@ var xxx_messageInfo_ResourceClaimTemplate proto.InternalMessageInfo func (m *ResourceClaimTemplateList) Reset() { *m = ResourceClaimTemplateList{} } func (*ResourceClaimTemplateList) ProtoMessage() {} func (*ResourceClaimTemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{27} + return fileDescriptor_66649ee9bbcd89d2, []int{30} } func (m *ResourceClaimTemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -834,7 +919,7 @@ var xxx_messageInfo_ResourceClaimTemplateList proto.InternalMessageInfo func (m *ResourceClaimTemplateSpec) Reset() { *m = ResourceClaimTemplateSpec{} } func (*ResourceClaimTemplateSpec) ProtoMessage() {} func (*ResourceClaimTemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{28} + return fileDescriptor_66649ee9bbcd89d2, []int{31} } func (m *ResourceClaimTemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -859,15 +944,15 @@ func (m *ResourceClaimTemplateSpec) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceClaimTemplateSpec proto.InternalMessageInfo -func (m *ResourceClass) Reset() { *m = ResourceClass{} } -func (*ResourceClass) ProtoMessage() {} -func (*ResourceClass) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{29} +func (m *ResourcePool) Reset() { *m = ResourcePool{} } +func (*ResourcePool) ProtoMessage() {} +func (*ResourcePool) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{32} } -func (m *ResourceClass) XXX_Unmarshal(b []byte) error { +func (m *ResourcePool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResourceClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResourcePool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -875,27 +960,27 @@ func (m *ResourceClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error } return b[:n], nil } -func (m *ResourceClass) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClass.Merge(m, src) +func (m *ResourcePool) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourcePool.Merge(m, src) } -func (m *ResourceClass) XXX_Size() int { +func (m *ResourcePool) XXX_Size() int { return m.Size() } -func (m *ResourceClass) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClass.DiscardUnknown(m) +func (m *ResourcePool) XXX_DiscardUnknown() { + xxx_messageInfo_ResourcePool.DiscardUnknown(m) } -var xxx_messageInfo_ResourceClass proto.InternalMessageInfo +var xxx_messageInfo_ResourcePool proto.InternalMessageInfo -func (m *ResourceClassList) Reset() { *m = ResourceClassList{} } -func (*ResourceClassList) ProtoMessage() {} -func (*ResourceClassList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{30} +func (m *ResourceSlice) Reset() { *m = ResourceSlice{} } +func (*ResourceSlice) ProtoMessage() {} +func (*ResourceSlice) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{33} } -func (m *ResourceClassList) XXX_Unmarshal(b []byte) error { +func (m *ResourceSlice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResourceClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResourceSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -903,27 +988,27 @@ func (m *ResourceClassList) XXX_Marshal(b []byte, deterministic bool) ([]byte, e } return b[:n], nil } -func (m *ResourceClassList) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClassList.Merge(m, src) +func (m *ResourceSlice) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceSlice.Merge(m, src) } -func (m *ResourceClassList) XXX_Size() int { +func (m *ResourceSlice) XXX_Size() int { return m.Size() } -func (m *ResourceClassList) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClassList.DiscardUnknown(m) +func (m *ResourceSlice) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceSlice.DiscardUnknown(m) } -var xxx_messageInfo_ResourceClassList proto.InternalMessageInfo +var xxx_messageInfo_ResourceSlice proto.InternalMessageInfo -func (m *ResourceClassParameters) Reset() { *m = ResourceClassParameters{} } -func (*ResourceClassParameters) ProtoMessage() {} -func (*ResourceClassParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{31} +func (m *ResourceSliceList) Reset() { *m = ResourceSliceList{} } +func (*ResourceSliceList) ProtoMessage() {} +func (*ResourceSliceList) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{34} } -func (m *ResourceClassParameters) XXX_Unmarshal(b []byte) error { +func (m *ResourceSliceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResourceClassParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResourceSliceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -931,27 +1016,27 @@ func (m *ResourceClassParameters) XXX_Marshal(b []byte, deterministic bool) ([]b } return b[:n], nil } -func (m *ResourceClassParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClassParameters.Merge(m, src) +func (m *ResourceSliceList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceSliceList.Merge(m, src) } -func (m *ResourceClassParameters) XXX_Size() int { +func (m *ResourceSliceList) XXX_Size() int { return m.Size() } -func (m *ResourceClassParameters) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClassParameters.DiscardUnknown(m) +func (m *ResourceSliceList) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceSliceList.DiscardUnknown(m) } -var xxx_messageInfo_ResourceClassParameters proto.InternalMessageInfo +var xxx_messageInfo_ResourceSliceList proto.InternalMessageInfo -func (m *ResourceClassParametersList) Reset() { *m = ResourceClassParametersList{} } -func (*ResourceClassParametersList) ProtoMessage() {} -func (*ResourceClassParametersList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{32} +func (m *ResourceSliceSpec) Reset() { *m = ResourceSliceSpec{} } +func (*ResourceSliceSpec) ProtoMessage() {} +func (*ResourceSliceSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{35} } -func (m *ResourceClassParametersList) XXX_Unmarshal(b []byte) error { +func (m *ResourceSliceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ResourceClassParametersList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ResourceSliceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -959,523 +1044,330 @@ func (m *ResourceClassParametersList) XXX_Marshal(b []byte, deterministic bool) } return b[:n], nil } -func (m *ResourceClassParametersList) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClassParametersList.Merge(m, src) +func (m *ResourceSliceSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceSliceSpec.Merge(m, src) } -func (m *ResourceClassParametersList) XXX_Size() int { +func (m *ResourceSliceSpec) XXX_Size() int { return m.Size() } -func (m *ResourceClassParametersList) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClassParametersList.DiscardUnknown(m) +func (m *ResourceSliceSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceSliceSpec.DiscardUnknown(m) } -var xxx_messageInfo_ResourceClassParametersList proto.InternalMessageInfo +var xxx_messageInfo_ResourceSliceSpec proto.InternalMessageInfo -func (m *ResourceClassParametersReference) Reset() { *m = ResourceClassParametersReference{} } -func (*ResourceClassParametersReference) ProtoMessage() {} -func (*ResourceClassParametersReference) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{33} -} -func (m *ResourceClassParametersReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceClassParametersReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceClassParametersReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceClassParametersReference.Merge(m, src) -} -func (m *ResourceClassParametersReference) XXX_Size() int { - return m.Size() -} -func (m *ResourceClassParametersReference) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceClassParametersReference.DiscardUnknown(m) +func init() { + proto.RegisterType((*AllocationResult)(nil), "k8s.io.api.resource.v1alpha3.AllocationResult") + proto.RegisterType((*BasicDevice)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice") + proto.RegisterMapType((map[QualifiedName]DeviceAttribute)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice.AttributesEntry") + proto.RegisterMapType((map[QualifiedName]resource.Quantity)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice.CapacityEntry") + proto.RegisterType((*CELDeviceSelector)(nil), "k8s.io.api.resource.v1alpha3.CELDeviceSelector") + proto.RegisterType((*Device)(nil), "k8s.io.api.resource.v1alpha3.Device") + proto.RegisterType((*DeviceAllocationConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceAllocationConfiguration") + proto.RegisterType((*DeviceAllocationResult)(nil), "k8s.io.api.resource.v1alpha3.DeviceAllocationResult") + proto.RegisterType((*DeviceAttribute)(nil), "k8s.io.api.resource.v1alpha3.DeviceAttribute") + proto.RegisterType((*DeviceClaim)(nil), "k8s.io.api.resource.v1alpha3.DeviceClaim") + proto.RegisterType((*DeviceClaimConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceClaimConfiguration") + proto.RegisterType((*DeviceClass)(nil), "k8s.io.api.resource.v1alpha3.DeviceClass") + proto.RegisterType((*DeviceClassConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassConfiguration") + proto.RegisterType((*DeviceClassList)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassList") + proto.RegisterType((*DeviceClassSpec)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassSpec") + proto.RegisterType((*DeviceConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceConfiguration") + proto.RegisterType((*DeviceConstraint)(nil), "k8s.io.api.resource.v1alpha3.DeviceConstraint") + proto.RegisterType((*DeviceRequest)(nil), "k8s.io.api.resource.v1alpha3.DeviceRequest") + proto.RegisterType((*DeviceRequestAllocationResult)(nil), "k8s.io.api.resource.v1alpha3.DeviceRequestAllocationResult") + proto.RegisterType((*DeviceSelector)(nil), "k8s.io.api.resource.v1alpha3.DeviceSelector") + proto.RegisterType((*OpaqueDeviceConfiguration)(nil), "k8s.io.api.resource.v1alpha3.OpaqueDeviceConfiguration") + proto.RegisterType((*PodSchedulingContext)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContext") + proto.RegisterType((*PodSchedulingContextList)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContextList") + proto.RegisterType((*PodSchedulingContextSpec)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContextSpec") + proto.RegisterType((*PodSchedulingContextStatus)(nil), "k8s.io.api.resource.v1alpha3.PodSchedulingContextStatus") + proto.RegisterType((*ResourceClaim)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaim") + proto.RegisterType((*ResourceClaimConsumerReference)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimConsumerReference") + proto.RegisterType((*ResourceClaimList)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimList") + proto.RegisterType((*ResourceClaimSchedulingStatus)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimSchedulingStatus") + proto.RegisterType((*ResourceClaimSpec)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimSpec") + proto.RegisterType((*ResourceClaimStatus)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimStatus") + proto.RegisterType((*ResourceClaimTemplate)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimTemplate") + proto.RegisterType((*ResourceClaimTemplateList)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimTemplateList") + proto.RegisterType((*ResourceClaimTemplateSpec)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaimTemplateSpec") + proto.RegisterType((*ResourcePool)(nil), "k8s.io.api.resource.v1alpha3.ResourcePool") + proto.RegisterType((*ResourceSlice)(nil), "k8s.io.api.resource.v1alpha3.ResourceSlice") + proto.RegisterType((*ResourceSliceList)(nil), "k8s.io.api.resource.v1alpha3.ResourceSliceList") + proto.RegisterType((*ResourceSliceSpec)(nil), "k8s.io.api.resource.v1alpha3.ResourceSliceSpec") } -var xxx_messageInfo_ResourceClassParametersReference proto.InternalMessageInfo - -func (m *ResourceFilter) Reset() { *m = ResourceFilter{} } -func (*ResourceFilter) ProtoMessage() {} -func (*ResourceFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{34} -} -func (m *ResourceFilter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func init() { + proto.RegisterFile("k8s.io/api/resource/v1alpha3/generated.proto", fileDescriptor_66649ee9bbcd89d2) +} + +var fileDescriptor_66649ee9bbcd89d2 = []byte{ + // 2091 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0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8a, 0x50, 0x1d, 0xca, 0x9a, 0xc1, + 0x78, 0x5a, 0x95, 0xfd, 0x18, 0xed, 0x1a, 0xec, 0x8e, 0x97, 0xec, 0xd8, 0x43, 0xa0, 0xf3, 0x30, + 0xb5, 0x6f, 0x9a, 0x3a, 0x0f, 0xc7, 0xac, 0x32, 0x3f, 0x1c, 0x34, 0xaa, 0x8a, 0x69, 0xea, 0x3e, + 0x05, 0x47, 0xa1, 0xaf, 0x43, 0xc5, 0x61, 0xb6, 0x66, 0x74, 0x45, 0x8f, 0x5c, 0x1c, 0x0e, 0x1a, + 0xb5, 0x36, 0x87, 0xf8, 0x64, 0x02, 0x8d, 0x5e, 0x85, 0x99, 0x3e, 0xb5, 0x79, 0x85, 0x4c, 0x73, + 0x4a, 0xde, 0x81, 0xef, 0xf8, 0x20, 0x9f, 0x34, 0x20, 0x90, 0x7f, 0x5b, 0x82, 0x9a, 0x08, 0xa0, + 0x4e, 0xb4, 0x1e, 0xba, 0x1b, 0x4b, 0x28, 0x3f, 0x12, 0xaf, 0x4d, 0x10, 0x09, 0x65, 0x29, 0x68, + 0x5e, 0x19, 0x19, 0x48, 0xa1, 0xa6, 0x9a, 0x86, 0xc3, 0x6c, 0xa2, 0x19, 0x22, 0x5d, 0x93, 0x0d, + 0x62, 0x5c, 0xe2, 0x09, 0x36, 0x65, 0x45, 0x28, 0xa8, 0x45, 0x30, 0x07, 0xc7, 0xe5, 0xa2, 0x8f, + 0xc3, 0x10, 0x97, 0xb9, 0x86, 0xb7, 0x0b, 0x69, 0xf0, 0x9c, 0x2f, 0x16, 0xdd, 0xbf, 0x48, 0xb0, + 0x9a, 0xc7, 0x94, 0xa8, 0x47, 0xe9, 0x99, 0xea, 0xb1, 0x74, 0x72, 0xf5, 0xf8, 0x47, 0x29, 0x16, + 0x7b, 0xc7, 0x41, 0x9f, 0xc0, 0xac, 0xb7, 0xda, 0x74, 0x08, 0x23, 0x62, 0x85, 0x78, 0x63, 0x5c, + 0xfb, 0x76, 0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, 0xf3, 0xc9, 0x10, 0xad, 0x6f, + 0x02, 0x8e, 0x43, 0x0a, 0x74, 0x33, 0x9a, 0xe5, 0x15, 0x1e, 0x93, 0x57, 0x8a, 0xcc, 0xf2, 0xfc, + 0x31, 0xae, 0x28, 0x0f, 0x1f, 0xd7, 0x4f, 0x3d, 0x7a, 0x5c, 0x3f, 0xf5, 0xc5, 0xe3, 0xfa, 0xa9, + 0xfb, 0xc3, 0xba, 0xf4, 0x70, 0x58, 0x97, 0x1e, 0x0d, 0xeb, 0xd2, 0x17, 0xc3, 0xba, 0xf4, 0xe5, + 0xb0, 0x2e, 0x7d, 0xf6, 0xcf, 0xfa, 0xa9, 0xef, 0xbd, 0x34, 0xee, 0x3f, 0x06, 0xfe, 0x1b, 0x00, + 0x00, 0xff, 0xff, 0x74, 0xeb, 0x00, 0x3b, 0x50, 0x20, 0x00, 0x00, } -func (m *ResourceFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + +func (m *AllocationResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return b[:n], nil -} -func (m *ResourceFilter) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceFilter.Merge(m, src) -} -func (m *ResourceFilter) XXX_Size() int { - return m.Size() -} -func (m *ResourceFilter) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceFilter.DiscardUnknown(m) + return dAtA[:n], nil } -var xxx_messageInfo_ResourceFilter proto.InternalMessageInfo - -func (m *ResourceFilterModel) Reset() { *m = ResourceFilterModel{} } -func (*ResourceFilterModel) ProtoMessage() {} -func (*ResourceFilterModel) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{35} -} -func (m *ResourceFilterModel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *AllocationResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceFilterModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (m *AllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x22 + if m.NodeSelector != nil { + { + size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - return b[:n], nil -} -func (m *ResourceFilterModel) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceFilterModel.Merge(m, src) -} -func (m *ResourceFilterModel) XXX_Size() int { - return m.Size() -} -func (m *ResourceFilterModel) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceFilterModel.DiscardUnknown(m) + { + size, err := m.Devices.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -var xxx_messageInfo_ResourceFilterModel proto.InternalMessageInfo - -func (m *ResourceHandle) Reset() { *m = ResourceHandle{} } -func (*ResourceHandle) ProtoMessage() {} -func (*ResourceHandle) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{36} -} -func (m *ResourceHandle) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceHandle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) +func (m *BasicDevice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return b[:n], nil -} -func (m *ResourceHandle) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceHandle.Merge(m, src) -} -func (m *ResourceHandle) XXX_Size() int { - return m.Size() + return dAtA[:n], nil } -func (m *ResourceHandle) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceHandle.DiscardUnknown(m) + +func (m *BasicDevice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_ResourceHandle proto.InternalMessageInfo - -func (m *ResourceModel) Reset() { *m = ResourceModel{} } -func (*ResourceModel) ProtoMessage() {} -func (*ResourceModel) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{37} -} -func (m *ResourceModel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceModel) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceModel.Merge(m, src) -} -func (m *ResourceModel) XXX_Size() int { - return m.Size() -} -func (m *ResourceModel) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceModel.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceModel proto.InternalMessageInfo - -func (m *ResourceRequest) Reset() { *m = ResourceRequest{} } -func (*ResourceRequest) ProtoMessage() {} -func (*ResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{38} -} -func (m *ResourceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceRequest.Merge(m, src) -} -func (m *ResourceRequest) XXX_Size() int { - return m.Size() -} -func (m *ResourceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceRequest proto.InternalMessageInfo - -func (m *ResourceRequestModel) Reset() { *m = ResourceRequestModel{} } -func (*ResourceRequestModel) ProtoMessage() {} -func (*ResourceRequestModel) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{39} -} -func (m *ResourceRequestModel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceRequestModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceRequestModel) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceRequestModel.Merge(m, src) -} -func (m *ResourceRequestModel) XXX_Size() int { - return m.Size() -} -func (m *ResourceRequestModel) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceRequestModel.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceRequestModel proto.InternalMessageInfo - -func (m *ResourceSlice) Reset() { *m = ResourceSlice{} } -func (*ResourceSlice) ProtoMessage() {} -func (*ResourceSlice) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{40} -} -func (m *ResourceSlice) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceSlice) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceSlice.Merge(m, src) -} -func (m *ResourceSlice) XXX_Size() int { - return m.Size() -} -func (m *ResourceSlice) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceSlice.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceSlice proto.InternalMessageInfo - -func (m *ResourceSliceList) Reset() { *m = ResourceSliceList{} } -func (*ResourceSliceList) ProtoMessage() {} -func (*ResourceSliceList) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{41} -} -func (m *ResourceSliceList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceSliceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourceSliceList) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceSliceList.Merge(m, src) -} -func (m *ResourceSliceList) XXX_Size() int { - return m.Size() -} -func (m *ResourceSliceList) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceSliceList.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceSliceList proto.InternalMessageInfo - -func (m *StructuredResourceHandle) Reset() { *m = StructuredResourceHandle{} } -func (*StructuredResourceHandle) ProtoMessage() {} -func (*StructuredResourceHandle) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{42} -} -func (m *StructuredResourceHandle) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StructuredResourceHandle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (m *BasicDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Capacity) > 0 { + keysForCapacity := make([]string, 0, len(m.Capacity)) + for k := range m.Capacity { + keysForCapacity = append(keysForCapacity, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity) + for iNdEx := len(keysForCapacity) - 1; iNdEx >= 0; iNdEx-- { + v := m.Capacity[QualifiedName(keysForCapacity[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForCapacity[iNdEx]) + copy(dAtA[i:], keysForCapacity[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForCapacity[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } } - return b[:n], nil -} -func (m *StructuredResourceHandle) XXX_Merge(src proto.Message) { - xxx_messageInfo_StructuredResourceHandle.Merge(m, src) -} -func (m *StructuredResourceHandle) XXX_Size() int { - return m.Size() -} -func (m *StructuredResourceHandle) XXX_DiscardUnknown() { - xxx_messageInfo_StructuredResourceHandle.DiscardUnknown(m) -} - -var xxx_messageInfo_StructuredResourceHandle proto.InternalMessageInfo - -func (m *VendorParameters) Reset() { *m = VendorParameters{} } -func (*VendorParameters) ProtoMessage() {} -func (*VendorParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_4312f5b44a31ec02, []int{43} -} -func (m *VendorParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VendorParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + if len(m.Attributes) > 0 { + keysForAttributes := make([]string, 0, len(m.Attributes)) + for k := range m.Attributes { + keysForAttributes = append(keysForAttributes, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes) + for iNdEx := len(keysForAttributes) - 1; iNdEx >= 0; iNdEx-- { + v := m.Attributes[QualifiedName(keysForAttributes[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAttributes[iNdEx]) + copy(dAtA[i:], keysForAttributes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAttributes[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } } - return b[:n], nil -} -func (m *VendorParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_VendorParameters.Merge(m, src) -} -func (m *VendorParameters) XXX_Size() int { - return m.Size() -} -func (m *VendorParameters) XXX_DiscardUnknown() { - xxx_messageInfo_VendorParameters.DiscardUnknown(m) -} - -var xxx_messageInfo_VendorParameters proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AllocationResult)(nil), "k8s.io.api.resource.v1alpha2.AllocationResult") - proto.RegisterType((*AllocationResultModel)(nil), "k8s.io.api.resource.v1alpha2.AllocationResultModel") - proto.RegisterType((*DriverAllocationResult)(nil), "k8s.io.api.resource.v1alpha2.DriverAllocationResult") - proto.RegisterType((*DriverRequests)(nil), "k8s.io.api.resource.v1alpha2.DriverRequests") - proto.RegisterType((*NamedResourcesAllocationResult)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesAllocationResult") - proto.RegisterType((*NamedResourcesAttribute)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesAttribute") - proto.RegisterType((*NamedResourcesAttributeValue)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesAttributeValue") - proto.RegisterType((*NamedResourcesFilter)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesFilter") - proto.RegisterType((*NamedResourcesInstance)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesInstance") - proto.RegisterType((*NamedResourcesIntSlice)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesIntSlice") - proto.RegisterType((*NamedResourcesRequest)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesRequest") - proto.RegisterType((*NamedResourcesResources)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesResources") - proto.RegisterType((*NamedResourcesStringSlice)(nil), "k8s.io.api.resource.v1alpha2.NamedResourcesStringSlice") - proto.RegisterType((*PodSchedulingContext)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContext") - proto.RegisterType((*PodSchedulingContextList)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContextList") - proto.RegisterType((*PodSchedulingContextSpec)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContextSpec") - proto.RegisterType((*PodSchedulingContextStatus)(nil), "k8s.io.api.resource.v1alpha2.PodSchedulingContextStatus") - proto.RegisterType((*ResourceClaim)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaim") - proto.RegisterType((*ResourceClaimConsumerReference)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimConsumerReference") - proto.RegisterType((*ResourceClaimList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimList") - proto.RegisterType((*ResourceClaimParameters)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimParameters") - proto.RegisterType((*ResourceClaimParametersList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimParametersList") - proto.RegisterType((*ResourceClaimParametersReference)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimParametersReference") - proto.RegisterType((*ResourceClaimSchedulingStatus)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimSchedulingStatus") - proto.RegisterType((*ResourceClaimSpec)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimSpec") - proto.RegisterType((*ResourceClaimStatus)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimStatus") - proto.RegisterType((*ResourceClaimTemplate)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimTemplate") - proto.RegisterType((*ResourceClaimTemplateList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimTemplateList") - proto.RegisterType((*ResourceClaimTemplateSpec)(nil), "k8s.io.api.resource.v1alpha2.ResourceClaimTemplateSpec") - proto.RegisterType((*ResourceClass)(nil), "k8s.io.api.resource.v1alpha2.ResourceClass") - proto.RegisterType((*ResourceClassList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassList") - proto.RegisterType((*ResourceClassParameters)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassParameters") - proto.RegisterType((*ResourceClassParametersList)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassParametersList") - proto.RegisterType((*ResourceClassParametersReference)(nil), "k8s.io.api.resource.v1alpha2.ResourceClassParametersReference") - proto.RegisterType((*ResourceFilter)(nil), "k8s.io.api.resource.v1alpha2.ResourceFilter") - proto.RegisterType((*ResourceFilterModel)(nil), "k8s.io.api.resource.v1alpha2.ResourceFilterModel") - proto.RegisterType((*ResourceHandle)(nil), "k8s.io.api.resource.v1alpha2.ResourceHandle") - proto.RegisterType((*ResourceModel)(nil), "k8s.io.api.resource.v1alpha2.ResourceModel") - proto.RegisterType((*ResourceRequest)(nil), "k8s.io.api.resource.v1alpha2.ResourceRequest") - proto.RegisterType((*ResourceRequestModel)(nil), "k8s.io.api.resource.v1alpha2.ResourceRequestModel") - proto.RegisterType((*ResourceSlice)(nil), "k8s.io.api.resource.v1alpha2.ResourceSlice") - proto.RegisterType((*ResourceSliceList)(nil), "k8s.io.api.resource.v1alpha2.ResourceSliceList") - proto.RegisterType((*StructuredResourceHandle)(nil), "k8s.io.api.resource.v1alpha2.StructuredResourceHandle") - proto.RegisterType((*VendorParameters)(nil), "k8s.io.api.resource.v1alpha2.VendorParameters") -} - -func init() { - proto.RegisterFile("k8s.io/api/resource/v1alpha2/generated.proto", fileDescriptor_4312f5b44a31ec02) -} - -var fileDescriptor_4312f5b44a31ec02 = []byte{ - // 2242 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x1a, 0x4d, 0x6c, 0x1c, 0x57, - 0xd9, 0xb3, 0xbb, 0x89, 0xd7, 0x9f, 0xed, 0xb5, 0x33, 0xb6, 0xe3, 0x4d, 0xea, 0xee, 0x6e, 0x47, - 0x20, 0x2c, 0x70, 0x76, 0x1b, 0xa7, 0x4d, 0xa3, 0x52, 0x90, 0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, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x94, 0xb7, 0xe5, 0x3f, 0x28, - 0x00, 0x00, + return len(dAtA) - i, nil } -func (m *AllocationResult) Marshal() (dAtA []byte, err error) { +func (m *CELDeviceSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1485,54 +1377,25 @@ func (m *AllocationResult) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllocationResult) MarshalTo(dAtA []byte) (int, error) { +func (m *CELDeviceSelector) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *CELDeviceSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression))) i-- - if m.Shareable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - if m.AvailableOnNodes != nil { - { - size, err := m.AvailableOnNodes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ResourceHandles) > 0 { - for iNdEx := len(m.ResourceHandles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResourceHandles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *AllocationResultModel) Marshal() (dAtA []byte, err error) { +func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1542,19 +1405,19 @@ func (m *AllocationResultModel) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllocationResultModel) MarshalTo(dAtA []byte) (int, error) { +func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllocationResultModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.NamedResources != nil { + if m.Basic != nil { { - size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1562,12 +1425,17 @@ func (m *AllocationResultModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *DriverAllocationResult) Marshal() (dAtA []byte, err error) { +func (m *DeviceAllocationConfiguration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1577,18 +1445,18 @@ func (m *DriverAllocationResult) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DriverAllocationResult) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceAllocationConfiguration) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DriverAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceAllocationConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.AllocationResultModel.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DeviceConfiguration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1596,21 +1464,25 @@ func (m *DriverAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - { - size, err := m.VendorRequestParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0x1a + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Requests[iNdEx]) + copy(dAtA[i:], m.Requests[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requests[iNdEx]))) + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Source))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *DriverRequests) Marshal() (dAtA []byte, err error) { +func (m *DeviceAllocationResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1620,20 +1492,20 @@ func (m *DriverRequests) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DriverRequests) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceAllocationResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DriverRequests) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Requests) > 0 { - for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Config) > 0 { + for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1641,28 +1513,27 @@ func (m *DriverRequests) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } } - { - size, err := m.VendorParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *NamedResourcesAllocationResult) Marshal() (dAtA []byte, err error) { +func (m *DeviceAttribute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1672,78 +1543,12 @@ func (m *NamedResourcesAllocationResult) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NamedResourcesAllocationResult) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceAttribute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NamedResourcesAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NamedResourcesAttribute) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NamedResourcesAttribute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedResourcesAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.NamedResourcesAttributeValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NamedResourcesAttributeValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NamedResourcesAttributeValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedResourcesAttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1753,55 +1558,14 @@ func (m *NamedResourcesAttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, e copy(dAtA[i:], *m.VersionValue) i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VersionValue))) i-- - dAtA[i] = 0x52 - } - if m.StringSliceValue != nil { - { - size, err := m.StringSliceValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.IntSliceValue != nil { - { - size, err := m.IntSliceValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.IntValue != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.IntValue)) - i-- - dAtA[i] = 0x38 - } - if m.QuantityValue != nil { - { - size, err := m.QuantityValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } if m.StringValue != nil { i -= len(*m.StringValue) copy(dAtA[i:], *m.StringValue) i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StringValue))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if m.BoolValue != nil { i-- @@ -1811,40 +1575,17 @@ func (m *NamedResourcesAttributeValue) MarshalToSizedBuffer(dAtA []byte) (int, e dAtA[i] = 0 } i-- - dAtA[i] = 0x10 + dAtA[i] = 0x18 } - return len(dAtA) - i, nil -} - -func (m *NamedResourcesFilter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.IntValue != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.IntValue)) + i-- + dAtA[i] = 0x10 } - return dAtA[:n], nil -} - -func (m *NamedResourcesFilter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedResourcesFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Selector) - copy(dAtA[i:], m.Selector) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Selector))) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *NamedResourcesInstance) Marshal() (dAtA []byte, err error) { +func (m *DeviceClaim) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1854,20 +1595,20 @@ func (m *NamedResourcesInstance) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NamedResourcesInstance) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceClaim) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NamedResourcesInstance) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Attributes) > 0 { - for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Config) > 0 { + for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1875,99 +1616,27 @@ func (m *NamedResourcesInstance) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } } - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NamedResourcesIntSlice) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NamedResourcesIntSlice) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedResourcesIntSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ints) > 0 { - for iNdEx := len(m.Ints) - 1; iNdEx >= 0; iNdEx-- { - i = encodeVarintGenerated(dAtA, i, uint64(m.Ints[iNdEx])) + if len(m.Constraints) > 0 { + for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Constraints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 + dAtA[i] = 0x12 } } - return len(dAtA) - i, nil -} - -func (m *NamedResourcesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NamedResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Selector) - copy(dAtA[i:], m.Selector) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Selector))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NamedResourcesResources) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NamedResourcesResources) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NamedResourcesResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Instances) > 0 { - for iNdEx := len(m.Instances) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Instances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1981,7 +1650,7 @@ func (m *NamedResourcesResources) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *NamedResourcesStringSlice) Marshal() (dAtA []byte, err error) { +func (m *DeviceClaimConfiguration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1991,21 +1660,31 @@ func (m *NamedResourcesStringSlice) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NamedResourcesStringSlice) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceClaimConfiguration) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NamedResourcesStringSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceClaimConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Strings) > 0 { - for iNdEx := len(m.Strings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Strings[iNdEx]) - copy(dAtA[i:], m.Strings[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Strings[iNdEx]))) + { + size, err := m.DeviceConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Requests[iNdEx]) + copy(dAtA[i:], m.Requests[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requests[iNdEx]))) i-- dAtA[i] = 0xa } @@ -2013,7 +1692,7 @@ func (m *NamedResourcesStringSlice) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *PodSchedulingContext) Marshal() (dAtA []byte, err error) { +func (m *DeviceClass) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2023,18 +1702,18 @@ func (m *PodSchedulingContext) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodSchedulingContext) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceClass) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2042,9 +1721,9 @@ func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2052,9 +1731,32 @@ func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DeviceClassConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceClassConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceClassConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DeviceConfiguration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2066,7 +1768,7 @@ func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PodSchedulingContextList) Marshal() (dAtA []byte, err error) { +func (m *DeviceClassList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2076,12 +1778,12 @@ func (m *PodSchedulingContextList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodSchedulingContextList) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceClassList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodSchedulingContextList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2113,7 +1815,7 @@ func (m *PodSchedulingContextList) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *PodSchedulingContextSpec) Marshal() (dAtA []byte, err error) { +func (m *DeviceClassSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2123,34 +1825,60 @@ func (m *PodSchedulingContextSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodSchedulingContextSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceClassSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodSchedulingContextSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceClassSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.PotentialNodes) > 0 { - for iNdEx := len(m.PotentialNodes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PotentialNodes[iNdEx]) - copy(dAtA[i:], m.PotentialNodes[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.PotentialNodes[iNdEx]))) - i-- - dAtA[i] = 0x12 + if m.SuitableNodes != nil { + { + size, err := m.SuitableNodes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Config) > 0 { + for iNdEx := len(m.Config) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Config[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Selectors) > 0 { + for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } } - i -= len(m.SelectedNode) - copy(dAtA[i:], m.SelectedNode) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.SelectedNode))) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *PodSchedulingContextStatus) Marshal() (dAtA []byte, err error) { +func (m *DeviceConfiguration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2160,26 +1888,63 @@ func (m *PodSchedulingContextStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodSchedulingContextStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceConfiguration) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodSchedulingContextStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ResourceClaims) > 0 { - for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeviceConstraint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceConstraint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceConstraint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MatchAttribute != nil { + i -= len(*m.MatchAttribute) + copy(dAtA[i:], *m.MatchAttribute) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MatchAttribute))) + i-- + dAtA[i] = 0x12 + } + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Requests[iNdEx]) + copy(dAtA[i:], m.Requests[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requests[iNdEx]))) i-- dAtA[i] = 0xa } @@ -2187,7 +1952,7 @@ func (m *PodSchedulingContextStatus) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *ResourceClaim) Marshal() (dAtA []byte, err error) { +func (m *DeviceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2197,50 +1962,60 @@ func (m *ResourceClaim) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaim) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + if m.AdminAccess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- - dAtA[i] = 0x1a - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0x30 + i = encodeVarintGenerated(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x28 + i -= len(m.CountMode) + copy(dAtA[i:], m.CountMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CountMode))) + i-- + dAtA[i] = 0x22 + if len(m.Selectors) > 0 { + for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i -= len(m.DeviceClassName) + copy(dAtA[i:], m.DeviceClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeviceClassName))) i-- dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) { +func (m *DeviceRequestAllocationResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2250,40 +2025,40 @@ func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimConsumerReference) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceRequestAllocationResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimConsumerReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceRequestAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.UID) - copy(dAtA[i:], m.UID) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) - i-- - dAtA[i] = 0x2a - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i -= len(m.Device) + copy(dAtA[i:], m.Device) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Device))) i-- dAtA[i] = 0x22 - i -= len(m.Resource) - copy(dAtA[i:], m.Resource) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) + i -= len(m.Pool) + copy(dAtA[i:], m.Pool) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Pool))) i-- dAtA[i] = 0x1a - i -= len(m.APIGroup) - copy(dAtA[i:], m.APIGroup) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + i -= len(m.Driver) + copy(dAtA[i:], m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i-- + dAtA[i] = 0x12 + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Request))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) { +func (m *DeviceSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2293,32 +2068,53 @@ func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimList) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceSelector) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.CEL != nil { + { + size, err := m.CEL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *OpaqueDeviceConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OpaqueDeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2326,11 +2122,16 @@ func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x12 + i -= len(m.Driver) + copy(dAtA[i:], m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimParameters) Marshal() (dAtA []byte, err error) { +func (m *PodSchedulingContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2340,50 +2141,36 @@ func (m *ResourceClaimParameters) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimParameters) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSchedulingContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSchedulingContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.DriverRequests) > 0 { - for iNdEx := len(m.DriverRequests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DriverRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - if m.Shareable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - if m.GeneratedFrom != nil { - { - size, err := m.GeneratedFrom.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 { size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2397,7 +2184,7 @@ func (m *ResourceClaimParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *ResourceClaimParametersList) Marshal() (dAtA []byte, err error) { +func (m *PodSchedulingContextList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2407,12 +2194,12 @@ func (m *ResourceClaimParametersList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimParametersList) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSchedulingContextList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimParametersList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSchedulingContextList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2444,7 +2231,7 @@ func (m *ResourceClaimParametersList) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *ResourceClaimParametersReference) Marshal() (dAtA []byte, err error) { +func (m *PodSchedulingContextSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2454,35 +2241,34 @@ func (m *ResourceClaimParametersReference) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimParametersReference) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSchedulingContextSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimParametersReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSchedulingContextSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x12 - i -= len(m.APIGroup) - copy(dAtA[i:], m.APIGroup) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + if len(m.PotentialNodes) > 0 { + for iNdEx := len(m.PotentialNodes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PotentialNodes[iNdEx]) + copy(dAtA[i:], m.PotentialNodes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PotentialNodes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.SelectedNode) + copy(dAtA[i:], m.SelectedNode) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SelectedNode))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimSchedulingStatus) Marshal() (dAtA []byte, err error) { +func (m *PodSchedulingContextStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2492,17 +2278,197 @@ func (m *ResourceClaimSchedulingStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimSchedulingStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSchedulingContextStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimSchedulingStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSchedulingContextStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.UnsuitableNodes) > 0 { + if len(m.ResourceClaims) > 0 { + for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ResourceClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceClaimConsumerReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceClaimConsumerReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) + i-- + dAtA[i] = 0x2a + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x1a + i -= len(m.APIGroup) + copy(dAtA[i:], m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceClaimList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceClaimSchedulingStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceClaimSchedulingStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceClaimSchedulingStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UnsuitableNodes) > 0 { for iNdEx := len(m.UnsuitableNodes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.UnsuitableNodes[iNdEx]) copy(dAtA[i:], m.UnsuitableNodes[iNdEx]) @@ -2539,26 +2505,19 @@ func (m *ResourceClaimSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - i -= len(m.AllocationMode) - copy(dAtA[i:], m.AllocationMode) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllocationMode))) + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Controller))) i-- - dAtA[i] = 0x1a - if m.ParametersRef != nil { - { - size, err := m.ParametersRef.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + dAtA[i] = 0x12 + { + size, err := m.Devices.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= len(m.ResourceClassName) - copy(dAtA[i:], m.ResourceClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceClassName))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -2591,7 +2550,7 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 if len(m.ReservedFor) > 0 { for iNdEx := len(m.ReservedFor) - 1; iNdEx >= 0; iNdEx-- { { @@ -2603,7 +2562,7 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } } if m.Allocation != nil { @@ -2616,13 +2575,8 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2759,7 +2713,7 @@ func (m *ResourceClaimTemplateSpec) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *ResourceClass) Marshal() (dAtA []byte, err error) { +func (m *ResourcePool) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2769,69 +2723,31 @@ func (m *ResourceClass) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClass) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourcePool) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourcePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.StructuredParameters != nil { - i-- - if *m.StructuredParameters { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.SuitableNodes != nil { - { - size, err := m.SuitableNodes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.ParametersRef != nil { - { - size, err := m.ParametersRef.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) + i = encodeVarintGenerated(dAtA, i, uint64(m.ResourceSliceCount)) i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + dAtA[i] = 0x18 + i = encodeVarintGenerated(dAtA, i, uint64(m.Generation)) + i-- + dAtA[i] = 0x10 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClassList) Marshal() (dAtA []byte, err error) { +func (m *ResourceSlice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2841,32 +2757,18 @@ func (m *ResourceClassList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClassList) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceSlice) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2874,70 +2776,7 @@ func (m *ResourceClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ResourceClassParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResourceClassParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceClassParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Filters) > 0 { - for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.VendorParameters) > 0 { - for iNdEx := len(m.VendorParameters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VendorParameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.GeneratedFrom != nil { - { - size, err := m.GeneratedFrom.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } + dAtA[i] = 0x12 { size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2951,7 +2790,7 @@ func (m *ResourceClassParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *ResourceClassParametersList) Marshal() (dAtA []byte, err error) { +func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2961,12 +2800,12 @@ func (m *ResourceClassParametersList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClassParametersList) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceSliceList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClassParametersList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2998,7 +2837,7 @@ func (m *ResourceClassParametersList) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *ResourceClassParametersReference) Marshal() (dAtA []byte, err error) { +func (m *ResourceSliceSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3008,61 +2847,57 @@ func (m *ResourceClassParametersReference) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClassParametersReference) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceSliceSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClassParametersReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x22 - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } i-- - dAtA[i] = 0x12 - i -= len(m.APIGroup) - copy(dAtA[i:], m.APIGroup) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + if m.AllNodes { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ResourceFilter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + dAtA[i] = 0x28 + if m.NodeSelector != nil { + { + size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - return dAtA[:n], nil -} - -func (m *ResourceFilter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l + i -= len(m.NodeName) + copy(dAtA[i:], m.NodeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) + i-- + dAtA[i] = 0x1a { - size, err := m.ResourceFilterModel.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3071,476 +2906,391 @@ func (m *ResourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) + i -= len(m.Driver) + copy(dAtA[i:], m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceFilterModel) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil + dAtA[offset] = uint8(v) + return base } - -func (m *ResourceFilterModel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *AllocationResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Devices.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.NodeSelector != nil { + l = m.NodeSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Controller) + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *ResourceFilterModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *BasicDevice) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.NamedResources != nil { - { - size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil + if len(m.Capacity) > 0 { + for k, v := range m.Capacity { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n } -func (m *ResourceHandle) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *CELDeviceSelector) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.Expression) + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *ResourceHandle) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *Device) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n } -func (m *ResourceHandle) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DeviceAllocationConfiguration) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.StructuredData != nil { - { - size, err := m.StructuredData.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + l = len(m.Source) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Requests) > 0 { + for _, s := range m.Requests { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) } - i-- - dAtA[i] = 0x2a } - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + l = m.DeviceConfiguration.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *ResourceModel) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *DeviceAllocationResult) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *ResourceModel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if m.NamedResources != nil { - { - size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) } - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil + if len(m.Config) > 0 { + for _, e := range m.Config { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n } -func (m *ResourceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *DeviceAttribute) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *ResourceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + var l int + _ = l + if m.IntValue != nil { + n += 1 + sovGenerated(uint64(*m.IntValue)) + } + if m.BoolValue != nil { + n += 2 + } + if m.StringValue != nil { + l = len(*m.StringValue) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.VersionValue != nil { + l = len(*m.VersionValue) + n += 1 + l + sovGenerated(uint64(l)) + } + return n } -func (m *ResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DeviceClaim) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - { - size, err := m.ResourceRequestModel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 - { - size, err := m.VendorParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Constraints) > 0 { + for _, e := range m.Constraints { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ResourceRequestModel) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if len(m.Config) > 0 { + for _, e := range m.Config { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } } - return dAtA[:n], nil -} - -func (m *ResourceRequestModel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *ResourceRequestModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DeviceClaimConfiguration) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.NamedResources != nil { - { - size, err := m.NamedResources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if len(m.Requests) > 0 { + for _, s := range m.Requests { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) } - i-- - dAtA[i] = 0xa } - return len(dAtA) - i, nil + l = m.DeviceConfiguration.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *ResourceSlice) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *DeviceClass) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *ResourceSlice) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *DeviceClassConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.DeviceConfiguration.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DeviceClassList) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - { - size, err := m.ResourceModel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) - i-- - dAtA[i] = 0x1a - i -= len(m.NodeName) - copy(dAtA[i:], m.NodeName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } -func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *DeviceClassSpec) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + if len(m.Selectors) > 0 { + for _, e := range m.Selectors { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Config) > 0 { + for _, e := range m.Config { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SuitableNodes != nil { + l = m.SuitableNodes.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n } -func (m *ResourceSliceList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *DeviceConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n } -func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DeviceConstraint) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if len(m.Requests) > 0 { + for _, s := range m.Requests { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) } } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.MatchAttribute != nil { + l = len(*m.MatchAttribute) + n += 1 + l + sovGenerated(uint64(l)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + return n } -func (m *StructuredResourceHandle) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *DeviceRequest) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeviceClassName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Selectors) > 0 { + for _, e := range m.Selectors { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.CountMode) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Count)) + n += 2 + return n } -func (m *StructuredResourceHandle) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *DeviceRequestAllocationResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Request) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Pool) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Device) + n += 1 + l + sovGenerated(uint64(l)) + return n } -func (m *StructuredResourceHandle) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DeviceSelector) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - i -= len(m.NodeName) - copy(dAtA[i:], m.NodeName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) - i-- - dAtA[i] = 0x22 - { - size, err := m.VendorClaimParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.VendorClassParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *VendorParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VendorParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VendorParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(m.DriverName) - copy(dAtA[i:], m.DriverName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DriverName))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AllocationResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ResourceHandles) > 0 { - for _, e := range m.ResourceHandles { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if m.AvailableOnNodes != nil { - l = m.AvailableOnNodes.Size() + if m.CEL != nil { + l = m.CEL.Size() n += 1 + l + sovGenerated(uint64(l)) } - n += 2 return n } -func (m *AllocationResultModel) Size() (n int) { +func (m *OpaqueDeviceConfiguration) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.NamedResources != nil { - l = m.NamedResources.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Parameters.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *DriverAllocationResult) Size() (n int) { +func (m *PodSchedulingContext) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.VendorRequestParameters.Size() + l = m.ObjectMeta.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.AllocationResultModel.Size() + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *DriverRequests) Size() (n int) { +func (m *PodSchedulingContextList) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - l = m.VendorParameters.Size() + l = m.ListMeta.Size() n += 1 + l + sovGenerated(uint64(l)) - if len(m.Requests) > 0 { - for _, e := range m.Requests { + if len(m.Items) > 0 { + for _, e := range m.Items { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } @@ -3548,86 +3298,80 @@ func (m *DriverRequests) Size() (n int) { return n } -func (m *NamedResourcesAllocationResult) Size() (n int) { +func (m *PodSchedulingContextSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) + l = len(m.SelectedNode) n += 1 + l + sovGenerated(uint64(l)) + if len(m.PotentialNodes) > 0 { + for _, s := range m.PotentialNodes { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } -func (m *NamedResourcesAttribute) Size() (n int) { +func (m *PodSchedulingContextStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = m.NamedResourcesAttributeValue.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.ResourceClaims) > 0 { + for _, e := range m.ResourceClaims { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } -func (m *NamedResourcesAttributeValue) Size() (n int) { +func (m *ResourceClaim) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.BoolValue != nil { - n += 2 - } - if m.StringValue != nil { - l = len(*m.StringValue) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.QuantityValue != nil { - l = m.QuantityValue.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.IntValue != nil { - n += 1 + sovGenerated(uint64(*m.IntValue)) - } - if m.IntSliceValue != nil { - l = m.IntSliceValue.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.StringSliceValue != nil { - l = m.StringSliceValue.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.VersionValue != nil { - l = len(*m.VersionValue) - n += 1 + l + sovGenerated(uint64(l)) - } + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *NamedResourcesFilter) Size() (n int) { +func (m *ResourceClaimConsumerReference) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Selector) + l = len(m.APIGroup) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Resource) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.UID) n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *NamedResourcesInstance) Size() (n int) { +func (m *ResourceClaimList) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) + l = m.ListMeta.Size() n += 1 + l + sovGenerated(uint64(l)) - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { + if len(m.Items) > 0 { + for _, e := range m.Items { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } @@ -3635,62 +3379,57 @@ func (m *NamedResourcesInstance) Size() (n int) { return n } -func (m *NamedResourcesIntSlice) Size() (n int) { +func (m *ResourceClaimSchedulingStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Ints) > 0 { - for _, e := range m.Ints { - n += 1 + sovGenerated(uint64(e)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.UnsuitableNodes) > 0 { + for _, s := range m.UnsuitableNodes { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) } } return n } -func (m *NamedResourcesRequest) Size() (n int) { +func (m *ResourceClaimSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Selector) + l = m.Devices.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Controller) n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *NamedResourcesResources) Size() (n int) { +func (m *ResourceClaimStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Instances) > 0 { - for _, e := range m.Instances { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *NamedResourcesStringSlice) Size() (n int) { - if m == nil { - return 0 + if m.Allocation != nil { + l = m.Allocation.Size() + n += 1 + l + sovGenerated(uint64(l)) } - var l int - _ = l - if len(m.Strings) > 0 { - for _, s := range m.Strings { - l = len(s) + if len(m.ReservedFor) > 0 { + for _, e := range m.ReservedFor { + l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } + n += 2 return n } -func (m *PodSchedulingContext) Size() (n int) { +func (m *ResourceClaimTemplate) Size() (n int) { if m == nil { return 0 } @@ -3700,12 +3439,10 @@ func (m *PodSchedulingContext) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *PodSchedulingContextList) Size() (n int) { +func (m *ResourceClaimTemplateList) Size() (n int) { if m == nil { return 0 } @@ -3722,39 +3459,33 @@ func (m *PodSchedulingContextList) Size() (n int) { return n } -func (m *PodSchedulingContextSpec) Size() (n int) { +func (m *ResourceClaimTemplateSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SelectedNode) + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - if len(m.PotentialNodes) > 0 { - for _, s := range m.PotentialNodes { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } return n } -func (m *PodSchedulingContextStatus) Size() (n int) { +func (m *ResourcePool) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.ResourceClaims) > 0 { - for _, e := range m.ResourceClaims { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Generation)) + n += 1 + sovGenerated(uint64(m.ResourceSliceCount)) return n } -func (m *ResourceClaim) Size() (n int) { +func (m *ResourceSlice) Size() (n int) { if m == nil { return 0 } @@ -3764,29 +3495,10 @@ func (m *ResourceClaim) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ResourceClaimConsumerReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.APIGroup) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Resource) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.UID) - n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *ResourceClaimList) Size() (n int) { +func (m *ResourceSliceList) Size() (n int) { if m == nil { return 0 } @@ -3803,21 +3515,25 @@ func (m *ResourceClaimList) Size() (n int) { return n } -func (m *ResourceClaimParameters) Size() (n int) { +func (m *ResourceSliceSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.ObjectMeta.Size() + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Pool.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.NodeName) n += 1 + l + sovGenerated(uint64(l)) - if m.GeneratedFrom != nil { - l = m.GeneratedFrom.Size() + if m.NodeSelector != nil { + l = m.NodeSelector.Size() n += 1 + l + sovGenerated(uint64(l)) } n += 2 - if len(m.DriverRequests) > 0 { - for _, e := range m.DriverRequests { + if len(m.Devices) > 0 { + for _, e := range m.Devices { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } @@ -3825,554 +3541,290 @@ func (m *ResourceClaimParameters) Size() (n int) { return n } -func (m *ResourceClaimParametersList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } - -func (m *ResourceClaimParametersReference) Size() (n int) { - if m == nil { - return 0 +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AllocationResult) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = len(m.APIGroup) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - return n + s := strings.Join([]string{`&AllocationResult{`, + `Devices:` + strings.Replace(strings.Replace(this.Devices.String(), "DeviceAllocationResult", "DeviceAllocationResult", 1), `&`, ``, 1) + `,`, + `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v1.NodeSelector", 1) + `,`, + `Controller:` + fmt.Sprintf("%v", this.Controller) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClaimSchedulingStatus) Size() (n int) { - if m == nil { - return 0 +func (this *BasicDevice) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.UnsuitableNodes) > 0 { - for _, s := range m.UnsuitableNodes { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } + keysForAttributes := make([]string, 0, len(this.Attributes)) + for k := range this.Attributes { + keysForAttributes = append(keysForAttributes, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes) + mapStringForAttributes := "map[QualifiedName]DeviceAttribute{" + for _, k := range keysForAttributes { + mapStringForAttributes += fmt.Sprintf("%v: %v,", k, this.Attributes[QualifiedName(k)]) + } + mapStringForAttributes += "}" + keysForCapacity := make([]string, 0, len(this.Capacity)) + for k := range this.Capacity { + keysForCapacity = append(keysForCapacity, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity) + mapStringForCapacity := "map[QualifiedName]resource.Quantity{" + for _, k := range keysForCapacity { + mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[QualifiedName(k)]) + } + mapStringForCapacity += "}" + s := strings.Join([]string{`&BasicDevice{`, + `Attributes:` + mapStringForAttributes + `,`, + `Capacity:` + mapStringForCapacity + `,`, + `}`, + }, "") + return s +} +func (this *CELDeviceSelector) String() string { + if this == nil { + return "nil" } - return n + s := strings.Join([]string{`&CELDeviceSelector{`, + `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClaimSpec) Size() (n int) { - if m == nil { - return 0 +func (this *Device) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = len(m.ResourceClassName) - n += 1 + l + sovGenerated(uint64(l)) - if m.ParametersRef != nil { - l = m.ParametersRef.Size() - n += 1 + l + sovGenerated(uint64(l)) + s := strings.Join([]string{`&Device{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Basic:` + strings.Replace(this.Basic.String(), "BasicDevice", "BasicDevice", 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceAllocationConfiguration) String() string { + if this == nil { + return "nil" } - l = len(m.AllocationMode) - n += 1 + l + sovGenerated(uint64(l)) - return n + s := strings.Join([]string{`&DeviceAllocationConfiguration{`, + `Source:` + fmt.Sprintf("%v", this.Source) + `,`, + `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`, + `DeviceConfiguration:` + strings.Replace(strings.Replace(this.DeviceConfiguration.String(), "DeviceConfiguration", "DeviceConfiguration", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClaimStatus) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceAllocationResult) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - if m.Allocation != nil { - l = m.Allocation.Size() - n += 1 + l + sovGenerated(uint64(l)) + repeatedStringForResults := "[]DeviceRequestAllocationResult{" + for _, f := range this.Results { + repeatedStringForResults += strings.Replace(strings.Replace(f.String(), "DeviceRequestAllocationResult", "DeviceRequestAllocationResult", 1), `&`, ``, 1) + "," } - if len(m.ReservedFor) > 0 { - for _, e := range m.ReservedFor { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + repeatedStringForResults += "}" + repeatedStringForConfig := "[]DeviceAllocationConfiguration{" + for _, f := range this.Config { + repeatedStringForConfig += strings.Replace(strings.Replace(f.String(), "DeviceAllocationConfiguration", "DeviceAllocationConfiguration", 1), `&`, ``, 1) + "," } - n += 2 - return n + repeatedStringForConfig += "}" + s := strings.Join([]string{`&DeviceAllocationResult{`, + `Results:` + repeatedStringForResults + `,`, + `Config:` + repeatedStringForConfig + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClaimTemplate) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceAttribute) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n + s := strings.Join([]string{`&DeviceAttribute{`, + `IntValue:` + valueToStringGenerated(this.IntValue) + `,`, + `BoolValue:` + valueToStringGenerated(this.BoolValue) + `,`, + `StringValue:` + valueToStringGenerated(this.StringValue) + `,`, + `VersionValue:` + valueToStringGenerated(this.VersionValue) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClaimTemplateList) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceClaim) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + repeatedStringForRequests := "[]DeviceRequest{" + for _, f := range this.Requests { + repeatedStringForRequests += strings.Replace(strings.Replace(f.String(), "DeviceRequest", "DeviceRequest", 1), `&`, ``, 1) + "," } - return n + repeatedStringForRequests += "}" + repeatedStringForConstraints := "[]DeviceConstraint{" + for _, f := range this.Constraints { + repeatedStringForConstraints += strings.Replace(strings.Replace(f.String(), "DeviceConstraint", "DeviceConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForConstraints += "}" + repeatedStringForConfig := "[]DeviceClaimConfiguration{" + for _, f := range this.Config { + repeatedStringForConfig += strings.Replace(strings.Replace(f.String(), "DeviceClaimConfiguration", "DeviceClaimConfiguration", 1), `&`, ``, 1) + "," + } + repeatedStringForConfig += "}" + s := strings.Join([]string{`&DeviceClaim{`, + `Requests:` + repeatedStringForRequests + `,`, + `Constraints:` + repeatedStringForConstraints + `,`, + `Config:` + repeatedStringForConfig + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClaimTemplateSpec) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceClaimConfiguration) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n + s := strings.Join([]string{`&DeviceClaimConfiguration{`, + `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`, + `DeviceConfiguration:` + strings.Replace(strings.Replace(this.DeviceConfiguration.String(), "DeviceConfiguration", "DeviceConfiguration", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClass) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceClass) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - if m.ParametersRef != nil { - l = m.ParametersRef.Size() - n += 1 + l + sovGenerated(uint64(l)) + s := strings.Join([]string{`&DeviceClass{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "DeviceClassSpec", "DeviceClassSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceClassConfiguration) String() string { + if this == nil { + return "nil" } - if m.SuitableNodes != nil { - l = m.SuitableNodes.Size() - n += 1 + l + sovGenerated(uint64(l)) + s := strings.Join([]string{`&DeviceClassConfiguration{`, + `DeviceConfiguration:` + strings.Replace(strings.Replace(this.DeviceConfiguration.String(), "DeviceConfiguration", "DeviceConfiguration", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceClassList) String() string { + if this == nil { + return "nil" } - if m.StructuredParameters != nil { - n += 2 + repeatedStringForItems := "[]DeviceClass{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "DeviceClass", "DeviceClass", 1), `&`, ``, 1) + "," } - return n + repeatedStringForItems += "}" + s := strings.Join([]string{`&DeviceClassList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClassList) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceClassSpec) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + repeatedStringForSelectors := "[]DeviceSelector{" + for _, f := range this.Selectors { + repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + "," } - return n + repeatedStringForSelectors += "}" + repeatedStringForConfig := "[]DeviceClassConfiguration{" + for _, f := range this.Config { + repeatedStringForConfig += strings.Replace(strings.Replace(f.String(), "DeviceClassConfiguration", "DeviceClassConfiguration", 1), `&`, ``, 1) + "," + } + repeatedStringForConfig += "}" + s := strings.Join([]string{`&DeviceClassSpec{`, + `Selectors:` + repeatedStringForSelectors + `,`, + `Config:` + repeatedStringForConfig + `,`, + `SuitableNodes:` + strings.Replace(fmt.Sprintf("%v", this.SuitableNodes), "NodeSelector", "v1.NodeSelector", 1) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClassParameters) Size() (n int) { - if m == nil { - return 0 +func (this *DeviceConfiguration) String() string { + if this == nil { + return "nil" } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if m.GeneratedFrom != nil { - l = m.GeneratedFrom.Size() - n += 1 + l + sovGenerated(uint64(l)) + s := strings.Join([]string{`&DeviceConfiguration{`, + `Opaque:` + strings.Replace(this.Opaque.String(), "OpaqueDeviceConfiguration", "OpaqueDeviceConfiguration", 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceConstraint) String() string { + if this == nil { + return "nil" } - if len(m.VendorParameters) > 0 { - for _, e := range m.VendorParameters { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + s := strings.Join([]string{`&DeviceConstraint{`, + `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`, + `MatchAttribute:` + valueToStringGenerated(this.MatchAttribute) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceRequest) String() string { + if this == nil { + return "nil" } - if len(m.Filters) > 0 { - for _, e := range m.Filters { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + repeatedStringForSelectors := "[]DeviceSelector{" + for _, f := range this.Selectors { + repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + "," } - return n + repeatedStringForSelectors += "}" + s := strings.Join([]string{`&DeviceRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, + `Selectors:` + repeatedStringForSelectors + `,`, + `CountMode:` + fmt.Sprintf("%v", this.CountMode) + `,`, + `Count:` + fmt.Sprintf("%v", this.Count) + `,`, + `AdminAccess:` + fmt.Sprintf("%v", this.AdminAccess) + `,`, + `}`, + }, "") + return s } - -func (m *ResourceClassParametersList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *ResourceClassParametersReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.APIGroup) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ResourceFilter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - l = m.ResourceFilterModel.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ResourceFilterModel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NamedResources != nil { - l = m.NamedResources.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ResourceHandle) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Data) - n += 1 + l + sovGenerated(uint64(l)) - if m.StructuredData != nil { - l = m.StructuredData.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ResourceModel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NamedResources != nil { - l = m.NamedResources.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ResourceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.VendorParameters.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.ResourceRequestModel.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ResourceRequestModel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NamedResources != nil { - l = m.NamedResources.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ResourceSlice) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.NodeName) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - l = m.ResourceModel.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ResourceSliceList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *StructuredResourceHandle) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.VendorClassParameters.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.VendorClaimParameters.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.NodeName) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *VendorParameters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DriverName) - n += 1 + l + sovGenerated(uint64(l)) - l = m.Parameters.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *AllocationResult) String() string { - if this == nil { - return "nil" - } - repeatedStringForResourceHandles := "[]ResourceHandle{" - for _, f := range this.ResourceHandles { - repeatedStringForResourceHandles += strings.Replace(strings.Replace(f.String(), "ResourceHandle", "ResourceHandle", 1), `&`, ``, 1) + "," - } - repeatedStringForResourceHandles += "}" - s := strings.Join([]string{`&AllocationResult{`, - `ResourceHandles:` + repeatedStringForResourceHandles + `,`, - `AvailableOnNodes:` + strings.Replace(fmt.Sprintf("%v", this.AvailableOnNodes), "NodeSelector", "v1.NodeSelector", 1) + `,`, - `Shareable:` + fmt.Sprintf("%v", this.Shareable) + `,`, - `}`, - }, "") - return s -} -func (this *AllocationResultModel) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AllocationResultModel{`, - `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesAllocationResult", "NamedResourcesAllocationResult", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DriverAllocationResult) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DriverAllocationResult{`, - `VendorRequestParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorRequestParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `AllocationResultModel:` + strings.Replace(strings.Replace(this.AllocationResultModel.String(), "AllocationResultModel", "AllocationResultModel", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *DriverRequests) String() string { - if this == nil { - return "nil" - } - repeatedStringForRequests := "[]ResourceRequest{" - for _, f := range this.Requests { - repeatedStringForRequests += strings.Replace(strings.Replace(f.String(), "ResourceRequest", "ResourceRequest", 1), `&`, ``, 1) + "," - } - repeatedStringForRequests += "}" - s := strings.Join([]string{`&DriverRequests{`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `VendorParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `Requests:` + repeatedStringForRequests + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesAllocationResult) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NamedResourcesAllocationResult{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesAttribute) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NamedResourcesAttribute{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `NamedResourcesAttributeValue:` + strings.Replace(strings.Replace(this.NamedResourcesAttributeValue.String(), "NamedResourcesAttributeValue", "NamedResourcesAttributeValue", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesAttributeValue) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NamedResourcesAttributeValue{`, - `BoolValue:` + valueToStringGenerated(this.BoolValue) + `,`, - `StringValue:` + valueToStringGenerated(this.StringValue) + `,`, - `QuantityValue:` + strings.Replace(fmt.Sprintf("%v", this.QuantityValue), "Quantity", "resource.Quantity", 1) + `,`, - `IntValue:` + valueToStringGenerated(this.IntValue) + `,`, - `IntSliceValue:` + strings.Replace(this.IntSliceValue.String(), "NamedResourcesIntSlice", "NamedResourcesIntSlice", 1) + `,`, - `StringSliceValue:` + strings.Replace(this.StringSliceValue.String(), "NamedResourcesStringSlice", "NamedResourcesStringSlice", 1) + `,`, - `VersionValue:` + valueToStringGenerated(this.VersionValue) + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesFilter) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NamedResourcesFilter{`, - `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesInstance) String() string { - if this == nil { - return "nil" - } - repeatedStringForAttributes := "[]NamedResourcesAttribute{" - for _, f := range this.Attributes { - repeatedStringForAttributes += strings.Replace(strings.Replace(f.String(), "NamedResourcesAttribute", "NamedResourcesAttribute", 1), `&`, ``, 1) + "," - } - repeatedStringForAttributes += "}" - s := strings.Join([]string{`&NamedResourcesInstance{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Attributes:` + repeatedStringForAttributes + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesIntSlice) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NamedResourcesIntSlice{`, - `Ints:` + fmt.Sprintf("%v", this.Ints) + `,`, - `}`, - }, "") - return s -} -func (this *NamedResourcesRequest) String() string { +func (this *DeviceRequestAllocationResult) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&NamedResourcesRequest{`, - `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`, + s := strings.Join([]string{`&DeviceRequestAllocationResult{`, + `Request:` + fmt.Sprintf("%v", this.Request) + `,`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `Pool:` + fmt.Sprintf("%v", this.Pool) + `,`, + `Device:` + fmt.Sprintf("%v", this.Device) + `,`, `}`, }, "") return s } -func (this *NamedResourcesResources) String() string { +func (this *DeviceSelector) String() string { if this == nil { return "nil" } - repeatedStringForInstances := "[]NamedResourcesInstance{" - for _, f := range this.Instances { - repeatedStringForInstances += strings.Replace(strings.Replace(f.String(), "NamedResourcesInstance", "NamedResourcesInstance", 1), `&`, ``, 1) + "," - } - repeatedStringForInstances += "}" - s := strings.Join([]string{`&NamedResourcesResources{`, - `Instances:` + repeatedStringForInstances + `,`, + s := strings.Join([]string{`&DeviceSelector{`, + `CEL:` + strings.Replace(this.CEL.String(), "CELDeviceSelector", "CELDeviceSelector", 1) + `,`, `}`, }, "") return s } -func (this *NamedResourcesStringSlice) String() string { +func (this *OpaqueDeviceConfiguration) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&NamedResourcesStringSlice{`, - `Strings:` + fmt.Sprintf("%v", this.Strings) + `,`, + s := strings.Join([]string{`&OpaqueDeviceConfiguration{`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `Parameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Parameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4472,71 +3924,24 @@ func (this *ResourceClaimList) String() string { }, "") return s } -func (this *ResourceClaimParameters) String() string { +func (this *ResourceClaimSchedulingStatus) String() string { if this == nil { return "nil" } - repeatedStringForDriverRequests := "[]DriverRequests{" - for _, f := range this.DriverRequests { - repeatedStringForDriverRequests += strings.Replace(strings.Replace(f.String(), "DriverRequests", "DriverRequests", 1), `&`, ``, 1) + "," - } - repeatedStringForDriverRequests += "}" - s := strings.Join([]string{`&ResourceClaimParameters{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, - `GeneratedFrom:` + strings.Replace(this.GeneratedFrom.String(), "ResourceClaimParametersReference", "ResourceClaimParametersReference", 1) + `,`, - `Shareable:` + fmt.Sprintf("%v", this.Shareable) + `,`, - `DriverRequests:` + repeatedStringForDriverRequests + `,`, + s := strings.Join([]string{`&ResourceClaimSchedulingStatus{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `UnsuitableNodes:` + fmt.Sprintf("%v", this.UnsuitableNodes) + `,`, `}`, }, "") return s } -func (this *ResourceClaimParametersList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]ResourceClaimParameters{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceClaimParameters", "ResourceClaimParameters", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&ResourceClaimParametersList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClaimParametersReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceClaimParametersReference{`, - `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClaimSchedulingStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceClaimSchedulingStatus{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `UnsuitableNodes:` + fmt.Sprintf("%v", this.UnsuitableNodes) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClaimSpec) String() string { +func (this *ResourceClaimSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ResourceClaimSpec{`, - `ResourceClassName:` + fmt.Sprintf("%v", this.ResourceClassName) + `,`, - `ParametersRef:` + strings.Replace(this.ParametersRef.String(), "ResourceClaimParametersReference", "ResourceClaimParametersReference", 1) + `,`, - `AllocationMode:` + fmt.Sprintf("%v", this.AllocationMode) + `,`, + `Devices:` + strings.Replace(strings.Replace(this.Devices.String(), "DeviceClaim", "DeviceClaim", 1), `&`, ``, 1) + `,`, + `Controller:` + fmt.Sprintf("%v", this.Controller) + `,`, `}`, }, "") return s @@ -4551,7 +3956,6 @@ func (this *ResourceClaimStatus) String() string { } repeatedStringForReservedFor += "}" s := strings.Join([]string{`&ResourceClaimStatus{`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, `Allocation:` + strings.Replace(this.Allocation.String(), "AllocationResult", "AllocationResult", 1) + `,`, `ReservedFor:` + repeatedStringForReservedFor + `,`, `DeallocationRequested:` + fmt.Sprintf("%v", this.DeallocationRequested) + `,`, @@ -4597,1496 +4001,74 @@ func (this *ResourceClaimTemplateSpec) String() string { }, "") return s } -func (this *ResourceClass) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceClass{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `ParametersRef:` + strings.Replace(this.ParametersRef.String(), "ResourceClassParametersReference", "ResourceClassParametersReference", 1) + `,`, - `SuitableNodes:` + strings.Replace(fmt.Sprintf("%v", this.SuitableNodes), "NodeSelector", "v1.NodeSelector", 1) + `,`, - `StructuredParameters:` + valueToStringGenerated(this.StructuredParameters) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClassList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]ResourceClass{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceClass", "ResourceClass", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&ResourceClassList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClassParameters) String() string { - if this == nil { - return "nil" - } - repeatedStringForVendorParameters := "[]VendorParameters{" - for _, f := range this.VendorParameters { - repeatedStringForVendorParameters += strings.Replace(strings.Replace(f.String(), "VendorParameters", "VendorParameters", 1), `&`, ``, 1) + "," - } - repeatedStringForVendorParameters += "}" - repeatedStringForFilters := "[]ResourceFilter{" - for _, f := range this.Filters { - repeatedStringForFilters += strings.Replace(strings.Replace(f.String(), "ResourceFilter", "ResourceFilter", 1), `&`, ``, 1) + "," - } - repeatedStringForFilters += "}" - s := strings.Join([]string{`&ResourceClassParameters{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, - `GeneratedFrom:` + strings.Replace(this.GeneratedFrom.String(), "ResourceClassParametersReference", "ResourceClassParametersReference", 1) + `,`, - `VendorParameters:` + repeatedStringForVendorParameters + `,`, - `Filters:` + repeatedStringForFilters + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClassParametersList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]ResourceClassParameters{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceClassParameters", "ResourceClassParameters", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&ResourceClassParametersList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *ResourceClassParametersReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceClassParametersReference{`, - `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceFilter) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceFilter{`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `ResourceFilterModel:` + strings.Replace(strings.Replace(this.ResourceFilterModel.String(), "ResourceFilterModel", "ResourceFilterModel", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceFilterModel) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceFilterModel{`, - `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesFilter", "NamedResourcesFilter", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceHandle) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceHandle{`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `StructuredData:` + strings.Replace(this.StructuredData.String(), "StructuredResourceHandle", "StructuredResourceHandle", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceModel) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceModel{`, - `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesResources", "NamedResourcesResources", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceRequest{`, - `VendorParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `ResourceRequestModel:` + strings.Replace(strings.Replace(this.ResourceRequestModel.String(), "ResourceRequestModel", "ResourceRequestModel", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceRequestModel) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceRequestModel{`, - `NamedResources:` + strings.Replace(this.NamedResources.String(), "NamedResourcesRequest", "NamedResourcesRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceSlice) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceSlice{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, - `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `ResourceModel:` + strings.Replace(strings.Replace(this.ResourceModel.String(), "ResourceModel", "ResourceModel", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceSliceList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]ResourceSlice{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceSlice", "ResourceSlice", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&ResourceSliceList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *StructuredResourceHandle) String() string { - if this == nil { - return "nil" - } - repeatedStringForResults := "[]DriverAllocationResult{" - for _, f := range this.Results { - repeatedStringForResults += strings.Replace(strings.Replace(f.String(), "DriverAllocationResult", "DriverAllocationResult", 1), `&`, ``, 1) + "," - } - repeatedStringForResults += "}" - s := strings.Join([]string{`&StructuredResourceHandle{`, - `VendorClassParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorClassParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `VendorClaimParameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.VendorClaimParameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, - `Results:` + repeatedStringForResults + `,`, - `}`, - }, "") - return s -} -func (this *VendorParameters) String() string { +func (this *ResourcePool) String() string { if this == nil { - return "nil" - } - s := strings.Join([]string{`&VendorParameters{`, - `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, - `Parameters:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Parameters), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *AllocationResult) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AllocationResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceHandles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceHandles = append(m.ResourceHandles, ResourceHandle{}) - if err := m.ResourceHandles[len(m.ResourceHandles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvailableOnNodes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AvailableOnNodes == nil { - m.AvailableOnNodes = &v1.NodeSelector{} - } - if err := m.AvailableOnNodes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shareable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Shareable = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllocationResultModel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AllocationResultModel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllocationResultModel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NamedResources == nil { - m.NamedResources = &NamedResourcesAllocationResult{} - } - if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DriverAllocationResult) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DriverAllocationResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DriverAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VendorRequestParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VendorRequestParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationResultModel", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AllocationResultModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DriverRequests) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DriverRequests: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DriverRequests: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DriverName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VendorParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VendorParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Requests = append(m.Requests, ResourceRequest{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedResourcesAllocationResult) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesAllocationResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedResourcesAttribute) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesAttribute: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesAttribute: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamedResourcesAttributeValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.NamedResourcesAttributeValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedResourcesAttributeValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesAttributeValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesAttributeValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.BoolValue = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.StringValue = &s - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuantityValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QuantityValue == nil { - m.QuantityValue = &resource.Quantity{} - } - if err := m.QuantityValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IntValue = &v - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IntSliceValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IntSliceValue == nil { - m.IntSliceValue = &NamedResourcesIntSlice{} - } - if err := m.IntSliceValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringSliceValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StringSliceValue == nil { - m.StringSliceValue = &NamedResourcesStringSlice{} - } - if err := m.StringSliceValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VersionValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.VersionValue = &s - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedResourcesFilter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesFilter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesFilter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Selector = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedResourcesInstance) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesInstance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesInstance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, NamedResourcesAttribute{}) - if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NamedResourcesIntSlice) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesIntSlice: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesIntSlice: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ints = append(m.Ints, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Ints) == 0 { - m.Ints = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Ints = append(m.Ints, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Ints", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + return "nil" } - - if iNdEx > l { - return io.ErrUnexpectedEOF + s := strings.Join([]string{`&ResourcePool{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Generation:` + fmt.Sprintf("%v", this.Generation) + `,`, + `ResourceSliceCount:` + fmt.Sprintf("%v", this.ResourceSliceCount) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceSlice) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&ResourceSlice{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ResourceSliceSpec", "ResourceSliceSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceSliceList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]ResourceSlice{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ResourceSlice", "ResourceSlice", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&ResourceSliceList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *ResourceSliceSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForDevices := "[]Device{" + for _, f := range this.Devices { + repeatedStringForDevices += strings.Replace(strings.Replace(f.String(), "Device", "Device", 1), `&`, ``, 1) + "," + } + repeatedStringForDevices += "}" + s := strings.Join([]string{`&ResourceSliceSpec{`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `Pool:` + strings.Replace(strings.Replace(this.Pool.String(), "ResourcePool", "ResourcePool", 1), `&`, ``, 1) + `,`, + `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, + `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v1.NodeSelector", 1) + `,`, + `AllNodes:` + fmt.Sprintf("%v", this.AllNodes) + `,`, + `Devices:` + repeatedStringForDevices + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) } -func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error { +func (m *AllocationResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6109,15 +4091,84 @@ func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AllocationResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Devices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = &v1.NodeSelector{} + } + if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6145,7 +4196,7 @@ func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Selector = string(dAtA[iNdEx:postIndex]) + m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6168,7 +4219,7 @@ func (m *NamedResourcesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error { +func (m *BasicDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6191,15 +4242,15 @@ func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesResources: wiretype end group for non-group") + return fmt.Errorf("proto: BasicDevice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesResources: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BasicDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6226,10 +4277,234 @@ func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Instances = append(m.Instances, NamedResourcesInstance{}) - if err := m.Instances[len(m.Instances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Attributes == nil { + m.Attributes = make(map[QualifiedName]DeviceAttribute) + } + var mapkey QualifiedName + mapvalue := &DeviceAttribute{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &DeviceAttribute{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Attributes[QualifiedName(mapkey)] = *mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Capacity == nil { + m.Capacity = make(map[QualifiedName]resource.Quantity) + } + var mapkey QualifiedName + mapvalue := &resource.Quantity{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &resource.Quantity{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.Capacity[QualifiedName(mapkey)] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -6252,7 +4527,7 @@ func (m *NamedResourcesResources) Unmarshal(dAtA []byte) error { } return nil } -func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error { +func (m *CELDeviceSelector) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6275,15 +4550,15 @@ func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NamedResourcesStringSlice: wiretype end group for non-group") + return fmt.Errorf("proto: CELDeviceSelector: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NamedResourcesStringSlice: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CELDeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Strings", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6311,7 +4586,7 @@ func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Strings = append(m.Strings, string(dAtA[iNdEx:postIndex])) + m.Expression = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6334,7 +4609,7 @@ func (m *NamedResourcesStringSlice) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error { +func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6357,17 +4632,17 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSchedulingContext: wiretype end group for non-group") + return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSchedulingContext: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6377,28 +4652,27 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6425,40 +4699,10 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF + if m.Basic == nil { + m.Basic = &BasicDevice{} } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6483,7 +4727,7 @@ func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error { +func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6506,17 +4750,17 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSchedulingContextList: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceAllocationConfiguration: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSchedulingContextList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceAllocationConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6526,28 +4770,59 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Source = AllocationConfigSource(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6574,8 +4849,7 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, PodSchedulingContext{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6600,7 +4874,7 @@ func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error { +func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6623,17 +4897,17 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSchedulingContextSpec: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceAllocationResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSchedulingContextSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SelectedNode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6643,29 +4917,31 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.SelectedNode = string(dAtA[iNdEx:postIndex]) + m.Results = append(m.Results, DeviceRequestAllocationResult{}) + if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PotentialNodes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6675,23 +4951,25 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.PotentialNodes = append(m.PotentialNodes, string(dAtA[iNdEx:postIndex])) + m.Config = append(m.Config, DeviceAllocationConfiguration{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -6714,7 +4992,7 @@ func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error { +func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6737,17 +5015,17 @@ func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSchedulingContextStatus: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceAttribute: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSchedulingContextStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceAttribute: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType) } - var msglen int + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6757,81 +5035,17 @@ func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceClaims = append(m.ResourceClaims, ResourceClaimSchedulingStatus{}) - if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResourceClaim) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResourceClaim: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + m.IntValue = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6841,30 +5055,18 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: + b := bool(v != 0) + m.BoolValue = &b + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6874,30 +5076,30 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := string(dAtA[iNdEx:postIndex]) + m.StringValue = &s iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VersionValue", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6907,24 +5109,24 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := string(dAtA[iNdEx:postIndex]) + m.VersionValue = &s iNdEx = postIndex default: iNdEx = preIndex @@ -6947,7 +5149,7 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { +func (m *DeviceClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6970,17 +5172,17 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimConsumerReference: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClaim: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimConsumerReference: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClaim: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6990,61 +5192,31 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.APIGroup = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF + m.Requests = append(m.Requests, DeviceRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Resource = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7054,29 +5226,31 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Constraints = append(m.Constraints, DeviceConstraint{}) + if err := m.Constraints[len(m.Constraints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7086,23 +5260,25 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) + m.Config = append(m.Config, DeviceClaimConfiguration{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -7125,7 +5301,7 @@ func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimList) Unmarshal(dAtA []byte) error { +func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7148,17 +5324,17 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimList: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClaimConfiguration: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClaimConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7168,28 +5344,27 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7216,8 +5391,7 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, ResourceClaim{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7242,7 +5416,7 @@ func (m *ResourceClaimList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error { +func (m *DeviceClass) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7265,10 +5439,10 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimParameters: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClass: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimParameters: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClass: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7306,7 +5480,7 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GeneratedFrom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7333,36 +5507,63 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.GeneratedFrom == nil { - m.GeneratedFrom = &ResourceClaimParametersReference{} - } - if err := m.GeneratedFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shareable", wireType) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated } - m.Shareable = bool(v != 0) - case 4: + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceClassConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceClassConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceClassConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverRequests", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7389,8 +5590,7 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DriverRequests = append(m.DriverRequests, DriverRequests{}) - if err := m.DriverRequests[len(m.DriverRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7415,7 +5615,7 @@ func (m *ResourceClaimParameters) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error { +func (m *DeviceClassList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7438,10 +5638,10 @@ func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimParametersList: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClassList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimParametersList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClassList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7506,7 +5706,7 @@ func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, ResourceClaimParameters{}) + m.Items = append(m.Items, DeviceClass{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -7532,7 +5732,7 @@ func (m *ResourceClaimParametersList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error { +func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7555,17 +5755,17 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimParametersReference: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClassSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimParametersReference: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClassSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7575,29 +5775,31 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.APIGroup = string(dAtA[iNdEx:postIndex]) + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7607,29 +5809,117 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = append(m.Config, DeviceClassConfiguration{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SuitableNodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SuitableNodes == nil { + m.SuitableNodes = &v1.NodeSelector{} + } + if err := m.SuitableNodes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7639,23 +5929,27 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.Opaque == nil { + m.Opaque = &OpaqueDeviceConfiguration{} + } + if err := m.Opaque.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -7678,7 +5972,7 @@ func (m *ResourceClaimParametersReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error { +func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7701,15 +5995,15 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimSchedulingStatus: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceConstraint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimSchedulingStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceConstraint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7737,11 +6031,11 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnsuitableNodes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MatchAttribute", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7769,7 +6063,8 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UnsuitableNodes = append(m.UnsuitableNodes, string(dAtA[iNdEx:postIndex])) + s := FullyQualifiedName(dAtA[iNdEx:postIndex]) + m.MatchAttribute = &s iNdEx = postIndex default: iNdEx = preIndex @@ -7792,7 +6087,7 @@ func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { +func (m *DeviceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7815,15 +6110,15 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimSpec: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClassName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7851,11 +6146,43 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ResourceClassName = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParametersRef", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7882,16 +6209,14 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ParametersRef == nil { - m.ParametersRef = &ResourceClaimParametersReference{} - } - if err := m.ParametersRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CountMode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7919,8 +6244,47 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllocationMode = AllocationMode(dAtA[iNdEx:postIndex]) + m.CountMode = DeviceCountMode(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminAccess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AdminAccess = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7942,7 +6306,7 @@ func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { +func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7965,15 +6329,15 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimStatus: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceRequestAllocationResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceRequestAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8001,13 +6365,13 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DriverName = string(dAtA[iNdEx:postIndex]) + m.Request = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allocation", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8017,33 +6381,61 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Allocation == nil { - m.Allocation = &AllocationResult{} + m.Driver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) } - if err := m.Allocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pool = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReservedFor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8053,31 +6445,79 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.ReservedFor = append(m.ReservedFor, ResourceClaimConsumerReference{}) - if err := m.ReservedFor[len(m.ReservedFor)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Device = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DeallocationRequested", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated } - var v int + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CEL", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8087,12 +6527,28 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.DeallocationRequested = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CEL == nil { + m.CEL = &CELDeviceSelector{} + } + if err := m.CEL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -8114,7 +6570,7 @@ func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error { +func (m *OpaqueDeviceConfiguration) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8137,17 +6593,17 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimTemplate: wiretype end group for non-group") + return fmt.Errorf("proto: OpaqueDeviceConfiguration: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OpaqueDeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8157,28 +6613,27 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Driver = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8205,7 +6660,7 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8230,7 +6685,7 @@ func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error { +func (m *PodSchedulingContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8253,15 +6708,15 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimTemplateList: wiretype end group for non-group") + return fmt.Errorf("proto: PodSchedulingContext: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimTemplateList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSchedulingContext: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8288,13 +6743,13 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8321,8 +6776,40 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, ResourceClaimTemplate{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8347,7 +6834,7 @@ func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error { +func (m *PodSchedulingContextList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8370,15 +6857,15 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClaimTemplateSpec: wiretype end group for non-group") + return fmt.Errorf("proto: PodSchedulingContextList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClaimTemplateSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSchedulingContextList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8405,13 +6892,13 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8438,7 +6925,8 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, PodSchedulingContext{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8463,7 +6951,7 @@ func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClass) Unmarshal(dAtA []byte) error { +func (m *PodSchedulingContextSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8486,17 +6974,17 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClass: wiretype end group for non-group") + return fmt.Errorf("proto: PodSchedulingContextSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClass: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSchedulingContextSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SelectedNode", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8506,28 +6994,27 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SelectedNode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PotentialNodes", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8555,47 +7042,61 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DriverName = string(dAtA[iNdEx:postIndex]) + m.PotentialNodes = append(m.PotentialNodes, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParametersRef", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.ParametersRef == nil { - m.ParametersRef = &ResourceClassParametersReference{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSchedulingContextStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - if err := m.ParametersRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 4: + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSchedulingContextStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSchedulingContextStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SuitableNodes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8622,34 +7123,11 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SuitableNodes == nil { - m.SuitableNodes = &v1.NodeSelector{} - } - if err := m.SuitableNodes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ResourceClaims = append(m.ResourceClaims, ResourceClaimSchedulingStatus{}) + if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StructuredParameters", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.StructuredParameters = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -8671,7 +7149,7 @@ func (m *ResourceClass) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClassList) Unmarshal(dAtA []byte) error { +func (m *ResourceClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8694,15 +7172,15 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClassList: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaim: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClassList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8729,13 +7207,13 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8762,8 +7240,40 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, ResourceClass{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8788,7 +7298,7 @@ func (m *ResourceClassList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimConsumerReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8811,17 +7321,17 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClassParameters: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimConsumerReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClassParameters: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimConsumerReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8831,30 +7341,29 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.APIGroup = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GeneratedFrom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8864,33 +7373,29 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.GeneratedFrom == nil { - m.GeneratedFrom = &ResourceClassParametersReference{} - } - if err := m.GeneratedFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Resource = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VendorParameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8900,31 +7405,29 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.VendorParameters = append(m.VendorParameters, VendorParameters{}) - if err := m.VendorParameters[len(m.VendorParameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8934,25 +7437,23 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Filters = append(m.Filters, ResourceFilter{}) - if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8975,7 +7476,7 @@ func (m *ResourceClassParameters) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8998,10 +7499,10 @@ func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClassParametersList: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClassParametersList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -9066,7 +7567,7 @@ func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, ResourceClassParameters{}) + m.Items = append(m.Items, ResourceClaim{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -9092,7 +7593,7 @@ func (m *ResourceClassParametersList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimSchedulingStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9115,77 +7616,13 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceClassParametersReference: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimSchedulingStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceClassParametersReference: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimSchedulingStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.APIGroup = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -9217,9 +7654,9 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnsuitableNodes", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9247,7 +7684,7 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Namespace = string(dAtA[iNdEx:postIndex]) + m.UnsuitableNodes = append(m.UnsuitableNodes, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -9270,7 +7707,7 @@ func (m *ResourceClassParametersReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceFilter) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9293,17 +7730,17 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceFilter: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceFilter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9313,29 +7750,30 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.DriverName = string(dAtA[iNdEx:postIndex]) + if err := m.Devices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceFilterModel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9345,24 +7783,23 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ResourceFilterModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -9385,7 +7822,7 @@ func (m *ResourceFilter) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9408,15 +7845,15 @@ func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceFilterModel: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceFilterModel: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allocation", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9443,13 +7880,67 @@ func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NamedResources == nil { - m.NamedResources = &NamedResourcesFilter{} + if m.Allocation == nil { + m.Allocation = &AllocationResult{} + } + if err := m.Allocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReservedFor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF } - if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ReservedFor = append(m.ReservedFor, ResourceClaimConsumerReference{}) + if err := m.ReservedFor[len(m.ReservedFor)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeallocationRequested", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeallocationRequested = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9471,7 +7962,7 @@ func (m *ResourceFilterModel) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceHandle) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimTemplate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9494,49 +7985,17 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceHandle: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimTemplate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceHandle: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimTemplate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DriverName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9546,27 +8005,28 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = string(dAtA[iNdEx:postIndex]) + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StructuredData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9593,10 +8053,7 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StructuredData == nil { - m.StructuredData = &StructuredResourceHandle{} - } - if err := m.StructuredData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9621,7 +8078,7 @@ func (m *ResourceHandle) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceModel) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimTemplateList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9644,15 +8101,15 @@ func (m *ResourceModel) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceModel: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimTemplateList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceModel: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimTemplateList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9679,10 +8136,41 @@ func (m *ResourceModel) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NamedResources == nil { - m.NamedResources = &NamedResourcesResources{} + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF } - if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, ResourceClaimTemplate{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9707,7 +8195,7 @@ func (m *ResourceModel) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceRequest) Unmarshal(dAtA []byte) error { +func (m *ResourceClaimTemplateSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9730,15 +8218,15 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceClaimTemplateSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceClaimTemplateSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VendorParameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9765,13 +8253,13 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.VendorParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceRequestModel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9798,7 +8286,7 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ResourceRequestModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9823,7 +8311,7 @@ func (m *ResourceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceRequestModel) Unmarshal(dAtA []byte) error { +func (m *ResourcePool) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9846,17 +8334,17 @@ func (m *ResourceRequestModel) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceRequestModel: wiretype end group for non-group") + return fmt.Errorf("proto: ResourcePool: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceRequestModel: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourcePool: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamedResources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9866,28 +8354,62 @@ func (m *ResourceRequestModel) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.NamedResources == nil { - m.NamedResources = &NamedResourcesRequest{} + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Generation", wireType) } - if err := m.NamedResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Generation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Generation |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceSliceCount", wireType) + } + m.ResourceSliceCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResourceSliceCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9973,71 +8495,7 @@ func (m *ResourceSlice) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NodeName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DriverName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceModel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10064,7 +8522,7 @@ func (m *ResourceSlice) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ResourceModel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -10206,7 +8664,7 @@ func (m *ResourceSliceList) Unmarshal(dAtA []byte) error { } return nil } -func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error { +func (m *ResourceSliceSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10229,17 +8687,17 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: StructuredResourceHandle: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceSliceSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: StructuredResourceHandle: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceSliceSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VendorClassParameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -10249,28 +8707,27 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.VendorClassParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Driver = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VendorClaimParameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10297,11 +8754,11 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.VendorClaimParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) } @@ -10333,9 +8790,9 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error { } m.NodeName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10362,66 +8819,18 @@ func (m *StructuredResourceHandle) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Results = append(m.Results, DriverAllocationResult{}) - if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.NodeSelector == nil { + m.NodeSelector = &v1.NodeSelector{} } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { + if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VendorParameters) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VendorParameters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VendorParameters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllNodes", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -10431,27 +8840,15 @@ func (m *VendorParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DriverName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + m.AllNodes = bool(v != 0) + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10478,7 +8875,8 @@ func (m *VendorParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Devices = append(m.Devices, Device{}) + if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/staging/src/k8s.io/api/resource/v1alpha3/generated.proto b/staging/src/k8s.io/api/resource/v1alpha3/generated.proto new file mode 100644 index 0000000000000..ee632358bfd5d --- /dev/null +++ b/staging/src/k8s.io/api/resource/v1alpha3/generated.proto @@ -0,0 +1,900 @@ +/* +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. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package k8s.io.api.resource.v1alpha3; + +import "k8s.io/api/core/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; +import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "k8s.io/api/resource/v1alpha3"; + +// AllocationResult contains attributes of an allocated resource. +message AllocationResult { + // Devices is the result of allocating devices. + // + // +optional + optional DeviceAllocationResult devices = 1; + + // NodeSelector defines where the allocated resources are available. If + // unset, they are available everywhere. + // + // +optional + optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 3; + + // Controller is the name of the DRA driver which handled the + // allocation. That driver is also responsible for deallocating the + // claim. It is empty when the claim can be deallocated without + // involving a driver. + // + // A driver may allocate devices provided by other drivers, so this + // driver name here can be different from the driver names listed for + // the results. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + optional string controller = 4; +} + +// BasicDevice defines one device instance using fields that are supported +// by all clients which support DRA. +message BasicDevice { + // Attributes defines the set of attributes for this device. + // The name of each attribute must be unique in that set. + // + // The maximum number of attributes and capacities combined is 32. + // + // +optional + map attributes = 1; + + // Capacity defines the set of capacities for this device. + // The name of each capacity must be unique in that set. + // + // The maximum number of attributes and capacities combined is 32. + // + // +optional + map capacity = 2; +} + +// CELDeviceSelector contains a CEL expression for selecting a device. +message CELDeviceSelector { + // Expression is a CEL expression which evaluates a single device. It + // must evaluate to true when the device under consideration satisfies + // the desired criteria, and false when it does not. Any other result + // is an error and causes allocation of devices to abort. + // + // The expression's input is an object named "device", which carries + // the following properties: + // - driver (string): the name of the driver which defines this device. + // - attributes (map[string]object): the device's attributes, grouped by prefix + // (e.g. device.attributes["dra.example.com"] evaluates to an object with all + // of the attributes which were prefixed by "dra.example.com". + // - capacity (map[string]object): the device's capacities, grouped by prefix. + // + // Example: Consider a device with driver="dra.example.com", which exposes + // two attributes named "model" and "ext.example.com/family" and which + // exposes one capacity named "modules". This input to this expression + // would have the following fields: + // + // device.driver + // device.attributes["dra.example.com"].model + // device.attributes["ext.example.com"].family + // device.capacity["dra.example.com"].modules + // + // The device.driver field can be used to check for a specific driver, + // either as a high-level precondition (i.e. you only want to consider + // devices from this driver) or as part of a multi-clause expression + // that is meant to consider devices from different drivers. + // + // The value type of each attribute is defined by the device + // definition, and users who write these expressions must consult the + // documentation for their specific drivers. The value type of each + // capacity is Quantity. + // + // If an unknown prefix is used as a lookup in either device.attributes + // or device.capacity, an empty map will be returned. Any reference to + // an unknown field will cause an evaluation error and allocation to + // abort. + // + // A robust expression should check for the existence of attributes + // before referencing them. + // + // For ease of use, the cel.bind() function is enabled, and can be used + // to simplify expressions that access multiple attributes with the + // same domain. For example: + // + // cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool) + // + // +required + optional string expression = 1; +} + +// 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 { + // Name is unique identifier among all devices managed by + // the driver in the pool. It must be a DNS label. + // + // +required + optional string name = 1; + + // Basic defines one device instance using fields that are supported + // by all clients which support DRA. + // + // +optional + // +oneOf=deviceType + optional BasicDevice basic = 2; +} + +// DeviceAllocationConfiguration gets embedded in an AllocationResult. +message DeviceAllocationConfiguration { + // Source records whether the configuration comes from a class and thus + // is not something that a normal user would have been able to set + // or from a claim. + // + // +required + optional string source = 1; + + // Requests lists the names of requests where the configuration applies. + // If empty, its applies to all requests. + // + // +optional + // +listType=atomic + repeated string requests = 2; + + optional DeviceConfiguration deviceConfiguration = 3; +} + +// DeviceAllocationResult is the result of allocating devices. +message DeviceAllocationResult { + // Results lists all allocated devices. + // + // +optional + // +listType=atomic + repeated DeviceRequestAllocationResult results = 1; + + // This field is a combination of all the claim and class configuration parameters. + // Drivers can distinguish between those based on a flag. + // + // This includes configuration parameters for drivers which have no allocated + // devices in the result because it is up to the drivers which configuration + // parameters they support. They can silently ignore unknown configuration + // parameters. + // + // +optional + // +listType=atomic + repeated DeviceAllocationConfiguration config = 2; +} + +// DeviceAttribute must have exactly one field set. +message DeviceAttribute { + // IntValue is a number. + // + // +optional + optional int64 int = 2; + + // BoolValue is a true/false value. + // + // +optional + optional bool bool = 3; + + // StringValue is a string. Must not be longer than 64 characters. + // + // +optional + optional string string = 4; + + // VersionValue is a semantic version according to semver.org spec 2.0.0. + // Must not be longer than 64 characters. + // + // +optional + optional string version = 5; +} + +// DeviceClaim defines how to request devices with a ResourceClaim. +message DeviceClaim { + // Requests represent individual requests for distinct devices which + // must all be satisfied. If empty, nothing needs to be allocated. + // + // +optional + // +listType=atomic + repeated DeviceRequest requests = 1; + + // These constraints must be satisfied by the set of devices that get + // allocated for the claim. + // + // +optional + // +listType=atomic + repeated DeviceConstraint constraints = 2; + + // This field holds configuration for multiple potential drivers which + // could satisfy requests in this claim. It is ignored while allocating + // the claim. + // + // +optional + // +listType=atomic + repeated DeviceClaimConfiguration config = 3; +} + +// DeviceClaimConfiguration is used for configuration parameters in DeviceClaim. +message DeviceClaimConfiguration { + // Requests lists the names of requests where the configuration applies. + // If empty, it applies to all requests. + // + // +optional + // +listType=atomic + repeated string requests = 1; + + optional DeviceConfiguration deviceConfiguration = 2; +} + +// DeviceClass is a vendor or admin-provided resource that contains +// device configuration and selectors. It can be referenced in +// the device requests of a claim to apply these presets. +// Cluster scoped. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +message DeviceClass { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Spec defines what can be allocated and how to configure it. + // + // This is mutable. Consumers have to be prepared for classes changing + // at any time, either because they get updated or replaced. Claim + // allocations are done once based on whatever was set in classes at + // the time of allocation. + // + // Changing the spec automatically increments the metadata.generation number. + optional DeviceClassSpec spec = 2; +} + +// DeviceClassConfiguration is used in DeviceClass. +message DeviceClassConfiguration { + optional DeviceConfiguration deviceConfiguration = 1; +} + +// DeviceClassList is a collection of classes. +message DeviceClassList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of resource classes. + repeated DeviceClass items = 2; +} + +// DeviceClassSpec is used in a [DeviceClass] to define what can be allocated +// and how to configure it. +message DeviceClassSpec { + // Each selector must be satisfied by a device which is claimed via this class. + // + // +optional + // +listType=atomic + repeated DeviceSelector selectors = 1; + + // Config defines configuration parameters that apply to each device that is claimed via this class. + // Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor + // configuration applies to exactly one driver. + // + // They are passed to the driver, but are not considered while allocating the claim. + // + // +optional + // +listType=atomic + repeated DeviceClassConfiguration config = 2; + + // Only nodes matching the selector will be considered by the scheduler + // when trying to find a Node that fits a Pod when that Pod uses + // a claim that has not been allocated yet *and* that claim + // gets allocated through a control plane controller. It is ignored + // when the claim does not use a control plane controller + // for allocation. + // + // Setting this field is optional. If unset, all Nodes are candidates. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + optional .k8s.io.api.core.v1.NodeSelector suitableNodes = 3; +} + +// DeviceConfiguration must have exactly one field set. It gets embedded +// inline in some other structs which have other fields, so field names must +// not conflict with those. +message DeviceConfiguration { + // Opaque provides driver-specific configuration parameters. + // + // +optional + optional OpaqueDeviceConfiguration opaque = 1; +} + +// DeviceConstraint must have exactly one field set besides Requests. +message DeviceConstraint { + // Requests is a list of the one or more requests in this claim which + // must co-satisfy this constraint. If a request is fulfilled by + // multiple devices, then all of the devices must satisfy the + // constraint. If this is not specified, this constraint applies to all + // requests in this claim. + // + // +optional + // +listType=atomic + repeated string requests = 1; + + // MatchAttribute requires that all devices in question have this + // attribute and that its type and value are the same across those + // devices. + // + // For example, if you specified "dra.example.com/numa" (a hypothetical example!), + // then only devices in the same NUMA node will be chosen. A device which + // does not have that attribute will not be chosen. All devices should + // use a value of the same type for this attribute because that is part of + // its specification, but if one device doesn't, then it also will not be + // chosen. + // + // Must include the domain qualifier. + // + // +optional + optional string matchAttribute = 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. +// +// A DeviceClassName is currently required. Clients must check that it is +// indeed set. It's absence indicates that something changed in a way that +// is not supported by the client yet, in which case it must refuse to +// handle the request. +message DeviceRequest { + // Name can be used to reference this request in a pod.spec.containers[].resources.claims + // entry and in a constraint of the claim. + // + // Must be a DNS label. + // + // +required + optional string name = 1; + + // DeviceClassName references a specific DeviceClass, which can define + // additional configuration and selectors to be inherited by this + // request. + // + // A class is required. Which classes are available depends on the cluster. + // + // Administrators may use this to restrict which devices may get + // requested by only installing classes with selectors for permitted + // devices. If users are free to request anything without restrictions, + // then administrators can create an empty DeviceClass for users + // to reference. + // + // +required + optional string deviceClassName = 2; + + // Selectors define criteria which must be satisfied by a specific + // device in order for that device to be considered for this + // request. All selectors must be satisfied for a device to be + // considered. + // + // +optional + // +listType=atomic + repeated DeviceSelector selectors = 3; + + // CountMode and its related fields define how many devices are needed + // to satisfy this request. Supported values are: + // + // - Exact: This request is for a specific number of devices. + // This is the default. The exact number is provided in the + // count field. + // + // - All: This request is for all of the matching devices in a pool. + // Allocation will fail if some devices are already allocated, + // unless adminAccess is requested. + // + // If countMode is not specified, the default countMode is Exact. If + // countMode is Exact and count is not specified, the default count is + // one. Any other requests must specify this field. + // + // More modes may get added in the future. Clients must refuse to handle + // requests with unknown modes. + // + // +optional + optional string countMode = 4; + + // Count is used only when the count mode is "Exact". Must be greater than zero. + // If CountMode is Exact and this field is not specified, the default is one. + // + // +optional + optional int64 count = 5; + + // AdminAccess indicates that this is a claim for administrative access + // to the device(s). Claims with AdminAccess are expected to be used for + // monitoring or other management services for a device. They ignore + // all ordinary claims to the device with respect to access modes and + // any resource allocations. + // + // +optional + // +default=false + optional bool adminAccess = 6; +} + +// DeviceRequestAllocationResult contains the allocation result for one request. +message DeviceRequestAllocationResult { + // Request is the name of the request in the claim which caused this + // device to be allocated. Multiple devices may have been allocated + // per request. + // + // +required + optional string request = 1; + + // Driver specifies the name of the DRA driver whose kubelet + // plugin should be invoked to process the allocation once the claim is + // needed on a node. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // +required + optional string driver = 2; + + // This name together with the driver name and the device name field + // identify which device was allocated (`//`). + // + // Must not be longer than 253 characters and may contain one or more + // DNS sub-domains separated by slashes. + // + // +required + optional string pool = 3; + + // Device references one device instance via its name in the driver's + // resource pool. It must be a DNS label. + // + // +required + optional string device = 4; +} + +// DeviceSelector must have exactly one field set. +message DeviceSelector { + // CEL contains a CEL expression for selecting a device. + // + // +required + optional CELDeviceSelector cel = 1; +} + +// OpaqueDeviceConfiguration contains configuration parameters for a driver +// in a format defined by the driver vendor. +message OpaqueDeviceConfiguration { + // Driver is used to determine which kubelet plugin needs + // to be passed these configuration parameters. + // + // An admission policy provided by the driver developer could use this + // to decide whether it needs to validate them. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // +required + optional string driver = 1; + + // Parameters can contain arbitrary data. It is the responsibility of + // the driver developer to handle validation and versioning. Typically this + // includes self-identification and a version ("kind" + "apiVersion" for + // Kubernetes types), with conversion between different versions. + // + // +required + optional .k8s.io.apimachinery.pkg.runtime.RawExtension parameters = 2; +} + +// PodSchedulingContext objects hold information that is needed to schedule +// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation +// mode. +// +// This is an alpha type and requires enabling the DRAControlPlaneController +// feature gate. +message PodSchedulingContext { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Spec describes where resources for the Pod are needed. + optional PodSchedulingContextSpec spec = 2; + + // Status describes where resources for the Pod can be allocated. + // + // +optional + optional PodSchedulingContextStatus status = 3; +} + +// PodSchedulingContextList is a collection of Pod scheduling objects. +message PodSchedulingContextList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of PodSchedulingContext objects. + repeated PodSchedulingContext items = 2; +} + +// PodSchedulingContextSpec describes where resources for the Pod are needed. +message PodSchedulingContextSpec { + // SelectedNode is the node for which allocation of ResourceClaims that + // are referenced by the Pod and that use "WaitForFirstConsumer" + // allocation is to be attempted. + // + // +optional + optional string selectedNode = 1; + + // PotentialNodes lists nodes where the Pod might be able to run. + // + // The size of this field is limited to 128. This is large enough for + // many clusters. Larger clusters may need more attempts to find a node + // that suits all pending resources. This may get increased in the + // future, but not reduced. + // + // +optional + // +listType=atomic + repeated string potentialNodes = 2; +} + +// PodSchedulingContextStatus describes where resources for the Pod can be allocated. +message PodSchedulingContextStatus { + // ResourceClaims describes resource availability for each + // pod.spec.resourceClaim entry where the corresponding ResourceClaim + // uses "WaitForFirstConsumer" allocation mode. + // + // +listType=map + // +listMapKey=name + // +optional + repeated ResourceClaimSchedulingStatus resourceClaims = 1; +} + +// ResourceClaim describes a request for access to resources in the cluster, +// for use by workloads. For example, if a workload needs an accelerator device +// with specific properties, this is how that request is expressed. The status +// stanza tracks whether this claim has been satisfied and what specific +// resources have been allocated. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +message ResourceClaim { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Spec describes what is being requested and how to configure it. + // The spec is immutable. + optional ResourceClaimSpec spec = 2; + + // Status describes whether the claim is ready to use and what has been allocated. + // +optional + optional ResourceClaimStatus status = 3; +} + +// ResourceClaimConsumerReference contains enough information to let you +// locate the consumer of a ResourceClaim. The user must be a resource in the same +// namespace as the ResourceClaim. +message ResourceClaimConsumerReference { + // APIGroup is the group for the resource being referenced. It is + // empty for the core API. This matches the group in the APIVersion + // that is used when creating the resources. + // +optional + optional string apiGroup = 1; + + // Resource is the type of resource being referenced, for example "pods". + // +required + optional string resource = 3; + + // Name is the name of resource being referenced. + // +required + optional string name = 4; + + // UID identifies exactly one incarnation of the resource. + // +required + optional string uid = 5; +} + +// ResourceClaimList is a collection of claims. +message ResourceClaimList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of resource claims. + repeated ResourceClaim items = 2; +} + +// ResourceClaimSchedulingStatus contains information about one particular +// ResourceClaim with "WaitForFirstConsumer" allocation mode. +message ResourceClaimSchedulingStatus { + // Name matches the pod.spec.resourceClaims[*].Name field. + // + // +required + optional string name = 1; + + // UnsuitableNodes lists nodes that the ResourceClaim cannot be + // allocated for. + // + // The size of this field is limited to 128, the same as for + // PodSchedulingSpec.PotentialNodes. This may get increased in the + // future, but not reduced. + // + // +optional + // +listType=atomic + repeated string unsuitableNodes = 2; +} + +// ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it. +message ResourceClaimSpec { + // Devices defines how to request devices. + // + // +optional + optional DeviceClaim devices = 1; + + // Controller is the name of the DRA driver that is meant + // to handle allocation of this claim. If empty, allocation is handled + // by the scheduler while scheduling a pod. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + optional string controller = 2; +} + +// ResourceClaimStatus tracks whether the resource has been allocated and what +// the result of that was. +message ResourceClaimStatus { + // Allocation is set once the claim has been allocated successfully. + // + // +optional + optional AllocationResult allocation = 1; + + // ReservedFor indicates which entities are currently allowed to use + // the claim. A Pod which references a ResourceClaim which is not + // reserved for that Pod will not be started. A claim that is in + // use or might be in use because it has been reserved must not get + // deallocated. + // + // In a cluster with multiple scheduler instances, two pods might get + // scheduled concurrently by different schedulers. When they reference + // the same ResourceClaim which already has reached its maximum number + // of consumers, only one pod can be scheduled. + // + // Both schedulers try to add their pod to the claim.status.reservedFor + // field, but only the update that reaches the API server first gets + // stored. The other one fails with an error and the scheduler + // which issued it knows that it must put the pod back into the queue, + // waiting for the ResourceClaim to become usable again. + // + // There can be at most 32 such reservations. This may get increased in + // the future, but not reduced. + // + // +optional + // +listType=map + // +listMapKey=uid + // +patchStrategy=merge + // +patchMergeKey=uid + repeated ResourceClaimConsumerReference reservedFor = 2; + + // Indicates that a claim is to be deallocated. While this is set, + // no new consumers may be added to ReservedFor. + // + // This is only used if the claim needs to be deallocated by a DRA driver. + // That driver then must deallocate this claim and reset the field + // together with clearing the Allocation field. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + optional bool deallocationRequested = 3; +} + +// ResourceClaimTemplate is used to produce ResourceClaim objects. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +message ResourceClaimTemplate { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Describes the ResourceClaim that is to be generated. + // + // This field is immutable. A ResourceClaim will get created by the + // control plane for a Pod when needed and then not get updated + // anymore. + optional ResourceClaimTemplateSpec spec = 2; +} + +// ResourceClaimTemplateList is a collection of claim templates. +message ResourceClaimTemplateList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of resource claim templates. + repeated ResourceClaimTemplate items = 2; +} + +// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. +message ResourceClaimTemplateSpec { + // ObjectMeta may contain labels and annotations that will be copied into the PVC + // when creating it. No other fields are allowed and will be rejected during + // validation. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Spec for the ResourceClaim. The entire content is copied unchanged + // into the ResourceClaim that gets created from this template. The + // same fields as in a ResourceClaim are also valid here. + optional ResourceClaimSpec spec = 2; +} + +// ResourcePool describes the pool that ResourceSlices belong to. +message ResourcePool { + // Name is used to identify the pool. For node-local devices, this + // is often the node name, but this is not required. + // + // It must not be longer than 253 characters and must consist of one or more DNS sub-domains + // separated by slashes. + // + // +required + optional string name = 1; + + // Generation tracks the change in a pool over time. Whenever a driver + // changes something about one or more of the resources in a pool, it + // must change the generation in all ResourceSlices which are part of + // that pool. Consumers of ResourceSlices should only consider + // resources from the pool with the highest generation number. The + // generation may be reset by drivers, which should be fine for + // consumers, assuming that all ResourceSlices in a pool are updated to + // match or deleted. + // + // Combined with ResourceSliceCount, this mechanism enables consumers to + // detect pools which are comprised of multiple ResourceSlices and are + // in an incomplete state. + // + // +required + optional int64 generation = 2; + + // ResourceSliceCount is the total number of ResourceSlices in the pool at this + // generation number. Must be higher than zero. + // + // Consumers can use this to check whether they have seen all ResourceSlices + // belonging to the same pool. + // + // +required + optional int64 resourceSliceCount = 3; +} + +// ResourceSlice represents one or more resources in a pool of similar resources, +// managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many +// ResourceSlices comprise a pool is determined by the driver. +// +// At the moment, the only supported resources are devices with attributes and capacities. +// Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. +// The ResourceSlice in which a device gets published may change over time. The unique identifier +// for a device is the tuple , , . +// +// Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number +// and updates all ResourceSlices with that new number and new resource definitions. A consumer +// must only use ResourceSlices with the highest generation number and ignore all others. +// +// When allocating all resources in a pool matching certain criteria or when +// looking for the best solution among several different alternatives, a +// consumer should check the number of ResourceSlices in a pool (included in +// each ResourceSlice) to determine whether its view of a pool is complete and +// if not, should wait until the driver has completed updating the pool. +// +// For resources that are not local to a node, the node name is not set. Instead, +// the driver may use a node selector to specify where the devices are available. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +message ResourceSlice { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Contains the information published by the driver. + // + // Changing the spec automatically increments the metadata.generation number. + optional ResourceSliceSpec spec = 2; +} + +// ResourceSliceList is a collection of ResourceSlices. +message ResourceSliceList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta listMeta = 1; + + // Items is the list of resource ResourceSlices. + repeated ResourceSlice items = 2; +} + +// ResourceSliceSpec contains the information published by the driver in one ResourceSlice. +message ResourceSliceSpec { + // 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. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. This field is immutable. + // + // +required + optional string driver = 1; + + // Pool describes the pool that this ResourceSlice belongs to. + // This field is immutable. + // + // +required + optional ResourcePool pool = 2; + + // 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. + // + // This 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. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // This field is immutable. + // + // +optional + // +oneOf=NodeSelection + optional string nodeName = 3; + + // NodeSelector defines which nodes have access to the resources in the pool. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // + // +optional + // +oneOf=NodeSelection + optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 4; + + // AllNodes indicates that all nodes have access to the resources in the pool. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // + // +optional + // +oneOf=NodeSelection + optional bool allNodes = 5; + + // Devices lists some or all of the devices in this pool. + // + // Must not have more than 128 entries. + // + // +optional + // +listType=atomic + repeated Device devices = 6; +} + diff --git a/staging/src/k8s.io/api/resource/v1alpha2/register.go b/staging/src/k8s.io/api/resource/v1alpha3/register.go similarity index 90% rename from staging/src/k8s.io/api/resource/v1alpha2/register.go rename to staging/src/k8s.io/api/resource/v1alpha3/register.go index 893fb4c1e52d8..daca14cec1572 100644 --- a/staging/src/k8s.io/api/resource/v1alpha2/register.go +++ b/staging/src/k8s.io/api/resource/v1alpha3/register.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,7 +26,7 @@ import ( const GroupName = "resource.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { @@ -44,8 +44,8 @@ var ( // Adds the list of known types to the given scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &ResourceClass{}, - &ResourceClassList{}, + &DeviceClass{}, + &DeviceClassList{}, &ResourceClaim{}, &ResourceClaimList{}, &ResourceClaimTemplate{}, @@ -54,10 +54,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &PodSchedulingContextList{}, &ResourceSlice{}, &ResourceSliceList{}, - &ResourceClaimParameters{}, - &ResourceClaimParametersList{}, - &ResourceClassParameters{}, - &ResourceClassParametersList{}, ) // Add common types diff --git a/staging/src/k8s.io/api/resource/v1alpha3/types.go b/staging/src/k8s.io/api/resource/v1alpha3/types.go new file mode 100644 index 0000000000000..29b17af8921d8 --- /dev/null +++ b/staging/src/k8s.io/api/resource/v1alpha3/types.go @@ -0,0 +1,1036 @@ +/* +Copyright 2022 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. +*/ + +package v1alpha3 + +import ( + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/validation" +) + +const ( + // Finalizer is the finalizer that gets set for claims + // which were allocated through a builtin controller. + // Reserved for use by Kubernetes, DRA driver controllers must + // use their own finalizer. + Finalizer = "resource.kubernetes.io/delete-protection" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.31 + +// ResourceSlice represents one or more resources in a pool of similar resources, +// managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many +// ResourceSlices comprise a pool is determined by the driver. +// +// At the moment, the only supported resources are devices with attributes and capacities. +// Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. +// The ResourceSlice in which a device gets published may change over time. The unique identifier +// for a device is the tuple , , . +// +// Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number +// and updates all ResourceSlices with that new number and new resource definitions. A consumer +// must only use ResourceSlices with the highest generation number and ignore all others. +// +// When allocating all resources in a pool matching certain criteria or when +// looking for the best solution among several different alternatives, a +// consumer should check the number of ResourceSlices in a pool (included in +// each ResourceSlice) to determine whether its view of a pool is complete and +// if not, should wait until the driver has completed updating the pool. +// +// For resources that are not local to a node, the node name is not set. Instead, +// the driver may use a node selector to specify where the devices are available. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +type ResourceSlice struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Contains the information published by the driver. + // + // Changing the spec automatically increments the metadata.generation number. + Spec ResourceSliceSpec `json:"spec" protobuf:"bytes,2,name=spec"` +} + +const ( + // ResourceSliceSelectorNodeName can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.NodeName]. + ResourceSliceSelectorNodeName = "spec.nodeName" + // ResourceSliceSelectorDriver can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.Driver]. + ResourceSliceSelectorDriver = "spec.driver" +) + +// ResourceSliceSpec contains the information published by the driver in one ResourceSlice. +type ResourceSliceSpec struct { + // 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. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. This field is immutable. + // + // +required + Driver string `json:"driver" protobuf:"bytes,1,name=driver"` + + // Pool describes the pool that this ResourceSlice belongs to. + // This field is immutable. + // + // +required + Pool ResourcePool `json:"pool" protobuf:"bytes,2,name=pool"` + + // 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. + // + // This 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. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // This field is immutable. + // + // +optional + // +oneOf=NodeSelection + NodeName string `json:"nodeName,omitempty" protobuf:"bytes,3,opt,name=nodeName"` + + // NodeSelector defines which nodes have access to the resources in the pool. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // + // +optional + // +oneOf=NodeSelection + NodeSelector *v1.NodeSelector `json:"nodeSelector,omitempty" protobuf:"bytes,4,opt,name=nodeSelector"` + + // AllNodes indicates that all nodes have access to the resources in the pool. + // + // Exactly one of NodeName, NodeSelector and AllNodes must be set. + // + // +optional + // +oneOf=NodeSelection + AllNodes bool `json:"allNodes,omitempty" protobuf:"bytes,5,opt,name=allNodes"` + + // Devices lists some or all of the devices in this pool. + // + // Must not have more than 128 entries. + // + // +optional + // +listType=atomic + Devices []Device `json:"devices" protobuf:"bytes,6,name=devices"` +} + +// ResourcePool describes the pool that ResourceSlices belong to. +type ResourcePool struct { + // Name is used to identify the pool. For node-local devices, this + // is often the node name, but this is not required. + // + // It must not be longer than 253 characters and must consist of one or more DNS sub-domains + // separated by slashes. + // + // +required + Name string `json:"name" protobuf:"bytes,1,name=name"` + + // Generation tracks the change in a pool over time. Whenever a driver + // changes something about one or more of the resources in a pool, it + // must change the generation in all ResourceSlices which are part of + // that pool. Consumers of ResourceSlices should only consider + // resources from the pool with the highest generation number. The + // generation may be reset by drivers, which should be fine for + // consumers, assuming that all ResourceSlices in a pool are updated to + // match or deleted. + // + // Combined with ResourceSliceCount, this mechanism enables consumers to + // detect pools which are comprised of multiple ResourceSlices and are + // in an incomplete state. + // + // +required + Generation int64 `json:"generation" protobuf:"bytes,2,name=generation"` + + // ResourceSliceCount is the total number of ResourceSlices in the pool at this + // generation number. Must be higher than zero. + // + // Consumers can use this to check whether they have seen all ResourceSlices + // belonging to the same pool. + // + // +required + ResourceSliceCount int64 `json:"resourceSliceCount" protobuf:"bytes,3,name=resourceSliceCount"` +} + +const ResourceSliceMaxSharedCapacity = 128 +const ResourceSliceMaxDevices = 128 +const PoolNameMaxLength = validation.DNS1123SubdomainMaxLength // Same as for a single node name. + +// Device represents one individual hardware instance that can be selected based +// on its attributes. Besides the name, exactly one field must be set. +type Device struct { + // Name is unique identifier among all devices managed by + // the driver in the pool. It must be a DNS label. + // + // +required + Name string `json:"name" protobuf:"bytes,1,name=name"` + + // Basic defines one device instance using fields that are supported + // by all clients which support DRA. + // + // +optional + // +oneOf=deviceType + Basic *BasicDevice `json:"basic,omitempty" protobuf:"bytes,2,opt,name=basic"` +} + +// BasicDevice defines one device instance using fields that are supported +// by all clients which support DRA. +type BasicDevice struct { + // Attributes defines the set of attributes for this device. + // The name of each attribute must be unique in that set. + // + // The maximum number of attributes and capacities combined is 32. + // + // +optional + Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,1,rep,name=attributes"` + + // Capacity defines the set of capacities for this device. + // The name of each capacity must be unique in that set. + // + // The maximum number of attributes and capacities combined is 32. + // + // +optional + Capacity map[QualifiedName]resource.Quantity `json:"capacity,omitempty" protobuf:"bytes,2,rep,name=capacity"` +} + +// Limit for the sum of the number of entries in both ResourceSlices. +const ResourceSliceMaxAttributesAndCapacitiesPerDevice = 32 + +// QualifiedName is the name of a device attribute or capacity. +// +// Attributes and capacities are defined either by the owner of the specific +// driver (usually the vendor) or by some 3rd party (e.g. the Kubernetes +// project). Because they are sometimes compared across devices, a given name +// is expected to mean the same thing and have the same type on all devices. +// +// Names must be either a C identifier (e.g. "theName") or a DNS subdomain +// followed by a slash ("/") followed by a C identifier +// (e.g. "dra.example.com/theName"). Names which do not include the +// domain prefix are assumed to be part of the driver's domain. Attributes +// or capacities defined by 3rd parties must include the domain prefix. +// +// The maximum length for the DNS subdomain is 63 characters (same as +// for driver names) and the maximum length of the C identifier +// is 32. +type QualifiedName string + +// FullyQualifiedName is a QualifiedName where the domain is set. +type FullyQualifiedName string + +// DeviceMaxIDLength is the maximum length of the identifier in a device attribute or capacity name (`/`). +const DeviceMaxIDLength = 32 + +// DeviceAttribute must have exactly one field set. +type DeviceAttribute struct { + // The Go field names below have a Value suffix to avoid a conflict between the + // field "String" and the corresponding method. That method is required. + // The Kubernetes API is defined without that suffix to keep it more natural. + + // IntValue is a number. + // + // +optional + IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"` + + // BoolValue is a true/false value. + // + // +optional + BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"` + + // StringValue is a string. Must not be longer than 64 characters. + // + // +optional + StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"` + + // VersionValue is a semantic version according to semver.org spec 2.0.0. + // Must not be longer than 64 characters. + // + // +optional + VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"` +} + +// DeviceAttributeMaxValueLength is the maximum length of a string or version attribute value. +const DeviceAttributeMaxValueLength = 64 + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.31 + +// ResourceSliceList is a collection of ResourceSlices. +type ResourceSliceList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // +optional + metav1.ListMeta `json:"listMeta" protobuf:"bytes,1,opt,name=listMeta"` + + // Items is the list of resource ResourceSlices. + Items []ResourceSlice `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// ResourceClaim describes a request for access to resources in the cluster, +// for use by workloads. For example, if a workload needs an accelerator device +// with specific properties, this is how that request is expressed. The status +// stanza tracks whether this claim has been satisfied and what specific +// resources have been allocated. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +type ResourceClaim struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec describes what is being requested and how to configure it. + // The spec is immutable. + Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` + + // Status describes whether the claim is ready to use and what has been allocated. + // +optional + Status ResourceClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it. +type ResourceClaimSpec struct { + // Devices defines how to request devices. + // + // +optional + Devices DeviceClaim `json:"devices" protobuf:"bytes,1,name=devices"` + + // Controller is the name of the DRA driver that is meant + // to handle allocation of this claim. If empty, allocation is handled + // by the scheduler while scheduling a pod. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + Controller string `json:"controller,omitempty" protobuf:"bytes,2,opt,name=controller"` +} + +// DeviceClaim defines how to request devices with a ResourceClaim. +type DeviceClaim struct { + // Requests represent individual requests for distinct devices which + // must all be satisfied. If empty, nothing needs to be allocated. + // + // +optional + // +listType=atomic + Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"` + + // These constraints must be satisfied by the set of devices that get + // allocated for the claim. + // + // +optional + // +listType=atomic + Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"` + + // This field holds configuration for multiple potential drivers which + // could satisfy requests in this claim. It is ignored while allocating + // the claim. + // + // +optional + // +listType=atomic + Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"` +} + +const ( + DeviceRequestsMaxSize = AllocationResultsMaxSize + DeviceConstraintsMaxSize = 32 + DeviceConfigMaxSize = 32 +) + +// 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. +// +// A DeviceClassName is currently required. Clients must check that it is +// indeed set. It's absence indicates that something changed in a way that +// is not supported by the client yet, in which case it must refuse to +// handle the request. +type DeviceRequest struct { + // Name can be used to reference this request in a pod.spec.containers[].resources.claims + // entry and in a constraint of the claim. + // + // Must be a DNS label. + // + // +required + Name string `json:"name" protobuf:"bytes,1,name=name"` + + // DeviceClassName references a specific DeviceClass, which can define + // additional configuration and selectors to be inherited by this + // request. + // + // A class is required. Which classes are available depends on the cluster. + // + // Administrators may use this to restrict which devices may get + // requested by only installing classes with selectors for permitted + // devices. If users are free to request anything without restrictions, + // then administrators can create an empty DeviceClass for users + // to reference. + // + // +required + DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"` + + // Selectors define criteria which must be satisfied by a specific + // device in order for that device to be considered for this + // request. All selectors must be satisfied for a device to be + // considered. + // + // +optional + // +listType=atomic + Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"` + + // CountMode and its related fields define how many devices are needed + // to satisfy this request. Supported values are: + // + // - Exact: This request is for a specific number of devices. + // This is the default. The exact number is provided in the + // count field. + // + // - All: This request is for all of the matching devices in a pool. + // Allocation will fail if some devices are already allocated, + // unless adminAccess is requested. + // + // If countMode is not specified, the default countMode is Exact. If + // countMode is Exact and count is not specified, the default count is + // one. Any other requests must specify this field. + // + // More modes may get added in the future. Clients must refuse to handle + // requests with unknown modes. + // + // +optional + CountMode DeviceCountMode `json:"countMode,omitempty" protobuf:"bytes,4,opt,name=countMode"` + + // Count is used only when the count mode is "Exact". Must be greater than zero. + // If CountMode is Exact and this field is not specified, the default is one. + // + // +optional + Count int64 `json:"count,omitempty" protobuf:"bytes,5,opt,name=count"` + + // AdminAccess indicates that this is a claim for administrative access + // to the device(s). Claims with AdminAccess are expected to be used for + // monitoring or other management services for a device. They ignore + // all ordinary claims to the device with respect to access modes and + // any resource allocations. + // + // +optional + // +default=false + AdminAccess bool `json:"adminAccess,omitempty" protobuf:"bytes,6,opt,name=adminAccess"` +} + +const ( + DeviceSelectorsMaxSize = 32 +) + +type DeviceCountMode string + +// Valid [DeviceRequest.CountMode] values. +const ( + DeviceCountModeExact = DeviceCountMode("Exact") + DeviceCountModeAll = DeviceCountMode("All") +) + +// DeviceSelector must have exactly one field set. +type DeviceSelector struct { + // CEL contains a CEL expression for selecting a device. + // + // +required + CEL *CELDeviceSelector `json:"cel,omitempty" protobuf:"bytes,1,opt,name=cel"` +} + +// CELDeviceSelector contains a CEL expression for selecting a device. +type CELDeviceSelector struct { + // Expression is a CEL expression which evaluates a single device. It + // must evaluate to true when the device under consideration satisfies + // the desired criteria, and false when it does not. Any other result + // is an error and causes allocation of devices to abort. + // + // The expression's input is an object named "device", which carries + // the following properties: + // - driver (string): the name of the driver which defines this device. + // - attributes (map[string]object): the device's attributes, grouped by prefix + // (e.g. device.attributes["dra.example.com"] evaluates to an object with all + // of the attributes which were prefixed by "dra.example.com". + // - capacity (map[string]object): the device's capacities, grouped by prefix. + // + // Example: Consider a device with driver="dra.example.com", which exposes + // two attributes named "model" and "ext.example.com/family" and which + // exposes one capacity named "modules". This input to this expression + // would have the following fields: + // + // device.driver + // device.attributes["dra.example.com"].model + // device.attributes["ext.example.com"].family + // device.capacity["dra.example.com"].modules + // + // The device.driver field can be used to check for a specific driver, + // either as a high-level precondition (i.e. you only want to consider + // devices from this driver) or as part of a multi-clause expression + // that is meant to consider devices from different drivers. + // + // The value type of each attribute is defined by the device + // definition, and users who write these expressions must consult the + // documentation for their specific drivers. The value type of each + // capacity is Quantity. + // + // If an unknown prefix is used as a lookup in either device.attributes + // or device.capacity, an empty map will be returned. Any reference to + // an unknown field will cause an evaluation error and allocation to + // abort. + // + // A robust expression should check for the existence of attributes + // before referencing them. + // + // For ease of use, the cel.bind() function is enabled, and can be used + // to simplify expressions that access multiple attributes with the + // same domain. For example: + // + // cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool) + // + // +required + Expression string `json:"expression" protobuf:"bytes,1,name=expression"` +} + +// DeviceConstraint must have exactly one field set besides Requests. +type DeviceConstraint struct { + // Requests is a list of the one or more requests in this claim which + // must co-satisfy this constraint. If a request is fulfilled by + // multiple devices, then all of the devices must satisfy the + // constraint. If this is not specified, this constraint applies to all + // requests in this claim. + // + // +optional + // +listType=atomic + Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` + + // MatchAttribute requires that all devices in question have this + // attribute and that its type and value are the same across those + // devices. + // + // For example, if you specified "dra.example.com/numa" (a hypothetical example!), + // then only devices in the same NUMA node will be chosen. A device which + // does not have that attribute will not be chosen. All devices should + // use a value of the same type for this attribute because that is part of + // its specification, but if one device doesn't, then it also will not be + // chosen. + // + // Must include the domain qualifier. + // + // +optional + MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"` +} + +// DeviceClaimConfiguration is used for configuration parameters in DeviceClaim. +type DeviceClaimConfiguration struct { + // Requests lists the names of requests where the configuration applies. + // If empty, it applies to all requests. + // + // +optional + // +listType=atomic + Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` + + DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"` +} + +// DeviceConfiguration must have exactly one field set. It gets embedded +// inline in some other structs which have other fields, so field names must +// not conflict with those. +type DeviceConfiguration struct { + // Opaque provides driver-specific configuration parameters. + // + // +optional + Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"` +} + +// OpaqueDeviceConfiguration contains configuration parameters for a driver +// in a format defined by the driver vendor. +type OpaqueDeviceConfiguration struct { + // Driver is used to determine which kubelet plugin needs + // to be passed these configuration parameters. + // + // An admission policy provided by the driver developer could use this + // to decide whether it needs to validate them. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // +required + Driver string `json:"driver" protobuf:"bytes,1,name=driver"` + + // Parameters can contain arbitrary data. It is the responsibility of + // the driver developer to handle validation and versioning. Typically this + // includes self-identification and a version ("kind" + "apiVersion" for + // Kubernetes types), with conversion between different versions. + // + // +required + Parameters runtime.RawExtension `json:"parameters" protobuf:"bytes,2,name=parameters"` +} + +// ResourceClaimStatus tracks whether the resource has been allocated and what +// the result of that was. +type ResourceClaimStatus struct { + // Allocation is set once the claim has been allocated successfully. + // + // +optional + Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"` + + // ReservedFor indicates which entities are currently allowed to use + // the claim. A Pod which references a ResourceClaim which is not + // reserved for that Pod will not be started. A claim that is in + // use or might be in use because it has been reserved must not get + // deallocated. + // + // In a cluster with multiple scheduler instances, two pods might get + // scheduled concurrently by different schedulers. When they reference + // the same ResourceClaim which already has reached its maximum number + // of consumers, only one pod can be scheduled. + // + // Both schedulers try to add their pod to the claim.status.reservedFor + // field, but only the update that reaches the API server first gets + // stored. The other one fails with an error and the scheduler + // which issued it knows that it must put the pod back into the queue, + // waiting for the ResourceClaim to become usable again. + // + // There can be at most 32 such reservations. This may get increased in + // the future, but not reduced. + // + // +optional + // +listType=map + // +listMapKey=uid + // +patchStrategy=merge + // +patchMergeKey=uid + ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"` + + // Indicates that a claim is to be deallocated. While this is set, + // no new consumers may be added to ReservedFor. + // + // This is only used if the claim needs to be deallocated by a DRA driver. + // That driver then must deallocate this claim and reset the field + // together with clearing the Allocation field. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + DeallocationRequested bool `json:"deallocationRequested,omitempty" protobuf:"bytes,3,opt,name=deallocationRequested"` +} + +// ReservedForMaxSize is the maximum number of entries in +// claim.status.reservedFor. +const ResourceClaimReservedForMaxSize = 32 + +// ResourceClaimConsumerReference contains enough information to let you +// locate the consumer of a ResourceClaim. The user must be a resource in the same +// namespace as the ResourceClaim. +type ResourceClaimConsumerReference struct { + // APIGroup is the group for the resource being referenced. It is + // empty for the core API. This matches the group in the APIVersion + // that is used when creating the resources. + // +optional + APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` + // Resource is the type of resource being referenced, for example "pods". + // +required + Resource string `json:"resource" protobuf:"bytes,3,name=resource"` + // Name is the name of resource being referenced. + // +required + Name string `json:"name" protobuf:"bytes,4,name=name"` + // UID identifies exactly one incarnation of the resource. + // +required + UID types.UID `json:"uid" protobuf:"bytes,5,name=uid"` +} + +// AllocationResult contains attributes of an allocated resource. +type AllocationResult struct { + // Devices is the result of allocating devices. + // + // +optional + Devices DeviceAllocationResult `json:"devices,omitempty" protobuf:"bytes,1,opt,name=devices"` + + // NodeSelector defines where the allocated resources are available. If + // unset, they are available everywhere. + // + // +optional + NodeSelector *v1.NodeSelector `json:"nodeSelector,omitempty" protobuf:"bytes,3,opt,name=nodeSelector"` + + // Controller is the name of the DRA driver which handled the + // allocation. That driver is also responsible for deallocating the + // claim. It is empty when the claim can be deallocated without + // involving a driver. + // + // A driver may allocate devices provided by other drivers, so this + // driver name here can be different from the driver names listed for + // the results. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + Controller string `json:"controller,omitempty" protobuf:"bytes,4,opt,name=controller"` +} + +// DeviceAllocationResult is the result of allocating devices. +type DeviceAllocationResult struct { + // Results lists all allocated devices. + // + // +optional + // +listType=atomic + Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"` + + // This field is a combination of all the claim and class configuration parameters. + // Drivers can distinguish between those based on a flag. + // + // This includes configuration parameters for drivers which have no allocated + // devices in the result because it is up to the drivers which configuration + // parameters they support. They can silently ignore unknown configuration + // parameters. + // + // +optional + // +listType=atomic + Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` +} + +// AllocationResultsMaxSize represents the maximum number of +// entries in allocation.devices.results. +const AllocationResultsMaxSize = 32 + +// DeviceRequestAllocationResult contains the allocation result for one request. +type DeviceRequestAllocationResult struct { + // Request is the name of the request in the claim which caused this + // device to be allocated. Multiple devices may have been allocated + // per request. + // + // +required + Request string `json:"request" protobuf:"bytes,1,name=request"` + + // Driver specifies the name of the DRA driver whose kubelet + // plugin should be invoked to process the allocation once the claim is + // needed on a node. + // + // Must be a DNS subdomain and should end with a DNS domain owned by the + // vendor of the driver. + // + // +required + Driver string `json:"driver" protobuf:"bytes,2,name=driver"` + + // This name together with the driver name and the device name field + // identify which device was allocated (`//`). + // + // Must not be longer than 253 characters and may contain one or more + // DNS sub-domains separated by slashes. + // + // +required + Pool string `json:"pool" protobuf:"bytes,3,name=pool"` + + // Device references one device instance via its name in the driver's + // resource pool. It must be a DNS label. + // + // +required + Device string `json:"device" protobuf:"bytes,4,name=device"` +} + +// DeviceAllocationConfiguration gets embedded in an AllocationResult. +type DeviceAllocationConfiguration struct { + // Source records whether the configuration comes from a class and thus + // is not something that a normal user would have been able to set + // or from a claim. + // + // +required + Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"` + + // Requests lists the names of requests where the configuration applies. + // If empty, its applies to all requests. + // + // +optional + // +listType=atomic + Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"` + + DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"` +} + +type AllocationConfigSource string + +// Valid [DeviceAllocationConfiguration.Source] values. +const ( + AllocationConfigSourceClass = "FromClass" + AllocationConfigSourceClaim = "FromClaim" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// ResourceClaimList is a collection of claims. +type ResourceClaimList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of resource claims. + Items []ResourceClaim `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// PodSchedulingContext objects hold information that is needed to schedule +// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation +// mode. +// +// This is an alpha type and requires enabling the DRAControlPlaneController +// feature gate. +type PodSchedulingContext struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec describes where resources for the Pod are needed. + Spec PodSchedulingContextSpec `json:"spec" protobuf:"bytes,2,name=spec"` + + // Status describes where resources for the Pod can be allocated. + // + // +optional + Status PodSchedulingContextStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// PodSchedulingContextSpec describes where resources for the Pod are needed. +type PodSchedulingContextSpec struct { + // SelectedNode is the node for which allocation of ResourceClaims that + // are referenced by the Pod and that use "WaitForFirstConsumer" + // allocation is to be attempted. + // + // +optional + SelectedNode string `json:"selectedNode,omitempty" protobuf:"bytes,1,opt,name=selectedNode"` + + // PotentialNodes lists nodes where the Pod might be able to run. + // + // The size of this field is limited to 128. This is large enough for + // many clusters. Larger clusters may need more attempts to find a node + // that suits all pending resources. This may get increased in the + // future, but not reduced. + // + // +optional + // +listType=atomic + PotentialNodes []string `json:"potentialNodes,omitempty" protobuf:"bytes,2,opt,name=potentialNodes"` +} + +// PodSchedulingContextStatus describes where resources for the Pod can be allocated. +type PodSchedulingContextStatus struct { + // ResourceClaims describes resource availability for each + // pod.spec.resourceClaim entry where the corresponding ResourceClaim + // uses "WaitForFirstConsumer" allocation mode. + // + // +listType=map + // +listMapKey=name + // +optional + ResourceClaims []ResourceClaimSchedulingStatus `json:"resourceClaims,omitempty" protobuf:"bytes,1,opt,name=resourceClaims"` + + // If there ever is a need to support other kinds of resources + // than ResourceClaim, then new fields could get added here + // for those other resources. +} + +// ResourceClaimSchedulingStatus contains information about one particular +// ResourceClaim with "WaitForFirstConsumer" allocation mode. +type ResourceClaimSchedulingStatus struct { + // Name matches the pod.spec.resourceClaims[*].Name field. + // + // +required + Name string `json:"name" protobuf:"bytes,1,name=name"` + + // UnsuitableNodes lists nodes that the ResourceClaim cannot be + // allocated for. + // + // The size of this field is limited to 128, the same as for + // PodSchedulingSpec.PotentialNodes. This may get increased in the + // future, but not reduced. + // + // +optional + // +listType=atomic + UnsuitableNodes []string `json:"unsuitableNodes,omitempty" protobuf:"bytes,2,opt,name=unsuitableNodes"` +} + +// PodSchedulingNodeListMaxSize defines the maximum number of entries in the +// node lists that are stored in PodSchedulingContext objects. This limit is part +// of the API. +const PodSchedulingNodeListMaxSize = 128 + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// PodSchedulingContextList is a collection of Pod scheduling objects. +type PodSchedulingContextList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of PodSchedulingContext objects. + Items []PodSchedulingContext `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.31 + +// DeviceClass is a vendor or admin-provided resource that contains +// device configuration and selectors. It can be referenced in +// the device requests of a claim to apply these presets. +// Cluster scoped. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +type DeviceClass struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines what can be allocated and how to configure it. + // + // This is mutable. Consumers have to be prepared for classes changing + // at any time, either because they get updated or replaced. Claim + // allocations are done once based on whatever was set in classes at + // the time of allocation. + // + // Changing the spec automatically increments the metadata.generation number. + Spec DeviceClassSpec `json:"spec" protobuf:"bytes,2,name=spec"` +} + +// DeviceClassSpec is used in a [DeviceClass] to define what can be allocated +// and how to configure it. +type DeviceClassSpec struct { + // Each selector must be satisfied by a device which is claimed via this class. + // + // +optional + // +listType=atomic + Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"` + + // Config defines configuration parameters that apply to each device that is claimed via this class. + // Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor + // configuration applies to exactly one driver. + // + // They are passed to the driver, but are not considered while allocating the claim. + // + // +optional + // +listType=atomic + Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` + + // Only nodes matching the selector will be considered by the scheduler + // when trying to find a Node that fits a Pod when that Pod uses + // a claim that has not been allocated yet *and* that claim + // gets allocated through a control plane controller. It is ignored + // when the claim does not use a control plane controller + // for allocation. + // + // Setting this field is optional. If unset, all Nodes are candidates. + // + // This is an alpha field and requires enabling the DRAControlPlaneController + // feature gate. + // + // +optional + SuitableNodes *v1.NodeSelector `json:"suitableNodes,omitempty" protobuf:"bytes,3,opt,name=suitableNodes"` +} + +// DeviceClassConfiguration is used in DeviceClass. +type DeviceClassConfiguration struct { + DeviceConfiguration `json:",inline" protobuf:"bytes,1,opt,name=deviceConfiguration"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// DeviceClassList is a collection of classes. +type DeviceClassList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of resource classes. + Items []DeviceClass `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// ResourceClaimTemplate is used to produce ResourceClaim objects. +// +// This is an alpha type and requires enabling the DynamicResourceAllocation +// feature gate. +type ResourceClaimTemplate struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Describes the ResourceClaim that is to be generated. + // + // This field is immutable. A ResourceClaim will get created by the + // control plane for a Pod when needed and then not get updated + // anymore. + Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"` +} + +// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim. +type ResourceClaimTemplateSpec struct { + // ObjectMeta may contain labels and annotations that will be copied into the PVC + // when creating it. No other fields are allowed and will be rejected during + // validation. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec for the ResourceClaim. The entire content is copied unchanged + // into the ResourceClaim that gets created from this template. The + // same fields as in a ResourceClaim are also valid here. + Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.26 + +// ResourceClaimTemplateList is a collection of claim templates. +type ResourceClaimTemplateList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of resource claim templates. + Items []ResourceClaimTemplate `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/staging/src/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go b/staging/src/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go new file mode 100644 index 0000000000000..059caa3f86e7e --- /dev/null +++ b/staging/src/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go @@ -0,0 +1,404 @@ +/* +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. +*/ + +package v1alpha3 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-codegen.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_AllocationResult = map[string]string{ + "": "AllocationResult contains attributes of an allocated resource.", + "devices": "Devices is the result of allocating devices.", + "nodeSelector": "NodeSelector defines where the allocated resources are available. If unset, they are available everywhere.", + "controller": "Controller is the name of the DRA driver which handled the allocation. That driver is also responsible for deallocating the claim. It is empty when the claim can be deallocated without involving a driver.\n\nA driver may allocate devices provided by other drivers, so this driver name here can be different from the driver names listed for the results.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", +} + +func (AllocationResult) SwaggerDoc() map[string]string { + return map_AllocationResult +} + +var map_BasicDevice = map[string]string{ + "": "BasicDevice defines one device instance using fields that are supported by all clients which support DRA.", + "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.", +} + +func (BasicDevice) SwaggerDoc() map[string]string { + return map_BasicDevice +} + +var map_CELDeviceSelector = map[string]string{ + "": "CELDeviceSelector contains a CEL expression for selecting a device.", + "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)", +} + +func (CELDeviceSelector) SwaggerDoc() map[string]string { + return map_CELDeviceSelector +} + +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.", + "basic": "Basic defines one device instance using fields that are supported by all clients which support DRA.", +} + +func (Device) SwaggerDoc() map[string]string { + return map_Device +} + +var map_DeviceAllocationConfiguration = map[string]string{ + "": "DeviceAllocationConfiguration gets embedded in an AllocationResult.", + "source": "Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim.", + "requests": "Requests lists the names of requests where the configuration applies. If empty, its applies to all requests.", +} + +func (DeviceAllocationConfiguration) SwaggerDoc() map[string]string { + return map_DeviceAllocationConfiguration +} + +var map_DeviceAllocationResult = map[string]string{ + "": "DeviceAllocationResult is the result of allocating devices.", + "results": "Results lists all allocated devices.", + "config": "This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag.\n\nThis includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters.", +} + +func (DeviceAllocationResult) SwaggerDoc() map[string]string { + return map_DeviceAllocationResult +} + +var map_DeviceAttribute = map[string]string{ + "": "DeviceAttribute must have exactly one field set.", + "int": "IntValue is a number.", + "bool": "BoolValue is a true/false value.", + "string": "StringValue is a string. Must not be longer than 64 characters.", + "version": "VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.", +} + +func (DeviceAttribute) SwaggerDoc() map[string]string { + return map_DeviceAttribute +} + +var map_DeviceClaim = map[string]string{ + "": "DeviceClaim defines how to request devices with a ResourceClaim.", + "requests": "Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated.", + "constraints": "These constraints must be satisfied by the set of devices that get allocated for the claim.", + "config": "This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim.", +} + +func (DeviceClaim) SwaggerDoc() map[string]string { + return map_DeviceClaim +} + +var map_DeviceClaimConfiguration = map[string]string{ + "": "DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.", + "requests": "Requests lists the names of requests where the configuration applies. If empty, it applies to all requests.", +} + +func (DeviceClaimConfiguration) SwaggerDoc() map[string]string { + return map_DeviceClaimConfiguration +} + +var map_DeviceClass = map[string]string{ + "": "DeviceClass is a vendor or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "metadata": "Standard object metadata", + "spec": "Spec defines what can be allocated and how to configure it.\n\nThis is mutable. Consumers have to be prepared for classes changing at any time, either because they get updated or replaced. Claim allocations are done once based on whatever was set in classes at the time of allocation.\n\nChanging the spec automatically increments the metadata.generation number.", +} + +func (DeviceClass) SwaggerDoc() map[string]string { + return map_DeviceClass +} + +var map_DeviceClassConfiguration = map[string]string{ + "": "DeviceClassConfiguration is used in DeviceClass.", +} + +func (DeviceClassConfiguration) SwaggerDoc() map[string]string { + return map_DeviceClassConfiguration +} + +var map_DeviceClassList = map[string]string{ + "": "DeviceClassList is a collection of classes.", + "metadata": "Standard list metadata", + "items": "Items is the list of resource classes.", +} + +func (DeviceClassList) SwaggerDoc() map[string]string { + return map_DeviceClassList +} + +var map_DeviceClassSpec = map[string]string{ + "": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.", + "selectors": "Each selector must be satisfied by a device which is claimed via this class.", + "config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", + "suitableNodes": "Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a claim that has not been allocated yet *and* that claim gets allocated through a control plane controller. It is ignored when the claim does not use a control plane controller for allocation.\n\nSetting this field is optional. If unset, all Nodes are candidates.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", +} + +func (DeviceClassSpec) SwaggerDoc() map[string]string { + return map_DeviceClassSpec +} + +var map_DeviceConfiguration = map[string]string{ + "": "DeviceConfiguration must have exactly one field set. It gets embedded inline in some other structs which have other fields, so field names must not conflict with those.", + "opaque": "Opaque provides driver-specific configuration parameters.", +} + +func (DeviceConfiguration) SwaggerDoc() map[string]string { + return map_DeviceConfiguration +} + +var map_DeviceConstraint = map[string]string{ + "": "DeviceConstraint must have exactly one field set besides Requests.", + "requests": "Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim.", + "matchAttribute": "MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices.\n\nFor example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen.\n\nMust include the domain qualifier.", +} + +func (DeviceConstraint) SwaggerDoc() map[string]string { + return map_DeviceConstraint +} + +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.\n\nA DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request.", + "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.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", + "countMode": "CountMode and its related fields define how many devices are needed to satisfy this request. Supported values are:\n\n- Exact: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf countMode is not specified, the default countMode is Exact. If countMode is Exact and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"Exact\". Must be greater than zero. If CountMode is Exact and this field is not specified, the default is one.", + "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.", +} + +func (DeviceRequest) SwaggerDoc() map[string]string { + return map_DeviceRequest +} + +var map_DeviceRequestAllocationResult = map[string]string{ + "": "DeviceRequestAllocationResult contains the allocation result for one request.", + "request": "Request is the name of the request in the claim which caused this device to be allocated. Multiple devices may have been allocated per request.", + "driver": "Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "pool": "This name together with the driver name and the device name field identify which device was allocated (`//`).\n\nMust not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes.", + "device": "Device references one device instance via its name in the driver's resource pool. It must be a DNS label.", +} + +func (DeviceRequestAllocationResult) SwaggerDoc() map[string]string { + return map_DeviceRequestAllocationResult +} + +var map_DeviceSelector = map[string]string{ + "": "DeviceSelector must have exactly one field set.", + "cel": "CEL contains a CEL expression for selecting a device.", +} + +func (DeviceSelector) SwaggerDoc() map[string]string { + return map_DeviceSelector +} + +var map_OpaqueDeviceConfiguration = map[string]string{ + "": "OpaqueDeviceConfiguration contains configuration parameters for a driver in a format defined by the driver vendor.", + "driver": "Driver is used to determine which kubelet plugin needs to be passed these configuration parameters.\n\nAn admission policy provided by the driver developer could use this to decide whether it needs to validate them.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.", + "parameters": "Parameters can contain arbitrary data. It is the responsibility of the driver developer to handle validation and versioning. Typically this includes self-identification and a version (\"kind\" + \"apiVersion\" for Kubernetes types), with conversion between different versions.", +} + +func (OpaqueDeviceConfiguration) SwaggerDoc() map[string]string { + return map_OpaqueDeviceConfiguration +} + +var map_PodSchedulingContext = map[string]string{ + "": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DRAControlPlaneController feature gate.", + "metadata": "Standard object metadata", + "spec": "Spec describes where resources for the Pod are needed.", + "status": "Status describes where resources for the Pod can be allocated.", +} + +func (PodSchedulingContext) SwaggerDoc() map[string]string { + return map_PodSchedulingContext +} + +var map_PodSchedulingContextList = map[string]string{ + "": "PodSchedulingContextList is a collection of Pod scheduling objects.", + "metadata": "Standard list metadata", + "items": "Items is the list of PodSchedulingContext objects.", +} + +func (PodSchedulingContextList) SwaggerDoc() map[string]string { + return map_PodSchedulingContextList +} + +var map_PodSchedulingContextSpec = map[string]string{ + "": "PodSchedulingContextSpec describes where resources for the Pod are needed.", + "selectedNode": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.", + "potentialNodes": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.", +} + +func (PodSchedulingContextSpec) SwaggerDoc() map[string]string { + return map_PodSchedulingContextSpec +} + +var map_PodSchedulingContextStatus = map[string]string{ + "": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.", + "resourceClaims": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.", +} + +func (PodSchedulingContextStatus) SwaggerDoc() map[string]string { + return map_PodSchedulingContextStatus +} + +var map_ResourceClaim = map[string]string{ + "": "ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "metadata": "Standard object metadata", + "spec": "Spec describes what is being requested and how to configure it. The spec is immutable.", + "status": "Status describes whether the claim is ready to use and what has been allocated.", +} + +func (ResourceClaim) SwaggerDoc() map[string]string { + return map_ResourceClaim +} + +var map_ResourceClaimConsumerReference = map[string]string{ + "": "ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.", + "apiGroup": "APIGroup is the group for the resource being referenced. It is empty for the core API. This matches the group in the APIVersion that is used when creating the resources.", + "resource": "Resource is the type of resource being referenced, for example \"pods\".", + "name": "Name is the name of resource being referenced.", + "uid": "UID identifies exactly one incarnation of the resource.", +} + +func (ResourceClaimConsumerReference) SwaggerDoc() map[string]string { + return map_ResourceClaimConsumerReference +} + +var map_ResourceClaimList = map[string]string{ + "": "ResourceClaimList is a collection of claims.", + "metadata": "Standard list metadata", + "items": "Items is the list of resource claims.", +} + +func (ResourceClaimList) SwaggerDoc() map[string]string { + return map_ResourceClaimList +} + +var map_ResourceClaimSchedulingStatus = map[string]string{ + "": "ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with \"WaitForFirstConsumer\" allocation mode.", + "name": "Name matches the pod.spec.resourceClaims[*].Name field.", + "unsuitableNodes": "UnsuitableNodes lists nodes that the ResourceClaim cannot be allocated for.\n\nThe size of this field is limited to 128, the same as for PodSchedulingSpec.PotentialNodes. This may get increased in the future, but not reduced.", +} + +func (ResourceClaimSchedulingStatus) SwaggerDoc() map[string]string { + return map_ResourceClaimSchedulingStatus +} + +var map_ResourceClaimSpec = map[string]string{ + "": "ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.", + "devices": "Devices defines how to request devices.", + "controller": "Controller is the name of the DRA driver that is meant to handle allocation of this claim. If empty, allocation is handled by the scheduler while scheduling a pod.\n\nMust be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", +} + +func (ResourceClaimSpec) SwaggerDoc() map[string]string { + return map_ResourceClaimSpec +} + +var map_ResourceClaimStatus = map[string]string{ + "": "ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.", + "allocation": "Allocation is set once the claim has been allocated successfully.", + "reservedFor": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.\n\nIn a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.\n\nBoth schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.", + "deallocationRequested": "Indicates that a claim is to be deallocated. While this is set, no new consumers may be added to ReservedFor.\n\nThis is only used if the claim needs to be deallocated by a DRA driver. That driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nThis is an alpha field and requires enabling the DRAControlPlaneController feature gate.", +} + +func (ResourceClaimStatus) SwaggerDoc() map[string]string { + return map_ResourceClaimStatus +} + +var map_ResourceClaimTemplate = map[string]string{ + "": "ResourceClaimTemplate is used to produce ResourceClaim objects.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "metadata": "Standard object metadata", + "spec": "Describes the ResourceClaim that is to be generated.\n\nThis field is immutable. A ResourceClaim will get created by the control plane for a Pod when needed and then not get updated anymore.", +} + +func (ResourceClaimTemplate) SwaggerDoc() map[string]string { + return map_ResourceClaimTemplate +} + +var map_ResourceClaimTemplateList = map[string]string{ + "": "ResourceClaimTemplateList is a collection of claim templates.", + "metadata": "Standard list metadata", + "items": "Items is the list of resource claim templates.", +} + +func (ResourceClaimTemplateList) SwaggerDoc() map[string]string { + return map_ResourceClaimTemplateList +} + +var map_ResourceClaimTemplateSpec = map[string]string{ + "": "ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.", + "metadata": "ObjectMeta may contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.", + "spec": "Spec for the ResourceClaim. The entire content is copied unchanged into the ResourceClaim that gets created from this template. The same fields as in a ResourceClaim are also valid here.", +} + +func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string { + return map_ResourceClaimTemplateSpec +} + +var map_ResourcePool = map[string]string{ + "": "ResourcePool describes the pool that ResourceSlices belong to.", + "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes.", + "generation": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", + "resourceSliceCount": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be higher than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", +} + +func (ResourcePool) SwaggerDoc() map[string]string { + return map_ResourcePool +} + +var map_ResourceSlice = map[string]string{ + "": "ResourceSlice represents one or more resources in a pool of similar resources, managed by a given driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.\n\nAt the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple , , .\n\nWhenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.\n\nWhen allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.\n\nFor resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.", + "metadata": "Standard object metadata", + "spec": "Contains the information published by the driver.\n\nChanging the spec automatically increments the metadata.generation number.", +} + +func (ResourceSlice) SwaggerDoc() map[string]string { + return map_ResourceSlice +} + +var map_ResourceSliceList = map[string]string{ + "": "ResourceSliceList is a collection of ResourceSlices.", + "listMeta": "Standard list metadata", + "items": "Items is the list of resource ResourceSlices.", +} + +func (ResourceSliceList) SwaggerDoc() map[string]string { + return map_ResourceSliceList +} + +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. This field is immutable.", + "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.\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.", +} + +func (ResourceSliceSpec) SwaggerDoc() map[string]string { + return map_ResourceSliceSpec +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/staging/src/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go b/staging/src/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go similarity index 60% rename from staging/src/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go rename to staging/src/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go index 52de8e1ad531c..58171df1f2db6 100644 --- a/staging/src/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go @@ -19,25 +19,20 @@ limitations under the License. // Code generated by deepcopy-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( v1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AllocationResult) DeepCopyInto(out *AllocationResult) { *out = *in - if in.ResourceHandles != nil { - in, out := &in.ResourceHandles, &out.ResourceHandles - *out = make([]ResourceHandle, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AvailableOnNodes != nil { - in, out := &in.AvailableOnNodes, &out.AvailableOnNodes + in.Devices.DeepCopyInto(&out.Devices) + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector *out = new(v1.NodeSelector) (*in).DeepCopyInto(*out) } @@ -55,134 +50,140 @@ func (in *AllocationResult) DeepCopy() *AllocationResult { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AllocationResultModel) DeepCopyInto(out *AllocationResultModel) { +func (in *BasicDevice) DeepCopyInto(out *BasicDevice) { *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesAllocationResult) - **out = **in + if in.Attributes != nil { + in, out := &in.Attributes, &out.Attributes + *out = make(map[QualifiedName]DeviceAttribute, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(map[QualifiedName]resource.Quantity, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllocationResultModel. -func (in *AllocationResultModel) DeepCopy() *AllocationResultModel { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicDevice. +func (in *BasicDevice) DeepCopy() *BasicDevice { if in == nil { return nil } - out := new(AllocationResultModel) + out := new(BasicDevice) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DriverAllocationResult) DeepCopyInto(out *DriverAllocationResult) { +func (in *CELDeviceSelector) DeepCopyInto(out *CELDeviceSelector) { *out = *in - in.VendorRequestParameters.DeepCopyInto(&out.VendorRequestParameters) - in.AllocationResultModel.DeepCopyInto(&out.AllocationResultModel) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverAllocationResult. -func (in *DriverAllocationResult) DeepCopy() *DriverAllocationResult { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CELDeviceSelector. +func (in *CELDeviceSelector) DeepCopy() *CELDeviceSelector { if in == nil { return nil } - out := new(DriverAllocationResult) + out := new(CELDeviceSelector) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DriverRequests) DeepCopyInto(out *DriverRequests) { +func (in *Device) DeepCopyInto(out *Device) { *out = *in - in.VendorParameters.DeepCopyInto(&out.VendorParameters) - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make([]ResourceRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicDevice) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverRequests. -func (in *DriverRequests) DeepCopy() *DriverRequests { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device. +func (in *Device) DeepCopy() *Device { if in == nil { return nil } - out := new(DriverRequests) + out := new(Device) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesAllocationResult) DeepCopyInto(out *NamedResourcesAllocationResult) { +func (in *DeviceAllocationConfiguration) DeepCopyInto(out *DeviceAllocationConfiguration) { *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAllocationResult. -func (in *NamedResourcesAllocationResult) DeepCopy() *NamedResourcesAllocationResult { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAllocationConfiguration. +func (in *DeviceAllocationConfiguration) DeepCopy() *DeviceAllocationConfiguration { if in == nil { return nil } - out := new(NamedResourcesAllocationResult) + out := new(DeviceAllocationConfiguration) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesAttribute) DeepCopyInto(out *NamedResourcesAttribute) { +func (in *DeviceAllocationResult) DeepCopyInto(out *DeviceAllocationResult) { *out = *in - in.NamedResourcesAttributeValue.DeepCopyInto(&out.NamedResourcesAttributeValue) + if in.Results != nil { + in, out := &in.Results, &out.Results + *out = make([]DeviceRequestAllocationResult, len(*in)) + copy(*out, *in) + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]DeviceAllocationConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAttribute. -func (in *NamedResourcesAttribute) DeepCopy() *NamedResourcesAttribute { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAllocationResult. +func (in *DeviceAllocationResult) DeepCopy() *DeviceAllocationResult { if in == nil { return nil } - out := new(NamedResourcesAttribute) + out := new(DeviceAllocationResult) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesAttributeValue) DeepCopyInto(out *NamedResourcesAttributeValue) { +func (in *DeviceAttribute) DeepCopyInto(out *DeviceAttribute) { *out = *in - if in.QuantityValue != nil { - in, out := &in.QuantityValue, &out.QuantityValue - x := (*in).DeepCopy() - *out = &x - } - if in.BoolValue != nil { - in, out := &in.BoolValue, &out.BoolValue - *out = new(bool) - **out = **in - } if in.IntValue != nil { in, out := &in.IntValue, &out.IntValue *out = new(int64) **out = **in } - if in.IntSliceValue != nil { - in, out := &in.IntSliceValue, &out.IntSliceValue - *out = new(NamedResourcesIntSlice) - (*in).DeepCopyInto(*out) + if in.BoolValue != nil { + in, out := &in.BoolValue, &out.BoolValue + *out = new(bool) + **out = **in } if in.StringValue != nil { in, out := &in.StringValue, &out.StringValue *out = new(string) **out = **in } - if in.StringSliceValue != nil { - in, out := &in.StringSliceValue, &out.StringSliceValue - *out = new(NamedResourcesStringSlice) - (*in).DeepCopyInto(*out) - } if in.VersionValue != nil { in, out := &in.VersionValue, &out.VersionValue *out = new(string) @@ -191,38 +192,127 @@ func (in *NamedResourcesAttributeValue) DeepCopyInto(out *NamedResourcesAttribut return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesAttributeValue. -func (in *NamedResourcesAttributeValue) DeepCopy() *NamedResourcesAttributeValue { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceAttribute. +func (in *DeviceAttribute) DeepCopy() *DeviceAttribute { if in == nil { return nil } - out := new(NamedResourcesAttributeValue) + out := new(DeviceAttribute) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesFilter) DeepCopyInto(out *NamedResourcesFilter) { +func (in *DeviceClaim) DeepCopyInto(out *DeviceClaim) { *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]DeviceRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Constraints != nil { + in, out := &in.Constraints, &out.Constraints + *out = make([]DeviceConstraint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]DeviceClaimConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesFilter. -func (in *NamedResourcesFilter) DeepCopy() *NamedResourcesFilter { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaim. +func (in *DeviceClaim) DeepCopy() *DeviceClaim { if in == nil { return nil } - out := new(NamedResourcesFilter) + out := new(DeviceClaim) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesInstance) DeepCopyInto(out *NamedResourcesInstance) { +func (in *DeviceClaimConfiguration) DeepCopyInto(out *DeviceClaimConfiguration) { *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make([]NamedResourcesAttribute, len(*in)) + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimConfiguration. +func (in *DeviceClaimConfiguration) DeepCopy() *DeviceClaimConfiguration { + if in == nil { + return nil + } + out := new(DeviceClaimConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClass) DeepCopyInto(out *DeviceClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClass. +func (in *DeviceClass) DeepCopy() *DeviceClass { + if in == nil { + return nil + } + out := new(DeviceClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeviceClass) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClassConfiguration) DeepCopyInto(out *DeviceClassConfiguration) { + *out = *in + in.DeviceConfiguration.DeepCopyInto(&out.DeviceConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassConfiguration. +func (in *DeviceClassConfiguration) DeepCopy() *DeviceClassConfiguration { + if in == nil { + return nil + } + out := new(DeviceClassConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClassList) DeepCopyInto(out *DeviceClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DeviceClass, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -230,59 +320,112 @@ func (in *NamedResourcesInstance) DeepCopyInto(out *NamedResourcesInstance) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesInstance. -func (in *NamedResourcesInstance) DeepCopy() *NamedResourcesInstance { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassList. +func (in *DeviceClassList) DeepCopy() *DeviceClassList { if in == nil { return nil } - out := new(NamedResourcesInstance) + out := new(DeviceClassList) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeviceClassList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesIntSlice) DeepCopyInto(out *NamedResourcesIntSlice) { +func (in *DeviceClassSpec) DeepCopyInto(out *DeviceClassSpec) { *out = *in - if in.Ints != nil { - in, out := &in.Ints, &out.Ints - *out = make([]int64, len(*in)) - copy(*out, *in) + if in.Selectors != nil { + in, out := &in.Selectors, &out.Selectors + *out = make([]DeviceSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]DeviceClassConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SuitableNodes != nil { + in, out := &in.SuitableNodes, &out.SuitableNodes + *out = new(v1.NodeSelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClassSpec. +func (in *DeviceClassSpec) DeepCopy() *DeviceClassSpec { + if in == nil { + return nil + } + out := new(DeviceClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceConfiguration) DeepCopyInto(out *DeviceConfiguration) { + *out = *in + if in.Opaque != nil { + in, out := &in.Opaque, &out.Opaque + *out = new(OpaqueDeviceConfiguration) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesIntSlice. -func (in *NamedResourcesIntSlice) DeepCopy() *NamedResourcesIntSlice { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceConfiguration. +func (in *DeviceConfiguration) DeepCopy() *DeviceConfiguration { if in == nil { return nil } - out := new(NamedResourcesIntSlice) + out := new(DeviceConfiguration) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesRequest) DeepCopyInto(out *NamedResourcesRequest) { +func (in *DeviceConstraint) DeepCopyInto(out *DeviceConstraint) { *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.MatchAttribute != nil { + in, out := &in.MatchAttribute, &out.MatchAttribute + *out = new(FullyQualifiedName) + **out = **in + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesRequest. -func (in *NamedResourcesRequest) DeepCopy() *NamedResourcesRequest { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceConstraint. +func (in *DeviceConstraint) DeepCopy() *DeviceConstraint { if in == nil { return nil } - out := new(NamedResourcesRequest) + out := new(DeviceConstraint) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesResources) DeepCopyInto(out *NamedResourcesResources) { +func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) { *out = *in - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]NamedResourcesInstance, len(*in)) + if in.Selectors != nil { + in, out := &in.Selectors, &out.Selectors + *out = make([]DeviceSelector, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -290,33 +433,66 @@ func (in *NamedResourcesResources) DeepCopyInto(out *NamedResourcesResources) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesResources. -func (in *NamedResourcesResources) DeepCopy() *NamedResourcesResources { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceRequest. +func (in *DeviceRequest) DeepCopy() *DeviceRequest { if in == nil { return nil } - out := new(NamedResourcesResources) + out := new(DeviceRequest) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedResourcesStringSlice) DeepCopyInto(out *NamedResourcesStringSlice) { +func (in *DeviceRequestAllocationResult) DeepCopyInto(out *DeviceRequestAllocationResult) { *out = *in - if in.Strings != nil { - in, out := &in.Strings, &out.Strings - *out = make([]string, len(*in)) - copy(*out, *in) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceRequestAllocationResult. +func (in *DeviceRequestAllocationResult) DeepCopy() *DeviceRequestAllocationResult { + if in == nil { + return nil + } + out := new(DeviceRequestAllocationResult) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceSelector) DeepCopyInto(out *DeviceSelector) { + *out = *in + if in.CEL != nil { + in, out := &in.CEL, &out.CEL + *out = new(CELDeviceSelector) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceSelector. +func (in *DeviceSelector) DeepCopy() *DeviceSelector { + if in == nil { + return nil } + out := new(DeviceSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpaqueDeviceConfiguration) DeepCopyInto(out *OpaqueDeviceConfiguration) { + *out = *in + in.Parameters.DeepCopyInto(&out.Parameters) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedResourcesStringSlice. -func (in *NamedResourcesStringSlice) DeepCopy() *NamedResourcesStringSlice { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpaqueDeviceConfiguration. +func (in *OpaqueDeviceConfiguration) DeepCopy() *OpaqueDeviceConfiguration { if in == nil { return nil } - out := new(NamedResourcesStringSlice) + out := new(OpaqueDeviceConfiguration) in.DeepCopyInto(out) return out } @@ -503,93 +679,6 @@ func (in *ResourceClaimList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClaimParameters) DeepCopyInto(out *ResourceClaimParameters) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.GeneratedFrom != nil { - in, out := &in.GeneratedFrom, &out.GeneratedFrom - *out = new(ResourceClaimParametersReference) - **out = **in - } - if in.DriverRequests != nil { - in, out := &in.DriverRequests, &out.DriverRequests - *out = make([]DriverRequests, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParameters. -func (in *ResourceClaimParameters) DeepCopy() *ResourceClaimParameters { - if in == nil { - return nil - } - out := new(ResourceClaimParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClaimParameters) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClaimParametersList) DeepCopyInto(out *ResourceClaimParametersList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceClaimParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersList. -func (in *ResourceClaimParametersList) DeepCopy() *ResourceClaimParametersList { - if in == nil { - return nil - } - out := new(ResourceClaimParametersList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClaimParametersList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClaimParametersReference) DeepCopyInto(out *ResourceClaimParametersReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersReference. -func (in *ResourceClaimParametersReference) DeepCopy() *ResourceClaimParametersReference { - if in == nil { - return nil - } - out := new(ResourceClaimParametersReference) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceClaimSchedulingStatus) DeepCopyInto(out *ResourceClaimSchedulingStatus) { *out = *in @@ -614,11 +703,7 @@ func (in *ResourceClaimSchedulingStatus) DeepCopy() *ResourceClaimSchedulingStat // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceClaimSpec) DeepCopyInto(out *ResourceClaimSpec) { *out = *in - if in.ParametersRef != nil { - in, out := &in.ParametersRef, &out.ParametersRef - *out = new(ResourceClaimParametersReference) - **out = **in - } + in.Devices.DeepCopyInto(&out.Devices) return } @@ -737,288 +822,17 @@ func (in *ResourceClaimTemplateSpec) DeepCopy() *ResourceClaimTemplateSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClass) DeepCopyInto(out *ResourceClass) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.ParametersRef != nil { - in, out := &in.ParametersRef, &out.ParametersRef - *out = new(ResourceClassParametersReference) - **out = **in - } - if in.SuitableNodes != nil { - in, out := &in.SuitableNodes, &out.SuitableNodes - *out = new(v1.NodeSelector) - (*in).DeepCopyInto(*out) - } - if in.StructuredParameters != nil { - in, out := &in.StructuredParameters, &out.StructuredParameters - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClass. -func (in *ResourceClass) DeepCopy() *ResourceClass { - if in == nil { - return nil - } - out := new(ResourceClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClass) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassList) DeepCopyInto(out *ResourceClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassList. -func (in *ResourceClassList) DeepCopy() *ResourceClassList { - if in == nil { - return nil - } - out := new(ResourceClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClassList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassParameters) DeepCopyInto(out *ResourceClassParameters) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.GeneratedFrom != nil { - in, out := &in.GeneratedFrom, &out.GeneratedFrom - *out = new(ResourceClassParametersReference) - **out = **in - } - if in.VendorParameters != nil { - in, out := &in.VendorParameters, &out.VendorParameters - *out = make([]VendorParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Filters != nil { - in, out := &in.Filters, &out.Filters - *out = make([]ResourceFilter, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParameters. -func (in *ResourceClassParameters) DeepCopy() *ResourceClassParameters { - if in == nil { - return nil - } - out := new(ResourceClassParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClassParameters) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassParametersList) DeepCopyInto(out *ResourceClassParametersList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceClassParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersList. -func (in *ResourceClassParametersList) DeepCopy() *ResourceClassParametersList { - if in == nil { - return nil - } - out := new(ResourceClassParametersList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceClassParametersList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceClassParametersReference) DeepCopyInto(out *ResourceClassParametersReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersReference. -func (in *ResourceClassParametersReference) DeepCopy() *ResourceClassParametersReference { - if in == nil { - return nil - } - out := new(ResourceClassParametersReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter) { - *out = *in - in.ResourceFilterModel.DeepCopyInto(&out.ResourceFilterModel) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilter. -func (in *ResourceFilter) DeepCopy() *ResourceFilter { - if in == nil { - return nil - } - out := new(ResourceFilter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceFilterModel) DeepCopyInto(out *ResourceFilterModel) { - *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesFilter) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilterModel. -func (in *ResourceFilterModel) DeepCopy() *ResourceFilterModel { - if in == nil { - return nil - } - out := new(ResourceFilterModel) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceHandle) DeepCopyInto(out *ResourceHandle) { - *out = *in - if in.StructuredData != nil { - in, out := &in.StructuredData, &out.StructuredData - *out = new(StructuredResourceHandle) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceHandle. -func (in *ResourceHandle) DeepCopy() *ResourceHandle { - if in == nil { - return nil - } - out := new(ResourceHandle) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceModel) DeepCopyInto(out *ResourceModel) { - *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesResources) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceModel. -func (in *ResourceModel) DeepCopy() *ResourceModel { - if in == nil { - return nil - } - out := new(ResourceModel) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceRequest) DeepCopyInto(out *ResourceRequest) { - *out = *in - in.VendorParameters.DeepCopyInto(&out.VendorParameters) - in.ResourceRequestModel.DeepCopyInto(&out.ResourceRequestModel) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequest. -func (in *ResourceRequest) DeepCopy() *ResourceRequest { - if in == nil { - return nil - } - out := new(ResourceRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceRequestModel) DeepCopyInto(out *ResourceRequestModel) { +func (in *ResourcePool) DeepCopyInto(out *ResourcePool) { *out = *in - if in.NamedResources != nil { - in, out := &in.NamedResources, &out.NamedResources - *out = new(NamedResourcesRequest) - **out = **in - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequestModel. -func (in *ResourceRequestModel) DeepCopy() *ResourceRequestModel { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePool. +func (in *ResourcePool) DeepCopy() *ResourcePool { if in == nil { return nil } - out := new(ResourceRequestModel) + out := new(ResourcePool) in.DeepCopyInto(out) return out } @@ -1028,7 +842,7 @@ func (in *ResourceSlice) DeepCopyInto(out *ResourceSlice) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.ResourceModel.DeepCopyInto(&out.ResourceModel) + in.Spec.DeepCopyInto(&out.Spec) return } @@ -1084,13 +898,17 @@ func (in *ResourceSliceList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StructuredResourceHandle) DeepCopyInto(out *StructuredResourceHandle) { +func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) { *out = *in - in.VendorClassParameters.DeepCopyInto(&out.VendorClassParameters) - in.VendorClaimParameters.DeepCopyInto(&out.VendorClaimParameters) - if in.Results != nil { - in, out := &in.Results, &out.Results - *out = make([]DriverAllocationResult, len(*in)) + out.Pool = in.Pool + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = new(v1.NodeSelector) + (*in).DeepCopyInto(*out) + } + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]Device, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1098,29 +916,12 @@ func (in *StructuredResourceHandle) DeepCopyInto(out *StructuredResourceHandle) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StructuredResourceHandle. -func (in *StructuredResourceHandle) DeepCopy() *StructuredResourceHandle { - if in == nil { - return nil - } - out := new(StructuredResourceHandle) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VendorParameters) DeepCopyInto(out *VendorParameters) { - *out = *in - in.Parameters.DeepCopyInto(&out.Parameters) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VendorParameters. -func (in *VendorParameters) DeepCopy() *VendorParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSliceSpec. +func (in *ResourceSliceSpec) DeepCopy() *ResourceSliceSpec { if in == nil { return nil } - out := new(VendorParameters) + out := new(ResourceSliceSpec) in.DeepCopyInto(out) return out } diff --git a/staging/src/k8s.io/api/roundtrip_test.go b/staging/src/k8s.io/api/roundtrip_test.go index 14d5e34e5b41f..6cf0a70b4c296 100644 --- a/staging/src/k8s.io/api/roundtrip_test.go +++ b/staging/src/k8s.io/api/roundtrip_test.go @@ -68,7 +68,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -134,7 +134,7 @@ var groups = []runtime.SchemeBuilder{ rbacv1alpha1.SchemeBuilder, rbacv1beta1.SchemeBuilder, rbacv1.SchemeBuilder, - resourcev1alpha2.SchemeBuilder, + resourceapi.SchemeBuilder, schedulingv1alpha1.SchemeBuilder, schedulingv1beta1.SchemeBuilder, schedulingv1.SchemeBuilder, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.json index aee557eae1909..318e92ca85c2c 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.json @@ -563,7 +563,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -858,7 +859,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1153,7 +1155,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.pb index 80799a45c7a9b..2750bd13b0d6a 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.yaml index a070feccdbaaf..976483e34c029 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.DaemonSet.yaml @@ -338,6 +338,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -553,6 +554,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -770,6 +772,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.json index 76e705a99e6aa..485e8b5c87528 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.pb index b1f069b9d149a..28c436a20eb6e 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.yaml index f69364f1d943c..8101548018c56 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.Deployment.yaml @@ -346,6 +346,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -561,6 +562,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -778,6 +780,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.json index c4f229e5a90aa..a855f5e2e5fda 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.json @@ -565,7 +565,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -860,7 +861,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1155,7 +1157,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.pb index 9dab3de969107..fec13bd9e6c76 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.yaml index 649d8f2c1a95b..f0928269a5ed5 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.ReplicaSet.yaml @@ -338,6 +338,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -553,6 +554,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -770,6 +772,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.json index caca9b7b798de..277899c436a5f 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.pb index c5455adcb1136..bb5c449454698 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.yaml index 06712f71791fb..4f6a9797d2059 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1.StatefulSet.yaml @@ -346,6 +346,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -561,6 +562,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -778,6 +780,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.json index bcf971e7bcdc0..92dc72faa9d84 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.pb index 423762633c2d1..62a6b2a2fa049 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.yaml index dd2af24931908..e5c8844d50404 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.Deployment.yaml @@ -348,6 +348,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -563,6 +564,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -780,6 +782,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.json index a0d199797d6f6..81a6a8b0b9c33 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.pb index c5e6af16646ff..a4b4dee5ede02 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.yaml index 60c30d6c28712..53497dbfbc4aa 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta1.StatefulSet.yaml @@ -346,6 +346,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -561,6 +562,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -778,6 +780,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.json index 4c826fd14277d..f5f555dba4141 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.json @@ -563,7 +563,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -858,7 +859,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1153,7 +1155,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.pb index d082a253d2b8b..53daae456174d 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.yaml index aea3024b240d8..fee3c2ac0c997 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.DaemonSet.yaml @@ -338,6 +338,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -553,6 +554,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -770,6 +772,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.json index 9823ab93ce1ca..705d53efed9d9 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.pb index 546df1c84b7f2..585db84023799 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.yaml index ecf26bdd43822..5b9b11fdcdaea 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.Deployment.yaml @@ -346,6 +346,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -561,6 +562,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -778,6 +780,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.json index 0812e3a379feb..17fe981addecd 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.json @@ -565,7 +565,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -860,7 +861,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1155,7 +1157,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.pb index bd52f14c10a59..530d2aafa7114 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.yaml index 65ce5a8bdf9be..d6f024ac5126e 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.ReplicaSet.yaml @@ -338,6 +338,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -553,6 +554,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -770,6 +772,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.json b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.json index cbe80deee72b3..74e29ea755cda 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.pb b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.pb index 55b056f066416..e7e25e71c5b32 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.yaml index 90db583cd165f..31863322667db 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/apps.v1beta2.StatefulSet.yaml @@ -346,6 +346,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -561,6 +562,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -778,6 +780,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.json b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.json index a0a2c04ea1bf5..c0123682af037 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.json +++ b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.json @@ -647,7 +647,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -942,7 +943,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1237,7 +1239,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.pb b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.pb index 1975ddc3a15f9..14b83284485aa 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.pb and b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.yaml b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.yaml index 26a9b9546e966..8ada070a5fe5e 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.CronJob.yaml @@ -398,6 +398,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -613,6 +614,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -830,6 +832,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.json b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.json index 648fe3547a58d..239a5f26905d5 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.json +++ b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.json @@ -598,7 +598,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -893,7 +894,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1188,7 +1190,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.pb b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.pb index 4906f9e2b593d..0cfa7c3f26c09 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.pb and b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.yaml b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.yaml index 48952fe244fb6..a39424977ca16 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/batch.v1.Job.yaml @@ -362,6 +362,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -577,6 +578,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -794,6 +796,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.json b/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.json index 558e57699d57f..27fbdbb45ca1e 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.json +++ b/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.json @@ -647,7 +647,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -942,7 +943,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1237,7 +1239,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.pb b/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.pb index c4b7c2a2e84c2..725df79d201b5 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.pb and b/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.yaml b/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.yaml index 9556d439bbaa7..2edbdbe1854f8 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/batch.v1beta1.CronJob.yaml @@ -398,6 +398,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -613,6 +614,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -830,6 +832,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.json b/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.json index 7a9d63ad1ad2a..cdd6dce0b1c72 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.json +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.json @@ -505,7 +505,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -800,7 +801,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1095,7 +1097,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1787,7 +1790,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1867,7 +1871,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1948,7 +1953,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.pb b/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.pb index 33ed308527de9..df9831efac1e7 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.pb and b/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.yaml b/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.yaml index bd281ae7ca29c..5734afa87b679 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.Pod.yaml @@ -294,6 +294,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -509,6 +510,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -726,6 +728,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -1197,6 +1200,7 @@ status: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -1253,6 +1257,7 @@ status: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -1312,6 +1317,7 @@ status: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.json b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.json index b41862a3c86e5..a401783f94d55 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.json +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.json @@ -128,7 +128,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -208,7 +209,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -289,7 +291,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.pb b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.pb index e1aaa06d3150c..172c1132b399a 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.pb and b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.yaml b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.yaml index 8974386246688..5ad52b13ef7b4 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodStatusResult.yaml @@ -65,6 +65,7 @@ status: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -121,6 +122,7 @@ status: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -180,6 +182,7 @@ status: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.json b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.json index 8766ab78fcc6f..66cadba1b09e8 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.json +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.json @@ -548,7 +548,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -843,7 +844,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1138,7 +1140,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.pb b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.pb index e69176c67dbc1..aa9ac40fddf24 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.pb and b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.yaml b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.yaml index d8bb06d2dac47..f9007a03d7b30 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.PodTemplate.yaml @@ -327,6 +327,7 @@ template: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -542,6 +543,7 @@ template: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -759,6 +761,7 @@ template: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.json b/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.json index edd96c7a2b968..556d28fbae92c 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.json +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.json @@ -554,7 +554,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -849,7 +850,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1144,7 +1146,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.pb b/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.pb index d4b523e6e95a2..c72187f5bec80 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.pb and b/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.yaml b/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.yaml index f3c5331d0b04c..b5181eb3647e6 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/core.v1.ReplicationController.yaml @@ -332,6 +332,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -547,6 +548,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -764,6 +766,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.json b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.json index da7ce8a173c1d..ef2ff6347fa1e 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.json @@ -563,7 +563,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -858,7 +859,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1153,7 +1155,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.pb b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.pb index 44dbbdf865554..9dc71cacce0ee 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.yaml index 3390bd099aa4d..82871a9436754 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.DaemonSet.yaml @@ -338,6 +338,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -553,6 +554,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -770,6 +772,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.json b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.json index 5ac5750397026..0071be9c53c01 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.json +++ b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.json @@ -564,7 +564,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -859,7 +860,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1154,7 +1156,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.pb b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.pb index 6644acfdbbcf6..999cc7a821fe2 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.pb and b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.yaml b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.yaml index d5fa1d8a4c31d..a32d193f21ddb 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.Deployment.yaml @@ -348,6 +348,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -563,6 +564,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -780,6 +782,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.json b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.json index 644584d3da7be..f3cfa5acdda3f 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.json +++ b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.json @@ -565,7 +565,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -860,7 +861,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, @@ -1155,7 +1157,8 @@ }, "claims": [ { - "name": "nameValue" + "name": "nameValue", + "request": "requestValue" } ] }, diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.pb b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.pb index 98a5989a0d2fb..7f4c8aa1b7d5d 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.pb and b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.yaml b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.yaml index 0e9018fc1039f..3d439baadc544 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/extensions.v1beta1.ReplicaSet.yaml @@ -338,6 +338,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -553,6 +554,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: @@ -770,6 +772,7 @@ spec: resources: claims: - name: nameValue + request: requestValue limits: limitsKey: "0" requests: diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.json deleted file mode 100644 index 17dadf3bb9443..0000000000000 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "kind": "ResourceClassParameters", - "apiVersion": "resource.k8s.io/v1alpha2", - "metadata": { - "name": "nameValue", - "generateName": "generateNameValue", - "namespace": "namespaceValue", - "selfLink": "selfLinkValue", - "uid": "uidValue", - "resourceVersion": "resourceVersionValue", - "generation": 7, - "creationTimestamp": "2008-01-01T01:01:01Z", - "deletionTimestamp": "2009-01-01T01:01:01Z", - "deletionGracePeriodSeconds": 10, - "labels": { - "labelsKey": "labelsValue" - }, - "annotations": { - "annotationsKey": "annotationsValue" - }, - "ownerReferences": [ - { - "apiVersion": "apiVersionValue", - "kind": "kindValue", - "name": "nameValue", - "uid": "uidValue", - "controller": true, - "blockOwnerDeletion": true - } - ], - "finalizers": [ - "finalizersValue" - ], - "managedFields": [ - { - "manager": "managerValue", - "operation": "operationValue", - "apiVersion": "apiVersionValue", - "time": "2004-01-01T01:01:01Z", - "fieldsType": "fieldsTypeValue", - "fieldsV1": {}, - "subresource": "subresourceValue" - } - ] - }, - "generatedFrom": { - "apiGroup": "apiGroupValue", - "kind": "kindValue", - "name": "nameValue", - "namespace": "namespaceValue" - }, - "vendorParameters": [ - { - "driverName": "driverNameValue", - "parameters": { - "apiVersion": "example.com/v1", - "kind": "CustomType", - "spec": { - "replicas": 1 - }, - "status": { - "available": 1 - } - } - } - ], - "filters": [ - { - "driverName": "driverNameValue", - "namedResources": { - "selector": "selectorValue" - } - } - ] -} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.yaml deleted file mode 100644 index b26e0534f4700..0000000000000 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha2 -filters: -- driverName: driverNameValue - namedResources: - selector: selectorValue -generatedFrom: - apiGroup: apiGroupValue - kind: kindValue - name: nameValue - namespace: namespaceValue -kind: ResourceClassParameters -metadata: - annotations: - annotationsKey: annotationsValue - creationTimestamp: "2008-01-01T01:01:01Z" - deletionGracePeriodSeconds: 10 - deletionTimestamp: "2009-01-01T01:01:01Z" - finalizers: - - finalizersValue - generateName: generateNameValue - generation: 7 - labels: - labelsKey: labelsValue - managedFields: - - apiVersion: apiVersionValue - fieldsType: fieldsTypeValue - fieldsV1: {} - manager: managerValue - operation: operationValue - subresource: subresourceValue - time: "2004-01-01T01:01:01Z" - name: nameValue - namespace: namespaceValue - ownerReferences: - - apiVersion: apiVersionValue - blockOwnerDeletion: true - controller: true - kind: kindValue - name: nameValue - uid: uidValue - resourceVersion: resourceVersionValue - selfLink: selfLinkValue - uid: uidValue -vendorParameters: -- driverName: driverNameValue - parameters: - apiVersion: example.com/v1 - kind: CustomType - spec: - replicas: 1 - status: - available: 1 diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.json similarity index 54% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.json rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.json index 032eff1cf1e36..1b683f8015d66 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.json +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.json @@ -1,6 +1,6 @@ { - "kind": "ResourceSlice", - "apiVersion": "resource.k8s.io/v1alpha2", + "kind": "DeviceClass", + "apiVersion": "resource.k8s.io/v1alpha3", "metadata": { "name": "nameValue", "generateName": "generateNameValue", @@ -43,33 +43,54 @@ } ] }, - "nodeName": "nodeNameValue", - "driverName": "driverNameValue", - "namedResources": { - "instances": [ + "spec": { + "selectors": [ { - "name": "nameValue", - "attributes": [ - { - "name": "nameValue", - "quantity": "0", - "bool": true, - "int": 7, - "intSlice": { - "ints": [ - 1 - ] - }, - "string": "stringValue", - "stringSlice": { - "strings": [ - "stringsValue" - ] + "cel": { + "expression": "expressionValue" + } + } + ], + "config": [ + { + "opaque": { + "driver": "driverValue", + "parameters": { + "apiVersion": "example.com/v1", + "kind": "CustomType", + "spec": { + "replicas": 1 }, - "version": "versionValue" + "status": { + "available": 1 + } } - ] + } } - ] + ], + "suitableNodes": { + "nodeSelectorTerms": [ + { + "matchExpressions": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ], + "matchFields": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ] + } + ] + } } } \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.pb b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.pb similarity index 63% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.pb rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.pb index b98a880e769e9..3952de283d2c1 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClassParameters.pb and b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.yaml similarity index 58% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.yaml rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.yaml index 80e93c7cd9fc2..634f2e0407a6a 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.DeviceClass.yaml @@ -1,6 +1,5 @@ -apiVersion: resource.k8s.io/v1alpha2 -driverName: driverNameValue -kind: ResourceClass +apiVersion: resource.k8s.io/v1alpha3 +kind: DeviceClass metadata: annotations: annotationsKey: annotationsValue @@ -33,21 +32,29 @@ metadata: resourceVersion: resourceVersionValue selfLink: selfLinkValue uid: uidValue -parametersRef: - apiGroup: apiGroupValue - kind: kindValue - name: nameValue - namespace: namespaceValue -structuredParameters: true -suitableNodes: - nodeSelectorTerms: - - matchExpressions: - - key: keyValue - operator: operatorValue - values: - - valuesValue - matchFields: - - key: keyValue - operator: operatorValue - values: - - valuesValue +spec: + config: + - opaque: + driver: driverValue + parameters: + apiVersion: example.com/v1 + kind: CustomType + spec: + replicas: 1 + status: + available: 1 + selectors: + - cel: + expression: expressionValue + suitableNodes: + nodeSelectorTerms: + - matchExpressions: + - key: keyValue + operator: operatorValue + values: + - valuesValue + matchFields: + - key: keyValue + operator: operatorValue + values: + - valuesValue diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.json similarity index 96% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.json rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.json index 2829401da3c56..2b46b32ab5a7a 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.json +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.json @@ -1,6 +1,6 @@ { "kind": "PodSchedulingContext", - "apiVersion": "resource.k8s.io/v1alpha2", + "apiVersion": "resource.k8s.io/v1alpha3", "metadata": { "name": "nameValue", "generateName": "generateNameValue", diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.pb b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.pb similarity index 89% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.pb rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.pb index 53cde83228abe..745c7d5f6397a 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.pb and b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.yaml similarity index 96% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.yaml rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.yaml index 5dce1364cc357..ae8c1aa8a6343 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.PodSchedulingContext.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.PodSchedulingContext.yaml @@ -1,4 +1,4 @@ -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: PodSchedulingContext metadata: annotations: diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.json new file mode 100644 index 0000000000000..a5a279a70df99 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.json @@ -0,0 +1,164 @@ +{ + "kind": "ResourceClaim", + "apiVersion": "resource.k8s.io/v1alpha3", + "metadata": { + "name": "nameValue", + "generateName": "generateNameValue", + "namespace": "namespaceValue", + "selfLink": "selfLinkValue", + "uid": "uidValue", + "resourceVersion": "resourceVersionValue", + "generation": 7, + "creationTimestamp": "2008-01-01T01:01:01Z", + "deletionTimestamp": "2009-01-01T01:01:01Z", + "deletionGracePeriodSeconds": 10, + "labels": { + "labelsKey": "labelsValue" + }, + "annotations": { + "annotationsKey": "annotationsValue" + }, + "ownerReferences": [ + { + "apiVersion": "apiVersionValue", + "kind": "kindValue", + "name": "nameValue", + "uid": "uidValue", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "finalizersValue" + ], + "managedFields": [ + { + "manager": "managerValue", + "operation": "operationValue", + "apiVersion": "apiVersionValue", + "time": "2004-01-01T01:01:01Z", + "fieldsType": "fieldsTypeValue", + "fieldsV1": {}, + "subresource": "subresourceValue" + } + ] + }, + "spec": { + "devices": { + "requests": [ + { + "name": "nameValue", + "deviceClassName": "deviceClassNameValue", + "selectors": [ + { + "cel": { + "expression": "expressionValue" + } + } + ], + "countMode": "countModeValue", + "count": 5, + "adminAccess": true + } + ], + "constraints": [ + { + "requests": [ + "requestsValue" + ], + "matchAttribute": "matchAttributeValue" + } + ], + "config": [ + { + "requests": [ + "requestsValue" + ], + "opaque": { + "driver": "driverValue", + "parameters": { + "apiVersion": "example.com/v1", + "kind": "CustomType", + "spec": { + "replicas": 1 + }, + "status": { + "available": 1 + } + } + } + } + ] + }, + "controller": "controllerValue" + }, + "status": { + "allocation": { + "devices": { + "results": [ + { + "request": "requestValue", + "driver": "driverValue", + "pool": "poolValue", + "device": "deviceValue" + } + ], + "config": [ + { + "source": "sourceValue", + "requests": [ + "requestsValue" + ], + "opaque": { + "driver": "driverValue", + "parameters": { + "apiVersion": "example.com/v1", + "kind": "CustomType", + "spec": { + "replicas": 1 + }, + "status": { + "available": 1 + } + } + } + } + ] + }, + "nodeSelector": { + "nodeSelectorTerms": [ + { + "matchExpressions": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ], + "matchFields": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ] + } + ] + }, + "controller": "controllerValue" + }, + "reservedFor": [ + { + "apiGroup": "apiGroupValue", + "resource": "resourceValue", + "name": "nameValue", + "uid": "uidValue" + } + ], + "deallocationRequested": true + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.pb b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.pb new file mode 100644 index 0000000000000..6c807a4db44a1 Binary files /dev/null and b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.yaml new file mode 100644 index 0000000000000..5a4d6a34ef2a1 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.yaml @@ -0,0 +1,102 @@ +apiVersion: resource.k8s.io/v1alpha3 +kind: ResourceClaim +metadata: + annotations: + annotationsKey: annotationsValue + creationTimestamp: "2008-01-01T01:01:01Z" + deletionGracePeriodSeconds: 10 + deletionTimestamp: "2009-01-01T01:01:01Z" + finalizers: + - finalizersValue + generateName: generateNameValue + generation: 7 + labels: + labelsKey: labelsValue + managedFields: + - apiVersion: apiVersionValue + fieldsType: fieldsTypeValue + fieldsV1: {} + manager: managerValue + operation: operationValue + subresource: subresourceValue + time: "2004-01-01T01:01:01Z" + name: nameValue + namespace: namespaceValue + ownerReferences: + - apiVersion: apiVersionValue + blockOwnerDeletion: true + controller: true + kind: kindValue + name: nameValue + uid: uidValue + resourceVersion: resourceVersionValue + selfLink: selfLinkValue + uid: uidValue +spec: + controller: controllerValue + devices: + config: + - opaque: + driver: driverValue + parameters: + apiVersion: example.com/v1 + kind: CustomType + spec: + replicas: 1 + status: + available: 1 + requests: + - requestsValue + constraints: + - matchAttribute: matchAttributeValue + requests: + - requestsValue + requests: + - adminAccess: true + count: 5 + countMode: countModeValue + deviceClassName: deviceClassNameValue + name: nameValue + selectors: + - cel: + expression: expressionValue +status: + allocation: + controller: controllerValue + devices: + config: + - opaque: + driver: driverValue + parameters: + apiVersion: example.com/v1 + kind: CustomType + spec: + replicas: 1 + status: + available: 1 + requests: + - requestsValue + source: sourceValue + results: + - device: deviceValue + driver: driverValue + pool: poolValue + request: requestValue + nodeSelector: + nodeSelectorTerms: + - matchExpressions: + - key: keyValue + operator: operatorValue + values: + - valuesValue + matchFields: + - key: keyValue + operator: operatorValue + values: + - valuesValue + deallocationRequested: true + reservedFor: + - apiGroup: apiGroupValue + name: nameValue + resource: resourceValue + uid: uidValue diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.json new file mode 100644 index 0000000000000..c02e127397b2e --- /dev/null +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.json @@ -0,0 +1,139 @@ +{ + "kind": "ResourceClaimTemplate", + "apiVersion": "resource.k8s.io/v1alpha3", + "metadata": { + "name": "nameValue", + "generateName": "generateNameValue", + "namespace": "namespaceValue", + "selfLink": "selfLinkValue", + "uid": "uidValue", + "resourceVersion": "resourceVersionValue", + "generation": 7, + "creationTimestamp": "2008-01-01T01:01:01Z", + "deletionTimestamp": "2009-01-01T01:01:01Z", + "deletionGracePeriodSeconds": 10, + "labels": { + "labelsKey": "labelsValue" + }, + "annotations": { + "annotationsKey": "annotationsValue" + }, + "ownerReferences": [ + { + "apiVersion": "apiVersionValue", + "kind": "kindValue", + "name": "nameValue", + "uid": "uidValue", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "finalizersValue" + ], + "managedFields": [ + { + "manager": "managerValue", + "operation": "operationValue", + "apiVersion": "apiVersionValue", + "time": "2004-01-01T01:01:01Z", + "fieldsType": "fieldsTypeValue", + "fieldsV1": {}, + "subresource": "subresourceValue" + } + ] + }, + "spec": { + "metadata": { + "name": "nameValue", + "generateName": "generateNameValue", + "namespace": "namespaceValue", + "selfLink": "selfLinkValue", + "uid": "uidValue", + "resourceVersion": "resourceVersionValue", + "generation": 7, + "creationTimestamp": "2008-01-01T01:01:01Z", + "deletionTimestamp": "2009-01-01T01:01:01Z", + "deletionGracePeriodSeconds": 10, + "labels": { + "labelsKey": "labelsValue" + }, + "annotations": { + "annotationsKey": "annotationsValue" + }, + "ownerReferences": [ + { + "apiVersion": "apiVersionValue", + "kind": "kindValue", + "name": "nameValue", + "uid": "uidValue", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "finalizersValue" + ], + "managedFields": [ + { + "manager": "managerValue", + "operation": "operationValue", + "apiVersion": "apiVersionValue", + "time": "2004-01-01T01:01:01Z", + "fieldsType": "fieldsTypeValue", + "fieldsV1": {}, + "subresource": "subresourceValue" + } + ] + }, + "spec": { + "devices": { + "requests": [ + { + "name": "nameValue", + "deviceClassName": "deviceClassNameValue", + "selectors": [ + { + "cel": { + "expression": "expressionValue" + } + } + ], + "countMode": "countModeValue", + "count": 5, + "adminAccess": true + } + ], + "constraints": [ + { + "requests": [ + "requestsValue" + ], + "matchAttribute": "matchAttributeValue" + } + ], + "config": [ + { + "requests": [ + "requestsValue" + ], + "opaque": { + "driver": "driverValue", + "parameters": { + "apiVersion": "example.com/v1", + "kind": "CustomType", + "spec": { + "replicas": 1 + }, + "status": { + "available": 1 + } + } + } + } + ] + }, + "controller": "controllerValue" + } + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.pb b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.pb new file mode 100644 index 0000000000000..0121026d5f9e7 Binary files /dev/null and b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.yaml new file mode 100644 index 0000000000000..025800650acad --- /dev/null +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.yaml @@ -0,0 +1,95 @@ +apiVersion: resource.k8s.io/v1alpha3 +kind: ResourceClaimTemplate +metadata: + annotations: + annotationsKey: annotationsValue + creationTimestamp: "2008-01-01T01:01:01Z" + deletionGracePeriodSeconds: 10 + deletionTimestamp: "2009-01-01T01:01:01Z" + finalizers: + - finalizersValue + generateName: generateNameValue + generation: 7 + labels: + labelsKey: labelsValue + managedFields: + - apiVersion: apiVersionValue + fieldsType: fieldsTypeValue + fieldsV1: {} + manager: managerValue + operation: operationValue + subresource: subresourceValue + time: "2004-01-01T01:01:01Z" + name: nameValue + namespace: namespaceValue + ownerReferences: + - apiVersion: apiVersionValue + blockOwnerDeletion: true + controller: true + kind: kindValue + name: nameValue + uid: uidValue + resourceVersion: resourceVersionValue + selfLink: selfLinkValue + uid: uidValue +spec: + metadata: + annotations: + annotationsKey: annotationsValue + creationTimestamp: "2008-01-01T01:01:01Z" + deletionGracePeriodSeconds: 10 + deletionTimestamp: "2009-01-01T01:01:01Z" + finalizers: + - finalizersValue + generateName: generateNameValue + generation: 7 + labels: + labelsKey: labelsValue + managedFields: + - apiVersion: apiVersionValue + fieldsType: fieldsTypeValue + fieldsV1: {} + manager: managerValue + operation: operationValue + subresource: subresourceValue + time: "2004-01-01T01:01:01Z" + name: nameValue + namespace: namespaceValue + ownerReferences: + - apiVersion: apiVersionValue + blockOwnerDeletion: true + controller: true + kind: kindValue + name: nameValue + uid: uidValue + resourceVersion: resourceVersionValue + selfLink: selfLinkValue + uid: uidValue + spec: + controller: controllerValue + devices: + config: + - opaque: + driver: driverValue + parameters: + apiVersion: example.com/v1 + kind: CustomType + spec: + replicas: 1 + status: + available: 1 + requests: + - requestsValue + constraints: + - matchAttribute: matchAttributeValue + requests: + - requestsValue + requests: + - adminAccess: true + count: 5 + countMode: countModeValue + deviceClassName: deviceClassNameValue + name: nameValue + selectors: + - cel: + expression: expressionValue diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.json new file mode 100644 index 0000000000000..a3a916ae36352 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.json @@ -0,0 +1,98 @@ +{ + "kind": "ResourceSlice", + "apiVersion": "resource.k8s.io/v1alpha3", + "metadata": { + "name": "nameValue", + "generateName": "generateNameValue", + "namespace": "namespaceValue", + "selfLink": "selfLinkValue", + "uid": "uidValue", + "resourceVersion": "resourceVersionValue", + "generation": 7, + "creationTimestamp": "2008-01-01T01:01:01Z", + "deletionTimestamp": "2009-01-01T01:01:01Z", + "deletionGracePeriodSeconds": 10, + "labels": { + "labelsKey": "labelsValue" + }, + "annotations": { + "annotationsKey": "annotationsValue" + }, + "ownerReferences": [ + { + "apiVersion": "apiVersionValue", + "kind": "kindValue", + "name": "nameValue", + "uid": "uidValue", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "finalizersValue" + ], + "managedFields": [ + { + "manager": "managerValue", + "operation": "operationValue", + "apiVersion": "apiVersionValue", + "time": "2004-01-01T01:01:01Z", + "fieldsType": "fieldsTypeValue", + "fieldsV1": {}, + "subresource": "subresourceValue" + } + ] + }, + "spec": { + "driver": "driverValue", + "pool": { + "name": "nameValue", + "generation": 2, + "resourceSliceCount": 3 + }, + "nodeName": "nodeNameValue", + "nodeSelector": { + "nodeSelectorTerms": [ + { + "matchExpressions": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ], + "matchFields": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ] + } + ] + }, + "allNodes": true, + "devices": [ + { + "name": "nameValue", + "basic": { + "attributes": { + "attributesKey": { + "int": 2, + "bool": true, + "string": "stringValue", + "version": "versionValue" + } + }, + "capacity": { + "capacityKey": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.pb b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.pb similarity index 61% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.pb rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.pb index 772cd16f80a8f..9a36629f9a87a 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.pb and b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.yaml similarity index 56% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.yaml rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.yaml index 5869fbbca22f0..93d7f2e117023 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.ResourceSlice.yaml @@ -1,5 +1,4 @@ -apiVersion: resource.k8s.io/v1alpha2 -driverName: driverNameValue +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceSlice metadata: annotations: @@ -33,20 +32,34 @@ metadata: resourceVersion: resourceVersionValue selfLink: selfLinkValue uid: uidValue -namedResources: - instances: - - attributes: - - bool: true - int: 7 - intSlice: - ints: - - 1 - name: nameValue - quantity: "0" - string: stringValue - stringSlice: - strings: - - stringsValue - version: versionValue +spec: + allNodes: true + devices: + - basic: + attributes: + attributesKey: + bool: true + int: 2 + string: stringValue + version: versionValue + capacity: + capacityKey: "0" name: nameValue -nodeName: nodeNameValue + driver: driverValue + nodeName: nodeNameValue + nodeSelector: + nodeSelectorTerms: + - matchExpressions: + - key: keyValue + operator: operatorValue + values: + - valuesValue + matchFields: + - key: keyValue + operator: operatorValue + values: + - valuesValue + pool: + generation: 2 + name: nameValue + resourceSliceCount: 3 diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.json b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.json similarity index 92% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.json rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.json index bcfd157fa9359..24ac6260e10e0 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.json +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.json @@ -1,6 +1,6 @@ { "kind": "Status", - "apiVersion": "resource.k8s.io/v1alpha2", + "apiVersion": "resource.k8s.io/v1alpha3", "metadata": { "selfLink": "selfLinkValue", "resourceVersion": "resourceVersionValue", diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.pb b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.pb similarity index 84% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.pb rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.pb index 66b5e430af7f5..05265b30c973f 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.pb and b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.yaml b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.yaml similarity index 91% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.yaml rename to staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.yaml index 5507b94519f51..06c2f189067b0 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.Status.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha3.Status.yaml @@ -1,4 +1,4 @@ -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 code: 6 details: causes: diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.DaemonSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.DaemonSet.after_roundtrip.pb index 5fe83c6f42b33..dd1054b941f5a 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.DaemonSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.DaemonSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.Deployment.after_roundtrip.pb index 9e66f34abd60b..731a22c1e74a7 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.ReplicaSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.ReplicaSet.after_roundtrip.pb index b79e08e5e8c57..92c919e9d714a 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.ReplicaSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.ReplicaSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.StatefulSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.StatefulSet.after_roundtrip.pb index 595140b4f1135..48d3d664b5ae7 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.StatefulSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1.StatefulSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.Deployment.after_roundtrip.pb index f79808dce36d6..4ee72febdfa1e 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.StatefulSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.StatefulSet.after_roundtrip.pb index 0e996204770a4..73f11626f64e9 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.StatefulSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta1.StatefulSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.DaemonSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.DaemonSet.after_roundtrip.pb index d3e225fe33dab..3bd455e36efe3 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.DaemonSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.DaemonSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.Deployment.after_roundtrip.pb index ea64a0d378a80..1695071cdda82 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb index 74845b052cdfd..443f75a505e47 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.StatefulSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.StatefulSet.after_roundtrip.pb index e574fabd14cab..045b4f4a55ff2 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.StatefulSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/apps.v1beta2.StatefulSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.CronJob.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.CronJob.after_roundtrip.pb index 35637780dc296..c8c40aa92799c 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.CronJob.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.CronJob.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.Job.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.Job.after_roundtrip.pb index dde72deb6bc3c..892a6a0f6ac94 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.Job.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1.Job.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1beta1.CronJob.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1beta1.CronJob.after_roundtrip.pb index 6123c6cf03f1e..87a87757dfa38 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1beta1.CronJob.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/batch.v1beta1.CronJob.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.Pod.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.Pod.after_roundtrip.pb index f8ba6632b88bd..5bb77db5fbb60 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.Pod.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.Pod.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodStatusResult.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodStatusResult.after_roundtrip.pb new file mode 100644 index 0000000000000..be6be831ae946 Binary files /dev/null and b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodStatusResult.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodTemplate.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodTemplate.after_roundtrip.pb index a1b0669c591fe..73242ede386c2 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodTemplate.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.PodTemplate.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.ReplicationController.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.ReplicationController.after_roundtrip.pb index e74a5e077e224..617e150e2edc7 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.ReplicationController.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/core.v1.ReplicationController.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb index 36fc4ffe11c61..aafbbe9b71588 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.Deployment.after_roundtrip.pb index 6c9de7434bca1..bd7a44394eefe 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb index 5fd624a3a7985..739f1774d7767 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.json b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.json similarity index 51% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.json rename to staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.json index 16461a7efc14d..29283a7214a46 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClass.json +++ b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.json @@ -1,5 +1,5 @@ { - "kind": "ResourceClass", + "kind": "ResourceClaim", "apiVersion": "resource.k8s.io/v1alpha2", "metadata": { "name": "nameValue", @@ -43,36 +43,56 @@ } ] }, - "driverName": "driverNameValue", - "parametersRef": { - "apiGroup": "apiGroupValue", - "kind": "kindValue", - "name": "nameValue", - "namespace": "namespaceValue" + "spec": { + "resourceClassName": "resourceClassNameValue", + "parametersRef": { + "apiGroup": "apiGroupValue", + "kind": "kindValue", + "name": "nameValue" + } }, - "suitableNodes": { - "nodeSelectorTerms": [ - { - "matchExpressions": [ - { - "key": "keyValue", - "operator": "operatorValue", - "values": [ - "valuesValue" - ] - } - ], - "matchFields": [ + "status": { + "driverName": "driverNameValue", + "allocation": { + "resourceHandles": [ + { + "driverName": "driverNameValue", + "data": "dataValue" + } + ], + "availableOnNodes": { + "nodeSelectorTerms": [ { - "key": "keyValue", - "operator": "operatorValue", - "values": [ - "valuesValue" + "matchExpressions": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } + ], + "matchFields": [ + { + "key": "keyValue", + "operator": "operatorValue", + "values": [ + "valuesValue" + ] + } ] } ] } - ] - }, - "structuredParameters": true + }, + "reservedFor": [ + { + "apiGroup": "apiGroupValue", + "resource": "resourceValue", + "name": "nameValue", + "uid": "uidValue" + } + ], + "deallocationRequested": true + } } \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.pb b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.pb similarity index 51% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.pb rename to staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.pb index 1d09471bd3b9b..9ae171eb5caa9 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceSlice.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.yaml b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.yaml new file mode 100644 index 0000000000000..4234746be09ee --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.yaml @@ -0,0 +1,64 @@ +apiVersion: resource.k8s.io/v1alpha2 +kind: ResourceClaim +metadata: + annotations: + annotationsKey: annotationsValue + creationTimestamp: "2008-01-01T01:01:01Z" + deletionGracePeriodSeconds: 10 + deletionTimestamp: "2009-01-01T01:01:01Z" + finalizers: + - finalizersValue + generateName: generateNameValue + generation: 7 + labels: + labelsKey: labelsValue + managedFields: + - apiVersion: apiVersionValue + fieldsType: fieldsTypeValue + fieldsV1: {} + manager: managerValue + operation: operationValue + subresource: subresourceValue + time: "2004-01-01T01:01:01Z" + name: nameValue + namespace: namespaceValue + ownerReferences: + - apiVersion: apiVersionValue + blockOwnerDeletion: true + controller: true + kind: kindValue + name: nameValue + uid: uidValue + resourceVersion: resourceVersionValue + selfLink: selfLinkValue + uid: uidValue +spec: + parametersRef: + apiGroup: apiGroupValue + kind: kindValue + name: nameValue + resourceClassName: resourceClassNameValue +status: + allocation: + availableOnNodes: + nodeSelectorTerms: + - matchExpressions: + - key: keyValue + operator: operatorValue + values: + - valuesValue + matchFields: + - key: keyValue + operator: operatorValue + values: + - valuesValue + resourceHandles: + - data: dataValue + driverName: driverNameValue + deallocationRequested: true + driverName: driverNameValue + reservedFor: + - apiGroup: apiGroupValue + name: nameValue + resource: resourceValue + uid: uidValue diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.json b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.json similarity index 97% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.json rename to staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.json index b1e363fa351e4..060fa386e95e4 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.json +++ b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.json @@ -92,8 +92,7 @@ "apiGroup": "apiGroupValue", "kind": "kindValue", "name": "nameValue" - }, - "allocationMode": "allocationModeValue" + } } } } \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.pb b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.pb similarity index 81% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.pb rename to staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.pb index b251edf164d8e..d8e02713279d6 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.pb and b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.yaml b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.yaml similarity index 97% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.yaml rename to staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.yaml index 63d726ed6236e..855e06411e472 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimTemplate.yaml +++ b/staging/src/k8s.io/api/testdata/v1.29.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.yaml @@ -66,7 +66,6 @@ spec: selfLink: selfLinkValue uid: uidValue spec: - allocationMode: allocationModeValue parametersRef: apiGroup: apiGroupValue kind: kindValue diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.DaemonSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.DaemonSet.after_roundtrip.pb index d8b5c3cb5d9c5..9d473166f9f66 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.DaemonSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.DaemonSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.Deployment.after_roundtrip.pb index 6cb8c88f2e0c8..0f33ae4adf056 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.ReplicaSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.ReplicaSet.after_roundtrip.pb index 3e245809a3463..8a303c2208b93 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.ReplicaSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.ReplicaSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.StatefulSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.StatefulSet.after_roundtrip.pb index 418d78da1c54d..e813f1f3e3054 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.StatefulSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1.StatefulSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.Deployment.after_roundtrip.pb index b39600e3ea69f..02269284983a0 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.StatefulSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.StatefulSet.after_roundtrip.pb index 62c45ec03e0b9..a8b6362a1f34f 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.StatefulSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta1.StatefulSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.DaemonSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.DaemonSet.after_roundtrip.pb index 5987396c496d8..178d17ac3b482 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.DaemonSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.DaemonSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.Deployment.after_roundtrip.pb index c284b4e27fa18..b53a0bfce0b3f 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb index 3a33a36c87e3b..fd8fdca58e486 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.ReplicaSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.StatefulSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.StatefulSet.after_roundtrip.pb index bb66fafdcb65b..92115d596b1c0 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.StatefulSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/apps.v1beta2.StatefulSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.CronJob.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.CronJob.after_roundtrip.pb index 675922156d545..98aa63160817d 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.CronJob.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.CronJob.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.Job.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.Job.after_roundtrip.pb index 5fc96f6c032d7..561e54c46b449 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.Job.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1.Job.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1beta1.CronJob.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1beta1.CronJob.after_roundtrip.pb index f313b08e2f54c..9f0643d069a15 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1beta1.CronJob.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/batch.v1beta1.CronJob.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.Pod.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.Pod.after_roundtrip.pb index e8478fc8b0661..3aadd916dd89e 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.Pod.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.Pod.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodStatusResult.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodStatusResult.after_roundtrip.pb new file mode 100644 index 0000000000000..59180f3591126 Binary files /dev/null and b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodStatusResult.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodTemplate.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodTemplate.after_roundtrip.pb index e2049b6d29a44..e1b7af204a842 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodTemplate.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.PodTemplate.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.ReplicationController.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.ReplicationController.after_roundtrip.pb index dfb5ef6b416d4..2376a417ef301 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.ReplicationController.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/core.v1.ReplicationController.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb index 5fa61966d3816..9f37cc6f65902 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.DaemonSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.Deployment.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.Deployment.after_roundtrip.pb index 65c4b71e1edd5..1276d7e80fe6e 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.Deployment.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.Deployment.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb index e23f767d626c4..0522fa20b31c0 100644 Binary files a/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/extensions.v1beta1.ReplicaSet.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.json b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.json similarity index 97% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.json rename to staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.json index 3b370ead83328..387ce389ddd79 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.json +++ b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.json @@ -49,8 +49,7 @@ "apiGroup": "apiGroupValue", "kind": "kindValue", "name": "nameValue" - }, - "allocationMode": "allocationModeValue" + } }, "status": { "driverName": "driverNameValue", @@ -124,8 +123,7 @@ ] } ] - }, - "shareable": true + } }, "reservedFor": [ { diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.pb b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.pb similarity index 81% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.pb rename to staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.pb index b6709816fd46d..ab2a9cf9b7853 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.yaml b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.yaml similarity index 97% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.yaml rename to staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.yaml index 41079295502cf..be2cc8e78cbbb 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaim.yaml +++ b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaim.after_roundtrip.yaml @@ -33,7 +33,6 @@ metadata: selfLink: selfLinkValue uid: uidValue spec: - allocationMode: allocationModeValue parametersRef: apiGroup: apiGroupValue kind: kindValue @@ -82,7 +81,6 @@ status: replicas: 1 status: available: 1 - shareable: true deallocationRequested: true driverName: driverNameValue reservedFor: diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.json b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.json similarity index 98% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.json rename to staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.json index aa801a2f5d26c..cef440794e80e 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.json +++ b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.json @@ -48,7 +48,6 @@ "kind": "kindValue", "name": "nameValue" }, - "shareable": true, "driverRequests": [ { "driverName": "driverNameValue", diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.pb b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.pb similarity index 86% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.pb rename to staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.pb index 33f11f498f188..6a34b90e2f4fe 100644 Binary files a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.pb and b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.yaml b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.yaml similarity index 98% rename from staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.yaml rename to staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.yaml index 9af4582f12817..09f901e9ac3e0 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/resource.k8s.io.v1alpha2.ResourceClaimParameters.yaml +++ b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimParameters.after_roundtrip.yaml @@ -55,4 +55,3 @@ metadata: resourceVersion: resourceVersionValue selfLink: selfLinkValue uid: uidValue -shareable: true diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.json b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.json new file mode 100644 index 0000000000000..060fa386e95e4 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.json @@ -0,0 +1,98 @@ +{ + "kind": "ResourceClaimTemplate", + "apiVersion": "resource.k8s.io/v1alpha2", + "metadata": { + "name": "nameValue", + "generateName": "generateNameValue", + "namespace": "namespaceValue", + "selfLink": "selfLinkValue", + "uid": "uidValue", + "resourceVersion": "resourceVersionValue", + "generation": 7, + "creationTimestamp": "2008-01-01T01:01:01Z", + "deletionTimestamp": "2009-01-01T01:01:01Z", + "deletionGracePeriodSeconds": 10, + "labels": { + "labelsKey": "labelsValue" + }, + "annotations": { + "annotationsKey": "annotationsValue" + }, + "ownerReferences": [ + { + "apiVersion": "apiVersionValue", + "kind": "kindValue", + "name": "nameValue", + "uid": "uidValue", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "finalizersValue" + ], + "managedFields": [ + { + "manager": "managerValue", + "operation": "operationValue", + "apiVersion": "apiVersionValue", + "time": "2004-01-01T01:01:01Z", + "fieldsType": "fieldsTypeValue", + "fieldsV1": {}, + "subresource": "subresourceValue" + } + ] + }, + "spec": { + "metadata": { + "name": "nameValue", + "generateName": "generateNameValue", + "namespace": "namespaceValue", + "selfLink": "selfLinkValue", + "uid": "uidValue", + "resourceVersion": "resourceVersionValue", + "generation": 7, + "creationTimestamp": "2008-01-01T01:01:01Z", + "deletionTimestamp": "2009-01-01T01:01:01Z", + "deletionGracePeriodSeconds": 10, + "labels": { + "labelsKey": "labelsValue" + }, + "annotations": { + "annotationsKey": "annotationsValue" + }, + "ownerReferences": [ + { + "apiVersion": "apiVersionValue", + "kind": "kindValue", + "name": "nameValue", + "uid": "uidValue", + "controller": true, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "finalizersValue" + ], + "managedFields": [ + { + "manager": "managerValue", + "operation": "operationValue", + "apiVersion": "apiVersionValue", + "time": "2004-01-01T01:01:01Z", + "fieldsType": "fieldsTypeValue", + "fieldsV1": {}, + "subresource": "subresourceValue" + } + ] + }, + "spec": { + "resourceClassName": "resourceClassNameValue", + "parametersRef": { + "apiGroup": "apiGroupValue", + "kind": "kindValue", + "name": "nameValue" + } + } + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.pb b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.pb new file mode 100644 index 0000000000000..d8e02713279d6 Binary files /dev/null and b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.pb differ diff --git a/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.yaml b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.yaml new file mode 100644 index 0000000000000..855e06411e472 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.30.0/resource.k8s.io.v1alpha2.ResourceClaimTemplate.after_roundtrip.yaml @@ -0,0 +1,73 @@ +apiVersion: resource.k8s.io/v1alpha2 +kind: ResourceClaimTemplate +metadata: + annotations: + annotationsKey: annotationsValue + creationTimestamp: "2008-01-01T01:01:01Z" + deletionGracePeriodSeconds: 10 + deletionTimestamp: "2009-01-01T01:01:01Z" + finalizers: + - finalizersValue + generateName: generateNameValue + generation: 7 + labels: + labelsKey: labelsValue + managedFields: + - apiVersion: apiVersionValue + fieldsType: fieldsTypeValue + fieldsV1: {} + manager: managerValue + operation: operationValue + subresource: subresourceValue + time: "2004-01-01T01:01:01Z" + name: nameValue + namespace: namespaceValue + ownerReferences: + - apiVersion: apiVersionValue + blockOwnerDeletion: true + controller: true + kind: kindValue + name: nameValue + uid: uidValue + resourceVersion: resourceVersionValue + selfLink: selfLinkValue + uid: uidValue +spec: + metadata: + annotations: + annotationsKey: annotationsValue + creationTimestamp: "2008-01-01T01:01:01Z" + deletionGracePeriodSeconds: 10 + deletionTimestamp: "2009-01-01T01:01:01Z" + finalizers: + - finalizersValue + generateName: generateNameValue + generation: 7 + labels: + labelsKey: labelsValue + managedFields: + - apiVersion: apiVersionValue + fieldsType: fieldsTypeValue + fieldsV1: {} + manager: managerValue + operation: operationValue + subresource: subresourceValue + time: "2004-01-01T01:01:01Z" + name: nameValue + namespace: namespaceValue + ownerReferences: + - apiVersion: apiVersionValue + blockOwnerDeletion: true + controller: true + kind: kindValue + name: nameValue + uid: uidValue + resourceVersion: resourceVersionValue + selfLink: selfLinkValue + uid: uidValue + spec: + parametersRef: + apiGroup: apiGroupValue + kind: kindValue + name: nameValue + resourceClassName: resourceClassNameValue diff --git a/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger-with-shared-parameters.json b/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger-with-shared-parameters.json index 76482347cf0eb..3bfde37e1db84 100644 --- a/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger-with-shared-parameters.json +++ b/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger-with-shared-parameters.json @@ -62716,7 +62716,7 @@ "application/vnd.kubernetes.protobuf" ], "description": "get available resources", - "operationId": "getResourceV1alpha2APIResources", + "operationId": "getResourceV1alpha3APIResources", "produces": [ "application/json", "application/yaml", @@ -62747,7 +62747,7 @@ "*/*" ], "description": "delete collection of PodSchedulingContext", - "operationId": "deleteResourceV1alpha2CollectionNamespacedPodSchedulingContext", + "operationId": "deleteResourceV1alpha3CollectionNamespacedPodSchedulingContext", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -62823,7 +62823,7 @@ "*/*" ], "description": "list or watch objects of kind PodSchedulingContext", - "operationId": "listResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "listResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HTxmzgxC" @@ -62900,7 +62900,7 @@ "*/*" ], "description": "create a PodSchedulingContext", - "operationId": "createResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "createResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "in": "body", @@ -62968,7 +62968,7 @@ "*/*" ], "description": "delete a PodSchedulingContext", - "operationId": "deleteResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "deleteResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -63026,7 +63026,7 @@ "*/*" ], "description": "read the specified PodSchedulingContext", - "operationId": "readResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "readResourceV1alpha3NamespacedPodSchedulingContext", "produces": [ "application/json", "application/yaml", @@ -63080,7 +63080,7 @@ "application/apply-patch+yaml" ], "description": "partially update the specified PodSchedulingContext", - "operationId": "patchResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "patchResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "$ref": "#/parameters/body-YKtvzQTo" @@ -63138,7 +63138,7 @@ "*/*" ], "description": "replace the specified PodSchedulingContext", - "operationId": "replaceResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "replaceResourceV1alpha3NamespacedPodSchedulingContext", "parameters": [ { "in": "body", @@ -63200,7 +63200,7 @@ "*/*" ], "description": "read status of the specified PodSchedulingContext", - "operationId": "readResourceV1alpha2NamespacedPodSchedulingContextStatus", + "operationId": "readResourceV1alpha3NamespacedPodSchedulingContextStatus", "produces": [ "application/json", "application/yaml", @@ -63254,7 +63254,7 @@ "application/apply-patch+yaml" ], "description": "partially update status of the specified PodSchedulingContext", - "operationId": "patchResourceV1alpha2NamespacedPodSchedulingContextStatus", + "operationId": "patchResourceV1alpha3NamespacedPodSchedulingContextStatus", "parameters": [ { "$ref": "#/parameters/body-YKtvzQTo" @@ -63312,7 +63312,7 @@ "*/*" ], "description": "replace status of the specified PodSchedulingContext", - "operationId": "replaceResourceV1alpha2NamespacedPodSchedulingContextStatus", + "operationId": "replaceResourceV1alpha3NamespacedPodSchedulingContextStatus", "parameters": [ { "in": "body", @@ -63374,7 +63374,7 @@ "*/*" ], "description": "delete collection of ResourceClaim", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaim", + "operationId": "deleteResourceV1alpha3CollectionNamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -63450,7 +63450,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClaim", - "operationId": "listResourceV1alpha2NamespacedResourceClaim", + "operationId": "listResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HTxmzgxC" @@ -63527,7 +63527,7 @@ "*/*" ], "description": "create a ResourceClaim", - "operationId": "createResourceV1alpha2NamespacedResourceClaim", + "operationId": "createResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "in": "body", @@ -63595,7 +63595,7 @@ "*/*" ], "description": "delete a ResourceClaim", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaim", + "operationId": "deleteResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -63653,7 +63653,7 @@ "*/*" ], "description": "read the specified ResourceClaim", - "operationId": "readResourceV1alpha2NamespacedResourceClaim", + "operationId": "readResourceV1alpha3NamespacedResourceClaim", "produces": [ "application/json", "application/yaml", @@ -63707,7 +63707,7 @@ "application/apply-patch+yaml" ], "description": "partially update the specified ResourceClaim", - "operationId": "patchResourceV1alpha2NamespacedResourceClaim", + "operationId": "patchResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "$ref": "#/parameters/body-YKtvzQTo" @@ -63765,7 +63765,7 @@ "*/*" ], "description": "replace the specified ResourceClaim", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaim", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaim", "parameters": [ { "in": "body", @@ -63827,7 +63827,7 @@ "*/*" ], "description": "read status of the specified ResourceClaim", - "operationId": "readResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "readResourceV1alpha3NamespacedResourceClaimStatus", "produces": [ "application/json", "application/yaml", @@ -63881,7 +63881,7 @@ "application/apply-patch+yaml" ], "description": "partially update status of the specified ResourceClaim", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "patchResourceV1alpha3NamespacedResourceClaimStatus", "parameters": [ { "$ref": "#/parameters/body-YKtvzQTo" @@ -63939,7 +63939,7 @@ "*/*" ], "description": "replace status of the specified ResourceClaim", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimStatus", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaimStatus", "parameters": [ { "in": "body", @@ -64001,7 +64001,7 @@ "*/*" ], "description": "delete collection of ResourceClaimTemplate", - "operationId": "deleteResourceV1alpha2CollectionNamespacedResourceClaimTemplate", + "operationId": "deleteResourceV1alpha3CollectionNamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -64077,7 +64077,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClaimTemplate", - "operationId": "listResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "listResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HTxmzgxC" @@ -64154,7 +64154,7 @@ "*/*" ], "description": "create a ResourceClaimTemplate", - "operationId": "createResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "createResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "in": "body", @@ -64222,7 +64222,7 @@ "*/*" ], "description": "delete a ResourceClaimTemplate", - "operationId": "deleteResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "deleteResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -64280,7 +64280,7 @@ "*/*" ], "description": "read the specified ResourceClaimTemplate", - "operationId": "readResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "readResourceV1alpha3NamespacedResourceClaimTemplate", "produces": [ "application/json", "application/yaml", @@ -64334,7 +64334,7 @@ "application/apply-patch+yaml" ], "description": "partially update the specified ResourceClaimTemplate", - "operationId": "patchResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "patchResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "$ref": "#/parameters/body-YKtvzQTo" @@ -64392,7 +64392,7 @@ "*/*" ], "description": "replace the specified ResourceClaimTemplate", - "operationId": "replaceResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "replaceResourceV1alpha3NamespacedResourceClaimTemplate", "parameters": [ { "in": "body", @@ -64454,7 +64454,7 @@ "*/*" ], "description": "list or watch objects of kind PodSchedulingContext", - "operationId": "listResourceV1alpha2PodSchedulingContextForAllNamespaces", + "operationId": "listResourceV1alpha3PodSchedulingContextForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -64528,7 +64528,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClaim", - "operationId": "listResourceV1alpha2ResourceClaimForAllNamespaces", + "operationId": "listResourceV1alpha3ResourceClaimForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -64602,7 +64602,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClaimTemplate", - "operationId": "listResourceV1alpha2ResourceClaimTemplateForAllNamespaces", + "operationId": "listResourceV1alpha3ResourceClaimTemplateForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -64676,7 +64676,7 @@ "*/*" ], "description": "delete collection of ResourceClass", - "operationId": "deleteResourceV1alpha2CollectionResourceClass", + "operationId": "deleteResourceV1alpha3CollectionResourceClass", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -64752,7 +64752,7 @@ "*/*" ], "description": "list or watch objects of kind ResourceClass", - "operationId": "listResourceV1alpha2ResourceClass", + "operationId": "listResourceV1alpha3ResourceClass", "parameters": [ { "$ref": "#/parameters/allowWatchBookmarks-HTxmzgxC" @@ -64826,7 +64826,7 @@ "*/*" ], "description": "create a ResourceClass", - "operationId": "createResourceV1alpha2ResourceClass", + "operationId": "createResourceV1alpha3ResourceClass", "parameters": [ { "in": "body", @@ -64894,7 +64894,7 @@ "*/*" ], "description": "delete a ResourceClass", - "operationId": "deleteResourceV1alpha2ResourceClass", + "operationId": "deleteResourceV1alpha3ResourceClass", "parameters": [ { "$ref": "#/parameters/body-jLCaEqdf" @@ -64952,7 +64952,7 @@ "*/*" ], "description": "read the specified ResourceClass", - "operationId": "readResourceV1alpha2ResourceClass", + "operationId": "readResourceV1alpha3ResourceClass", "produces": [ "application/json", "application/yaml", @@ -65003,7 +65003,7 @@ "application/apply-patch+yaml" ], "description": "partially update the specified ResourceClass", - "operationId": "patchResourceV1alpha2ResourceClass", + "operationId": "patchResourceV1alpha3ResourceClass", "parameters": [ { "$ref": "#/parameters/body-YKtvzQTo" @@ -65061,7 +65061,7 @@ "*/*" ], "description": "replace the specified ResourceClass", - "operationId": "replaceResourceV1alpha2ResourceClass", + "operationId": "replaceResourceV1alpha3ResourceClass", "parameters": [ { "in": "body", @@ -65123,7 +65123,7 @@ "*/*" ], "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedPodSchedulingContextList", + "operationId": "watchResourceV1alpha3NamespacedPodSchedulingContextList", "produces": [ "application/json", "application/yaml", @@ -65200,7 +65200,7 @@ "*/*" ], "description": "watch changes to an object of kind PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedPodSchedulingContext", + "operationId": "watchResourceV1alpha3NamespacedPodSchedulingContext", "produces": [ "application/json", "application/yaml", @@ -65285,7 +65285,7 @@ "*/*" ], "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimList", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimList", "produces": [ "application/json", "application/yaml", @@ -65362,7 +65362,7 @@ "*/*" ], "description": "watch changes to an object of kind ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaim", + "operationId": "watchResourceV1alpha3NamespacedResourceClaim", "produces": [ "application/json", "application/yaml", @@ -65447,7 +65447,7 @@ "*/*" ], "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimTemplateList", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimTemplateList", "produces": [ "application/json", "application/yaml", @@ -65524,7 +65524,7 @@ "*/*" ], "description": "watch changes to an object of kind ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2NamespacedResourceClaimTemplate", + "operationId": "watchResourceV1alpha3NamespacedResourceClaimTemplate", "produces": [ "application/json", "application/yaml", @@ -65609,7 +65609,7 @@ "*/*" ], "description": "watch individual changes to a list of PodSchedulingContext. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2PodSchedulingContextListForAllNamespaces", + "operationId": "watchResourceV1alpha3PodSchedulingContextListForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -65683,7 +65683,7 @@ "*/*" ], "description": "watch individual changes to a list of ResourceClaim. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimListForAllNamespaces", + "operationId": "watchResourceV1alpha3ResourceClaimListForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -65757,7 +65757,7 @@ "*/*" ], "description": "watch individual changes to a list of ResourceClaimTemplate. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClaimTemplateListForAllNamespaces", + "operationId": "watchResourceV1alpha3ResourceClaimTemplateListForAllNamespaces", "produces": [ "application/json", "application/yaml", @@ -65831,7 +65831,7 @@ "*/*" ], "description": "watch individual changes to a list of ResourceClass. deprecated: use the 'watch' parameter with a list operation instead.", - "operationId": "watchResourceV1alpha2ResourceClassList", + "operationId": "watchResourceV1alpha3ResourceClassList", "produces": [ "application/json", "application/yaml", @@ -65905,7 +65905,7 @@ "*/*" ], "description": "watch changes to an object of kind ResourceClass. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", - "operationId": "watchResourceV1alpha2ResourceClass", + "operationId": "watchResourceV1alpha3ResourceClass", "produces": [ "application/json", "application/yaml", diff --git a/staging/src/k8s.io/client-go/applyconfigurations/core/v1/resourceclaim.go b/staging/src/k8s.io/client-go/applyconfigurations/core/v1/resourceclaim.go index a9d79ae3412e8..b00c692485785 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/core/v1/resourceclaim.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/core/v1/resourceclaim.go @@ -21,7 +21,8 @@ package v1 // ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use // with apply. type ResourceClaimApplyConfiguration struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` + Request *string `json:"request,omitempty"` } // ResourceClaimApplyConfiguration constructs a declarative configuration of the ResourceClaim type for use with @@ -37,3 +38,11 @@ func (b *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimA b.Name = &value return b } + +// WithRequest sets the Request 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 Request field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithRequest(value string) *ResourceClaimApplyConfiguration { + b.Request = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/internal/internal.go b/staging/src/k8s.io/client-go/applyconfigurations/internal/internal.go index 0b04331415e72..c986af979b0b4 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/internal/internal.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/internal/internal.go @@ -7409,6 +7409,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: request + type: + scalar: string - name: io.k8s.api.core.v1.ResourceFieldSelector map: fields: @@ -12127,53 +12130,81 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string -- name: io.k8s.api.resource.v1alpha2.AllocationResult +- name: io.k8s.api.resource.v1alpha3.AllocationResult map: fields: - - name: availableOnNodes + - name: controller + type: + scalar: string + - name: devices + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationResult + default: {} + - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector - - name: resourceHandles +- name: io.k8s.api.resource.v1alpha3.BasicDevice + map: + fields: + - name: attributes type: - list: + map: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceHandle - elementRelationship: atomic - - name: shareable + namedType: io.k8s.api.resource.v1alpha3.DeviceAttribute + - name: capacity type: - scalar: boolean -- name: io.k8s.api.resource.v1alpha2.DriverAllocationResult + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1alpha3.CELDeviceSelector map: fields: - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult - - name: vendorRequestParameters + - name: expression type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.DriverRequests + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.Device map: fields: - - name: driverName + - name: basic + type: + namedType: io.k8s.api.resource.v1alpha3.BasicDevice + - name: name type: scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration + map: + fields: + - name: opaque + type: + namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration - name: requests type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceRequest + scalar: string elementRelationship: atomic - - name: vendorParameters + - name: source type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.DeviceAllocationResult map: fields: - - name: name + - name: config type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration + elementRelationship: atomic + - name: results + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceAttribute map: fields: - name: bool @@ -12182,80 +12213,161 @@ var schemaYAML = typed.YAMLObject(`types: - name: int type: scalar: numeric - - name: intSlice - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice - - name: name - type: - scalar: string - default: "" - - name: quantity - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: string type: scalar: string - - name: stringSlice - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice - name: version type: scalar: string -- name: io.k8s.api.resource.v1alpha2.NamedResourcesFilter +- name: io.k8s.api.resource.v1alpha3.DeviceClaim map: fields: - - name: selector + - name: config type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesInstance - map: - fields: - - name: attributes + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration + elementRelationship: atomic + - name: constraints type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute + namedType: io.k8s.api.resource.v1alpha3.DeviceConstraint elementRelationship: atomic - - name: name + - name: requests type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceRequest + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration map: fields: - - name: ints + - name: opaque + type: + namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration + - name: requests type: list: elementType: - scalar: numeric + scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.NamedResourcesRequest +- name: io.k8s.api.resource.v1alpha3.DeviceClass map: fields: - - name: selector + - name: apiVersion type: scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesResources + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceClassSpec + default: {} +- name: io.k8s.api.resource.v1alpha3.DeviceClassConfiguration map: fields: - - name: instances + - name: opaque + type: + namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration +- name: io.k8s.api.resource.v1alpha3.DeviceClassSpec + map: + fields: + - name: config type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesInstance + namedType: io.k8s.api.resource.v1alpha3.DeviceClassConfiguration elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSelector + elementRelationship: atomic + - name: suitableNodes + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.resource.v1alpha3.DeviceConstraint map: fields: - - name: strings + - name: matchAttribute + type: + scalar: string + - name: requests type: list: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.PodSchedulingContext +- name: io.k8s.api.resource.v1alpha3.DeviceRequest + map: + fields: + - name: adminAccess + type: + scalar: boolean + default: false + - name: count + type: + scalar: numeric + - name: countMode + type: + scalar: string + - name: deviceClassName + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSelector + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult + map: + fields: + - name: device + type: + scalar: string + default: "" + - name: driver + type: + scalar: string + default: "" + - name: pool + type: + scalar: string + default: "" + - name: request + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.DeviceSelector + map: + fields: + - name: cel + type: + namedType: io.k8s.api.resource.v1alpha3.CELDeviceSelector +- name: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: parameters + type: + namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1alpha3.PodSchedulingContext map: fields: - name: apiVersion @@ -12270,13 +12382,13 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec + namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec default: {} - name: status type: - namedType: io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus + namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus default: {} -- name: io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec +- name: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec map: fields: - name: potentialNodes @@ -12288,18 +12400,18 @@ var schemaYAML = typed.YAMLObject(`types: - name: selectedNode type: scalar: string -- name: io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus +- name: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus map: fields: - name: resourceClaims type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus elementRelationship: associative keys: - name -- name: io.k8s.api.resource.v1alpha2.ResourceClaim +- name: io.k8s.api.resource.v1alpha3.ResourceClaim map: fields: - name: apiVersion @@ -12314,13 +12426,13 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimSpec + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} - name: status type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimStatus + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimStatus default: {} -- name: io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference +- name: io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference map: fields: - name: apiGroup @@ -12338,91 +12450,47 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.ResourceClaimParameters - map: - fields: - - name: apiVersion - type: - scalar: string - - name: driverRequests - type: - list: - elementType: - namedType: io.k8s.api.resource.v1alpha2.DriverRequests - elementRelationship: atomic - - name: generatedFrom - type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: shareable - type: - scalar: boolean -- name: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference +- name: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus map: fields: - - name: apiGroup - type: - scalar: string - - name: kind - type: - scalar: string - default: "" - name: name type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus - map: - fields: - - name: name - type: - scalar: string - name: unsuitableNodes type: list: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.ResourceClaimSpec +- name: io.k8s.api.resource.v1alpha3.ResourceClaimSpec map: fields: - - name: allocationMode + - name: controller type: scalar: string - - name: parametersRef + - name: devices type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference - - name: resourceClassName - type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha2.ResourceClaimStatus + namedType: io.k8s.api.resource.v1alpha3.DeviceClaim + default: {} +- name: io.k8s.api.resource.v1alpha3.ResourceClaimStatus map: fields: - name: allocation type: - namedType: io.k8s.api.resource.v1alpha2.AllocationResult + namedType: io.k8s.api.resource.v1alpha3.AllocationResult - name: deallocationRequested type: scalar: boolean - - name: driverName - type: - scalar: string - name: reservedFor type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference elementRelationship: associative keys: - uid -- name: io.k8s.api.resource.v1alpha2.ResourceClaimTemplate +- name: io.k8s.api.resource.v1alpha3.ResourceClaimTemplate map: fields: - name: apiVersion @@ -12437,9 +12505,9 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec default: {} -- name: io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec +- name: io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec map: fields: - name: metadata @@ -12448,120 +12516,29 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimSpec - default: {} -- name: io.k8s.api.resource.v1alpha2.ResourceClass - map: - fields: - - name: apiVersion - type: - scalar: string - - name: driverName - type: - scalar: string - default: "" - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: parametersRef - type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference - - name: structuredParameters - type: - scalar: boolean - - name: suitableNodes - type: - namedType: io.k8s.api.core.v1.NodeSelector -- name: io.k8s.api.resource.v1alpha2.ResourceClassParameters - map: - fields: - - name: apiVersion - type: - scalar: string - - name: filters - type: - list: - elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceFilter - elementRelationship: atomic - - name: generatedFrom - type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} - - name: vendorParameters - type: - list: - elementType: - namedType: io.k8s.api.resource.v1alpha2.VendorParameters - elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference +- name: io.k8s.api.resource.v1alpha3.ResourcePool map: fields: - - name: apiGroup - type: - scalar: string - - name: kind + - name: generation type: - scalar: string - default: "" + scalar: numeric + default: 0 - name: name type: scalar: string default: "" - - name: namespace - type: - scalar: string -- name: io.k8s.api.resource.v1alpha2.ResourceFilter - map: - fields: - - name: driverName - type: - scalar: string - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesFilter -- name: io.k8s.api.resource.v1alpha2.ResourceHandle - map: - fields: - - name: data - type: - scalar: string - - name: driverName - type: - scalar: string - default: "" - - name: structuredData + - name: resourceSliceCount type: - namedType: io.k8s.api.resource.v1alpha2.StructuredResourceHandle -- name: io.k8s.api.resource.v1alpha2.ResourceRequest - map: - fields: - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesRequest - - name: vendorParameters - type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.ResourceSlice + scalar: numeric + default: 0 +- name: io.k8s.api.resource.v1alpha3.ResourceSlice map: fields: - name: apiVersion type: scalar: string - - name: driverName - type: - scalar: string - default: "" - name: kind type: scalar: string @@ -12569,39 +12546,36 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesResources - - name: nodeName + - name: spec type: - scalar: string -- name: io.k8s.api.resource.v1alpha2.StructuredResourceHandle + namedType: io.k8s.api.resource.v1alpha3.ResourceSliceSpec + default: {} +- name: io.k8s.api.resource.v1alpha3.ResourceSliceSpec map: fields: - - name: nodeName + - name: allNodes type: - scalar: string - - name: results + scalar: boolean + - name: devices type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.DriverAllocationResult + namedType: io.k8s.api.resource.v1alpha3.Device elementRelationship: atomic - - name: vendorClaimParameters - type: - namedType: __untyped_atomic_ - - name: vendorClassParameters + - name: driver type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.VendorParameters - map: - fields: - - name: driverName + scalar: string + default: "" + - name: nodeName type: scalar: string - - name: parameters + - name: nodeSelector type: - namedType: __untyped_atomic_ + namedType: io.k8s.api.core.v1.NodeSelector + - name: pool + type: + namedType: io.k8s.api.resource.v1alpha3.ResourcePool + default: {} - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresult.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresult.go deleted file mode 100644 index 7eef3845973d4..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresult.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "k8s.io/client-go/applyconfigurations/core/v1" -) - -// AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use -// with apply. -type AllocationResultApplyConfiguration struct { - ResourceHandles []ResourceHandleApplyConfiguration `json:"resourceHandles,omitempty"` - AvailableOnNodes *v1.NodeSelectorApplyConfiguration `json:"availableOnNodes,omitempty"` - Shareable *bool `json:"shareable,omitempty"` -} - -// AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with -// apply. -func AllocationResult() *AllocationResultApplyConfiguration { - return &AllocationResultApplyConfiguration{} -} - -// WithResourceHandles adds the given value to the ResourceHandles 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 ResourceHandles field. -func (b *AllocationResultApplyConfiguration) WithResourceHandles(values ...*ResourceHandleApplyConfiguration) *AllocationResultApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResourceHandles") - } - b.ResourceHandles = append(b.ResourceHandles, *values[i]) - } - return b -} - -// WithAvailableOnNodes sets the AvailableOnNodes 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 AvailableOnNodes field is set to the value of the last call. -func (b *AllocationResultApplyConfiguration) WithAvailableOnNodes(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration { - b.AvailableOnNodes = value - return b -} - -// WithShareable sets the Shareable 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 Shareable field is set to the value of the last call. -func (b *AllocationResultApplyConfiguration) WithShareable(value bool) *AllocationResultApplyConfiguration { - b.Shareable = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresultmodel.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresultmodel.go deleted file mode 100644 index 3250fd5d116cb..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresultmodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// AllocationResultModelApplyConfiguration represents a declarative configuration of the AllocationResultModel type for use -// with apply. -type AllocationResultModelApplyConfiguration struct { - NamedResources *NamedResourcesAllocationResultApplyConfiguration `json:"namedResources,omitempty"` -} - -// AllocationResultModelApplyConfiguration constructs a declarative configuration of the AllocationResultModel type for use with -// apply. -func AllocationResultModel() *AllocationResultModelApplyConfiguration { - return &AllocationResultModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *AllocationResultModelApplyConfiguration) WithNamedResources(value *NamedResourcesAllocationResultApplyConfiguration) *AllocationResultModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverallocationresult.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverallocationresult.go deleted file mode 100644 index f44db7921caa2..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverallocationresult.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DriverAllocationResultApplyConfiguration represents a declarative configuration of the DriverAllocationResult type for use -// with apply. -type DriverAllocationResultApplyConfiguration struct { - VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"` - AllocationResultModelApplyConfiguration `json:",inline"` -} - -// DriverAllocationResultApplyConfiguration constructs a declarative configuration of the DriverAllocationResult type for use with -// apply. -func DriverAllocationResult() *DriverAllocationResultApplyConfiguration { - return &DriverAllocationResultApplyConfiguration{} -} - -// WithVendorRequestParameters sets the VendorRequestParameters 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 VendorRequestParameters field is set to the value of the last call. -func (b *DriverAllocationResultApplyConfiguration) WithVendorRequestParameters(value runtime.RawExtension) *DriverAllocationResultApplyConfiguration { - b.VendorRequestParameters = &value - return b -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *DriverAllocationResultApplyConfiguration) WithNamedResources(value *NamedResourcesAllocationResultApplyConfiguration) *DriverAllocationResultApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverrequests.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverrequests.go deleted file mode 100644 index 79cc04c2452f3..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/driverrequests.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DriverRequestsApplyConfiguration represents a declarative configuration of the DriverRequests type for use -// with apply. -type DriverRequestsApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` - Requests []ResourceRequestApplyConfiguration `json:"requests,omitempty"` -} - -// DriverRequestsApplyConfiguration constructs a declarative configuration of the DriverRequests type for use with -// apply. -func DriverRequests() *DriverRequestsApplyConfiguration { - return &DriverRequestsApplyConfiguration{} -} - -// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. -func (b *DriverRequestsApplyConfiguration) WithDriverName(value string) *DriverRequestsApplyConfiguration { - b.DriverName = &value - return b -} - -// WithVendorParameters sets the VendorParameters 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 VendorParameters field is set to the value of the last call. -func (b *DriverRequestsApplyConfiguration) WithVendorParameters(value runtime.RawExtension) *DriverRequestsApplyConfiguration { - b.VendorParameters = &value - return b -} - -// WithRequests adds the given value to the Requests 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 Requests field. -func (b *DriverRequestsApplyConfiguration) WithRequests(values ...*ResourceRequestApplyConfiguration) *DriverRequestsApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithRequests") - } - b.Requests = append(b.Requests, *values[i]) - } - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go deleted file mode 100644 index 38df3195b1219..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NamedResourcesAttributeApplyConfiguration represents a declarative configuration of the NamedResourcesAttribute type for use -// with apply. -type NamedResourcesAttributeApplyConfiguration struct { - Name *string `json:"name,omitempty"` - NamedResourcesAttributeValueApplyConfiguration `json:",inline"` -} - -// NamedResourcesAttributeApplyConfiguration constructs a declarative configuration of the NamedResourcesAttribute type for use with -// apply. -func NamedResourcesAttribute() *NamedResourcesAttributeApplyConfiguration { - return &NamedResourcesAttributeApplyConfiguration{} -} - -// 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 *NamedResourcesAttributeApplyConfiguration) WithName(value string) *NamedResourcesAttributeApplyConfiguration { - b.Name = &value - return b -} - -// WithQuantityValue sets the QuantityValue 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 QuantityValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithQuantityValue(value resource.Quantity) *NamedResourcesAttributeApplyConfiguration { - b.QuantityValue = &value - return b -} - -// WithBoolValue sets the BoolValue 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 BoolValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithBoolValue(value bool) *NamedResourcesAttributeApplyConfiguration { - b.BoolValue = &value - return b -} - -// WithIntValue sets the IntValue 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 IntValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithIntValue(value int64) *NamedResourcesAttributeApplyConfiguration { - b.IntValue = &value - return b -} - -// WithIntSliceValue sets the IntSliceValue 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 IntSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithIntSliceValue(value *NamedResourcesIntSliceApplyConfiguration) *NamedResourcesAttributeApplyConfiguration { - b.IntSliceValue = value - return b -} - -// WithStringValue sets the StringValue 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 StringValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithStringValue(value string) *NamedResourcesAttributeApplyConfiguration { - b.StringValue = &value - return b -} - -// WithStringSliceValue sets the StringSliceValue 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 StringSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithStringSliceValue(value *NamedResourcesStringSliceApplyConfiguration) *NamedResourcesAttributeApplyConfiguration { - b.StringSliceValue = value - return b -} - -// WithVersionValue sets the VersionValue 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 VersionValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithVersionValue(value string) *NamedResourcesAttributeApplyConfiguration { - b.VersionValue = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go deleted file mode 100644 index d9ef2682e3b98..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NamedResourcesAttributeValueApplyConfiguration represents a declarative configuration of the NamedResourcesAttributeValue type for use -// with apply. -type NamedResourcesAttributeValueApplyConfiguration struct { - QuantityValue *resource.Quantity `json:"quantity,omitempty"` - BoolValue *bool `json:"bool,omitempty"` - IntValue *int64 `json:"int,omitempty"` - IntSliceValue *NamedResourcesIntSliceApplyConfiguration `json:"intSlice,omitempty"` - StringValue *string `json:"string,omitempty"` - StringSliceValue *NamedResourcesStringSliceApplyConfiguration `json:"stringSlice,omitempty"` - VersionValue *string `json:"version,omitempty"` -} - -// NamedResourcesAttributeValueApplyConfiguration constructs a declarative configuration of the NamedResourcesAttributeValue type for use with -// apply. -func NamedResourcesAttributeValue() *NamedResourcesAttributeValueApplyConfiguration { - return &NamedResourcesAttributeValueApplyConfiguration{} -} - -// WithQuantityValue sets the QuantityValue 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 QuantityValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithQuantityValue(value resource.Quantity) *NamedResourcesAttributeValueApplyConfiguration { - b.QuantityValue = &value - return b -} - -// WithBoolValue sets the BoolValue 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 BoolValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithBoolValue(value bool) *NamedResourcesAttributeValueApplyConfiguration { - b.BoolValue = &value - return b -} - -// WithIntValue sets the IntValue 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 IntValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithIntValue(value int64) *NamedResourcesAttributeValueApplyConfiguration { - b.IntValue = &value - return b -} - -// WithIntSliceValue sets the IntSliceValue 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 IntSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithIntSliceValue(value *NamedResourcesIntSliceApplyConfiguration) *NamedResourcesAttributeValueApplyConfiguration { - b.IntSliceValue = value - return b -} - -// WithStringValue sets the StringValue 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 StringValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringValue(value string) *NamedResourcesAttributeValueApplyConfiguration { - b.StringValue = &value - return b -} - -// WithStringSliceValue sets the StringSliceValue 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 StringSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringSliceValue(value *NamedResourcesStringSliceApplyConfiguration) *NamedResourcesAttributeValueApplyConfiguration { - b.StringSliceValue = value - return b -} - -// WithVersionValue sets the VersionValue 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 VersionValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithVersionValue(value string) *NamedResourcesAttributeValueApplyConfiguration { - b.VersionValue = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go deleted file mode 100644 index 439eb066358bb..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// NamedResourcesFilterApplyConfiguration represents a declarative configuration of the NamedResourcesFilter type for use -// with apply. -type NamedResourcesFilterApplyConfiguration struct { - Selector *string `json:"selector,omitempty"` -} - -// NamedResourcesFilterApplyConfiguration constructs a declarative configuration of the NamedResourcesFilter type for use with -// apply. -func NamedResourcesFilter() *NamedResourcesFilterApplyConfiguration { - return &NamedResourcesFilterApplyConfiguration{} -} - -// WithSelector sets the Selector 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 Selector field is set to the value of the last call. -func (b *NamedResourcesFilterApplyConfiguration) WithSelector(value string) *NamedResourcesFilterApplyConfiguration { - b.Selector = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go deleted file mode 100644 index 4ec6fd7ab6f20..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// NamedResourcesInstanceApplyConfiguration represents a declarative configuration of the NamedResourcesInstance type for use -// with apply. -type NamedResourcesInstanceApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Attributes []NamedResourcesAttributeApplyConfiguration `json:"attributes,omitempty"` -} - -// NamedResourcesInstanceApplyConfiguration constructs a declarative configuration of the NamedResourcesInstance type for use with -// apply. -func NamedResourcesInstance() *NamedResourcesInstanceApplyConfiguration { - return &NamedResourcesInstanceApplyConfiguration{} -} - -// 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 *NamedResourcesInstanceApplyConfiguration) WithName(value string) *NamedResourcesInstanceApplyConfiguration { - b.Name = &value - return b -} - -// WithAttributes adds the given value to the Attributes 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 Attributes field. -func (b *NamedResourcesInstanceApplyConfiguration) WithAttributes(values ...*NamedResourcesAttributeApplyConfiguration) *NamedResourcesInstanceApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithAttributes") - } - b.Attributes = append(b.Attributes, *values[i]) - } - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go deleted file mode 100644 index f3d74e7b9c19d..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// NamedResourcesIntSliceApplyConfiguration represents a declarative configuration of the NamedResourcesIntSlice type for use -// with apply. -type NamedResourcesIntSliceApplyConfiguration struct { - Ints []int64 `json:"ints,omitempty"` -} - -// NamedResourcesIntSliceApplyConfiguration constructs a declarative configuration of the NamedResourcesIntSlice type for use with -// apply. -func NamedResourcesIntSlice() *NamedResourcesIntSliceApplyConfiguration { - return &NamedResourcesIntSliceApplyConfiguration{} -} - -// WithInts adds the given value to the Ints 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 Ints field. -func (b *NamedResourcesIntSliceApplyConfiguration) WithInts(values ...int64) *NamedResourcesIntSliceApplyConfiguration { - for i := range values { - b.Ints = append(b.Ints, values[i]) - } - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go deleted file mode 100644 index b0722df48c394..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// NamedResourcesRequestApplyConfiguration represents a declarative configuration of the NamedResourcesRequest type for use -// with apply. -type NamedResourcesRequestApplyConfiguration struct { - Selector *string `json:"selector,omitempty"` -} - -// NamedResourcesRequestApplyConfiguration constructs a declarative configuration of the NamedResourcesRequest type for use with -// apply. -func NamedResourcesRequest() *NamedResourcesRequestApplyConfiguration { - return &NamedResourcesRequestApplyConfiguration{} -} - -// WithSelector sets the Selector 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 Selector field is set to the value of the last call. -func (b *NamedResourcesRequestApplyConfiguration) WithSelector(value string) *NamedResourcesRequestApplyConfiguration { - b.Selector = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesresources.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesresources.go deleted file mode 100644 index 0ef0565552efe..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesresources.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// NamedResourcesResourcesApplyConfiguration represents a declarative configuration of the NamedResourcesResources type for use -// with apply. -type NamedResourcesResourcesApplyConfiguration struct { - Instances []NamedResourcesInstanceApplyConfiguration `json:"instances,omitempty"` -} - -// NamedResourcesResourcesApplyConfiguration constructs a declarative configuration of the NamedResourcesResources type for use with -// apply. -func NamedResourcesResources() *NamedResourcesResourcesApplyConfiguration { - return &NamedResourcesResourcesApplyConfiguration{} -} - -// WithInstances adds the given value to the Instances 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 Instances field. -func (b *NamedResourcesResourcesApplyConfiguration) WithInstances(values ...*NamedResourcesInstanceApplyConfiguration) *NamedResourcesResourcesApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithInstances") - } - b.Instances = append(b.Instances, *values[i]) - } - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go deleted file mode 100644 index 27295b89642c8..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// NamedResourcesStringSliceApplyConfiguration represents a declarative configuration of the NamedResourcesStringSlice type for use -// with apply. -type NamedResourcesStringSliceApplyConfiguration struct { - Strings []string `json:"strings,omitempty"` -} - -// NamedResourcesStringSliceApplyConfiguration constructs a declarative configuration of the NamedResourcesStringSlice type for use with -// apply. -func NamedResourcesStringSlice() *NamedResourcesStringSliceApplyConfiguration { - return &NamedResourcesStringSliceApplyConfiguration{} -} - -// WithStrings adds the given value to the Strings 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 Strings field. -func (b *NamedResourcesStringSliceApplyConfiguration) WithStrings(values ...string) *NamedResourcesStringSliceApplyConfiguration { - for i := range values { - b.Strings = append(b.Strings, values[i]) - } - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go deleted file mode 100644 index b3a2be9c84c79..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go +++ /dev/null @@ -1,278 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ResourceClaimParametersApplyConfiguration represents a declarative configuration of the ResourceClaimParameters type for use -// with apply. -type ResourceClaimParametersApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - GeneratedFrom *ResourceClaimParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"` - Shareable *bool `json:"shareable,omitempty"` - DriverRequests []DriverRequestsApplyConfiguration `json:"driverRequests,omitempty"` -} - -// ResourceClaimParameters constructs a declarative configuration of the ResourceClaimParameters type for use with -// apply. -func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApplyConfiguration { - b := &ResourceClaimParametersApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("ResourceClaimParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") - return b -} - -// ExtractResourceClaimParameters extracts the applied configuration owned by fieldManager from -// resourceClaimParameters. If no managedFields are found in resourceClaimParameters for fieldManager, a -// ResourceClaimParametersApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// resourceClaimParameters must be a unmodified ResourceClaimParameters API object that was retrieved from the Kubernetes API. -// ExtractResourceClaimParameters provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { - return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "") -} - -// ExtractResourceClaimParametersStatus is the same as ExtractResourceClaimParameters except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractResourceClaimParametersStatus(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { - return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "status") -} - -func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string, subresource string) (*ResourceClaimParametersApplyConfiguration, error) { - b := &ResourceClaimParametersApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaimParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaimParameters"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(resourceClaimParameters.Name) - b.WithNamespace(resourceClaimParameters.Namespace) - - b.WithKind("ResourceClaimParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithKind(value string) *ResourceClaimParametersApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClaimParametersApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithName(value string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithGenerateName(value string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithNamespace(value string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithUID(value types.UID) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithGeneration(value int64) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ResourceClaimParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ResourceClaimParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ResourceClaimParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ResourceClaimParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ResourceClaimParametersApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithGeneratedFrom sets the GeneratedFrom 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 GeneratedFrom field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClaimParametersReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration { - b.GeneratedFrom = value - return b -} - -// WithShareable sets the Shareable 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 Shareable field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithShareable(value bool) *ResourceClaimParametersApplyConfiguration { - b.Shareable = &value - return b -} - -// WithDriverRequests adds the given value to the DriverRequests 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 DriverRequests field. -func (b *ResourceClaimParametersApplyConfiguration) WithDriverRequests(values ...*DriverRequestsApplyConfiguration) *ResourceClaimParametersApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithDriverRequests") - } - b.DriverRequests = append(b.DriverRequests, *values[i]) - } - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *ResourceClaimParametersApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go deleted file mode 100644 index 7900152ca2345..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceClaimParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimParametersReference type for use -// with apply. -type ResourceClaimParametersReferenceApplyConfiguration struct { - APIGroup *string `json:"apiGroup,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` -} - -// ResourceClaimParametersReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimParametersReference type for use with -// apply. -func ResourceClaimParametersReference() *ResourceClaimParametersReferenceApplyConfiguration { - return &ResourceClaimParametersReferenceApplyConfiguration{} -} - -// WithAPIGroup sets the APIGroup 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 APIGroup field is set to the value of the last call. -func (b *ResourceClaimParametersReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClaimParametersReferenceApplyConfiguration { - b.APIGroup = &value - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClaimParametersReferenceApplyConfiguration) WithKind(value string) *ResourceClaimParametersReferenceApplyConfiguration { - b.Kind = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClaimParametersReferenceApplyConfiguration) WithName(value string) *ResourceClaimParametersReferenceApplyConfiguration { - b.Name = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimspec.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimspec.go deleted file mode 100644 index 2ecd95ec82d0d..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimspec.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" -) - -// ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use -// with apply. -type ResourceClaimSpecApplyConfiguration struct { - ResourceClassName *string `json:"resourceClassName,omitempty"` - ParametersRef *ResourceClaimParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` - AllocationMode *resourcev1alpha2.AllocationMode `json:"allocationMode,omitempty"` -} - -// ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with -// apply. -func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration { - return &ResourceClaimSpecApplyConfiguration{} -} - -// WithResourceClassName sets the ResourceClassName 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 ResourceClassName field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithResourceClassName(value string) *ResourceClaimSpecApplyConfiguration { - b.ResourceClassName = &value - return b -} - -// WithParametersRef sets the ParametersRef 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 ParametersRef field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithParametersRef(value *ResourceClaimParametersReferenceApplyConfiguration) *ResourceClaimSpecApplyConfiguration { - b.ParametersRef = value - return b -} - -// WithAllocationMode sets the AllocationMode 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 AllocationMode field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithAllocationMode(value resourcev1alpha2.AllocationMode) *ResourceClaimSpecApplyConfiguration { - b.AllocationMode = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclass.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclass.go deleted file mode 100644 index cf559cfb22d45..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclass.go +++ /dev/null @@ -1,281 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ResourceClassApplyConfiguration represents a declarative configuration of the ResourceClass type for use -// with apply. -type ResourceClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - DriverName *string `json:"driverName,omitempty"` - ParametersRef *ResourceClassParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` - SuitableNodes *corev1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"` - StructuredParameters *bool `json:"structuredParameters,omitempty"` -} - -// ResourceClass constructs a declarative configuration of the ResourceClass type for use with -// apply. -func ResourceClass(name string) *ResourceClassApplyConfiguration { - b := &ResourceClassApplyConfiguration{} - b.WithName(name) - b.WithKind("ResourceClass") - b.WithAPIVersion("resource.k8s.io/v1alpha2") - return b -} - -// ExtractResourceClass extracts the applied configuration owned by fieldManager from -// resourceClass. If no managedFields are found in resourceClass for fieldManager, a -// ResourceClassApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// resourceClass must be a unmodified ResourceClass API object that was retrieved from the Kubernetes API. -// ExtractResourceClass provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractResourceClass(resourceClass *resourcev1alpha2.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { - return extractResourceClass(resourceClass, fieldManager, "") -} - -// ExtractResourceClassStatus is the same as ExtractResourceClass except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractResourceClassStatus(resourceClass *resourcev1alpha2.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { - return extractResourceClass(resourceClass, fieldManager, "status") -} - -func extractResourceClass(resourceClass *resourcev1alpha2.ResourceClass, fieldManager string, subresource string) (*ResourceClassApplyConfiguration, error) { - b := &ResourceClassApplyConfiguration{} - err := managedfields.ExtractInto(resourceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClass"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(resourceClass.Name) - - b.WithKind("ResourceClass") - b.WithAPIVersion("resource.k8s.io/v1alpha2") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithKind(value string) *ResourceClassApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithAPIVersion(value string) *ResourceClassApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithName(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithGenerateName(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithNamespace(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithUID(value types.UID) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithResourceVersion(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithGeneration(value int64) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ResourceClassApplyConfiguration) WithLabels(entries map[string]string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ResourceClassApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ResourceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ResourceClassApplyConfiguration) WithFinalizers(values ...string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ResourceClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithDriverName(value string) *ResourceClassApplyConfiguration { - b.DriverName = &value - return b -} - -// WithParametersRef sets the ParametersRef 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 ParametersRef field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithParametersRef(value *ResourceClassParametersReferenceApplyConfiguration) *ResourceClassApplyConfiguration { - b.ParametersRef = value - return b -} - -// WithSuitableNodes sets the SuitableNodes 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 SuitableNodes field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithSuitableNodes(value *corev1.NodeSelectorApplyConfiguration) *ResourceClassApplyConfiguration { - b.SuitableNodes = value - return b -} - -// WithStructuredParameters sets the StructuredParameters 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 StructuredParameters field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithStructuredParameters(value bool) *ResourceClassApplyConfiguration { - b.StructuredParameters = &value - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *ResourceClassApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparameters.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparameters.go deleted file mode 100644 index e09b1ed4e0b64..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparameters.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ResourceClassParametersApplyConfiguration represents a declarative configuration of the ResourceClassParameters type for use -// with apply. -type ResourceClassParametersApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - GeneratedFrom *ResourceClassParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"` - VendorParameters []VendorParametersApplyConfiguration `json:"vendorParameters,omitempty"` - Filters []ResourceFilterApplyConfiguration `json:"filters,omitempty"` -} - -// ResourceClassParameters constructs a declarative configuration of the ResourceClassParameters type for use with -// apply. -func ResourceClassParameters(name, namespace string) *ResourceClassParametersApplyConfiguration { - b := &ResourceClassParametersApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("ResourceClassParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") - return b -} - -// ExtractResourceClassParameters extracts the applied configuration owned by fieldManager from -// resourceClassParameters. If no managedFields are found in resourceClassParameters for fieldManager, a -// ResourceClassParametersApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// resourceClassParameters must be a unmodified ResourceClassParameters API object that was retrieved from the Kubernetes API. -// ExtractResourceClassParameters provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractResourceClassParameters(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { - return extractResourceClassParameters(resourceClassParameters, fieldManager, "") -} - -// ExtractResourceClassParametersStatus is the same as ExtractResourceClassParameters except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractResourceClassParametersStatus(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { - return extractResourceClassParameters(resourceClassParameters, fieldManager, "status") -} - -func extractResourceClassParameters(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string, subresource string) (*ResourceClassParametersApplyConfiguration, error) { - b := &ResourceClassParametersApplyConfiguration{} - err := managedfields.ExtractInto(resourceClassParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClassParameters"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(resourceClassParameters.Name) - b.WithNamespace(resourceClassParameters.Namespace) - - b.WithKind("ResourceClassParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithKind(value string) *ResourceClassParametersApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClassParametersApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithName(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithGenerateName(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithNamespace(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithUID(value types.UID) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithGeneration(value int64) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ResourceClassParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ResourceClassParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ResourceClassParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ResourceClassParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ResourceClassParametersApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithGeneratedFrom sets the GeneratedFrom 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 GeneratedFrom field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClassParametersReferenceApplyConfiguration) *ResourceClassParametersApplyConfiguration { - b.GeneratedFrom = value - return b -} - -// WithVendorParameters adds the given value to the VendorParameters 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 VendorParameters field. -func (b *ResourceClassParametersApplyConfiguration) WithVendorParameters(values ...*VendorParametersApplyConfiguration) *ResourceClassParametersApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithVendorParameters") - } - b.VendorParameters = append(b.VendorParameters, *values[i]) - } - return b -} - -// WithFilters adds the given value to the Filters 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 Filters field. -func (b *ResourceClassParametersApplyConfiguration) WithFilters(values ...*ResourceFilterApplyConfiguration) *ResourceClassParametersApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithFilters") - } - b.Filters = append(b.Filters, *values[i]) - } - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *ResourceClassParametersApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go deleted file mode 100644 index 052d7365e00db..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceClassParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClassParametersReference type for use -// with apply. -type ResourceClassParametersReferenceApplyConfiguration struct { - APIGroup *string `json:"apiGroup,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` -} - -// ResourceClassParametersReferenceApplyConfiguration constructs a declarative configuration of the ResourceClassParametersReference type for use with -// apply. -func ResourceClassParametersReference() *ResourceClassParametersReferenceApplyConfiguration { - return &ResourceClassParametersReferenceApplyConfiguration{} -} - -// WithAPIGroup sets the APIGroup 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 APIGroup field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.APIGroup = &value - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithKind(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.Kind = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithName(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.Name = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithNamespace(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.Namespace = &value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefilter.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefilter.go deleted file mode 100644 index 1617275f0ee5e..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefilter.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceFilterApplyConfiguration represents a declarative configuration of the ResourceFilter type for use -// with apply. -type ResourceFilterApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - ResourceFilterModelApplyConfiguration `json:",inline"` -} - -// ResourceFilterApplyConfiguration constructs a declarative configuration of the ResourceFilter type for use with -// apply. -func ResourceFilter() *ResourceFilterApplyConfiguration { - return &ResourceFilterApplyConfiguration{} -} - -// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. -func (b *ResourceFilterApplyConfiguration) WithDriverName(value string) *ResourceFilterApplyConfiguration { - b.DriverName = &value - return b -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *ResourceFilterApplyConfiguration) WithNamedResources(value *NamedResourcesFilterApplyConfiguration) *ResourceFilterApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go deleted file mode 100644 index 648d319d46412..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceFilterModelApplyConfiguration represents a declarative configuration of the ResourceFilterModel type for use -// with apply. -type ResourceFilterModelApplyConfiguration struct { - NamedResources *NamedResourcesFilterApplyConfiguration `json:"namedResources,omitempty"` -} - -// ResourceFilterModelApplyConfiguration constructs a declarative configuration of the ResourceFilterModel type for use with -// apply. -func ResourceFilterModel() *ResourceFilterModelApplyConfiguration { - return &ResourceFilterModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *ResourceFilterModelApplyConfiguration) WithNamedResources(value *NamedResourcesFilterApplyConfiguration) *ResourceFilterModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcehandle.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcehandle.go deleted file mode 100644 index 9a8410d9ed313..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcehandle.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceHandleApplyConfiguration represents a declarative configuration of the ResourceHandle type for use -// with apply. -type ResourceHandleApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - Data *string `json:"data,omitempty"` - StructuredData *StructuredResourceHandleApplyConfiguration `json:"structuredData,omitempty"` -} - -// ResourceHandleApplyConfiguration constructs a declarative configuration of the ResourceHandle type for use with -// apply. -func ResourceHandle() *ResourceHandleApplyConfiguration { - return &ResourceHandleApplyConfiguration{} -} - -// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. -func (b *ResourceHandleApplyConfiguration) WithDriverName(value string) *ResourceHandleApplyConfiguration { - b.DriverName = &value - return b -} - -// WithData sets the Data 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 Data field is set to the value of the last call. -func (b *ResourceHandleApplyConfiguration) WithData(value string) *ResourceHandleApplyConfiguration { - b.Data = &value - return b -} - -// WithStructuredData sets the StructuredData 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 StructuredData field is set to the value of the last call. -func (b *ResourceHandleApplyConfiguration) WithStructuredData(value *StructuredResourceHandleApplyConfiguration) *ResourceHandleApplyConfiguration { - b.StructuredData = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcemodel.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcemodel.go deleted file mode 100644 index b3c8540d4fe7d..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcemodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceModelApplyConfiguration represents a declarative configuration of the ResourceModel type for use -// with apply. -type ResourceModelApplyConfiguration struct { - NamedResources *NamedResourcesResourcesApplyConfiguration `json:"namedResources,omitempty"` -} - -// ResourceModelApplyConfiguration constructs a declarative configuration of the ResourceModel type for use with -// apply. -func ResourceModel() *ResourceModelApplyConfiguration { - return &ResourceModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *ResourceModelApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequest.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequest.go deleted file mode 100644 index b93ed85402744..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequest.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// ResourceRequestApplyConfiguration represents a declarative configuration of the ResourceRequest type for use -// with apply. -type ResourceRequestApplyConfiguration struct { - VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` - ResourceRequestModelApplyConfiguration `json:",inline"` -} - -// ResourceRequestApplyConfiguration constructs a declarative configuration of the ResourceRequest type for use with -// apply. -func ResourceRequest() *ResourceRequestApplyConfiguration { - return &ResourceRequestApplyConfiguration{} -} - -// WithVendorParameters sets the VendorParameters 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 VendorParameters field is set to the value of the last call. -func (b *ResourceRequestApplyConfiguration) WithVendorParameters(value runtime.RawExtension) *ResourceRequestApplyConfiguration { - b.VendorParameters = &value - return b -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *ResourceRequestApplyConfiguration) WithNamedResources(value *NamedResourcesRequestApplyConfiguration) *ResourceRequestApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go deleted file mode 100644 index b0e86483eb5c1..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// ResourceRequestModelApplyConfiguration represents a declarative configuration of the ResourceRequestModel type for use -// with apply. -type ResourceRequestModelApplyConfiguration struct { - NamedResources *NamedResourcesRequestApplyConfiguration `json:"namedResources,omitempty"` -} - -// ResourceRequestModelApplyConfiguration constructs a declarative configuration of the ResourceRequestModel type for use with -// apply. -func ResourceRequestModel() *ResourceRequestModelApplyConfiguration { - return &ResourceRequestModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *ResourceRequestModelApplyConfiguration) WithNamedResources(value *NamedResourcesRequestApplyConfiguration) *ResourceRequestModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go deleted file mode 100644 index 10794f81f299a..0000000000000 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// StructuredResourceHandleApplyConfiguration represents a declarative configuration of the StructuredResourceHandle type for use -// with apply. -type StructuredResourceHandleApplyConfiguration struct { - VendorClassParameters *runtime.RawExtension `json:"vendorClassParameters,omitempty"` - VendorClaimParameters *runtime.RawExtension `json:"vendorClaimParameters,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - Results []DriverAllocationResultApplyConfiguration `json:"results,omitempty"` -} - -// StructuredResourceHandleApplyConfiguration constructs a declarative configuration of the StructuredResourceHandle type for use with -// apply. -func StructuredResourceHandle() *StructuredResourceHandleApplyConfiguration { - return &StructuredResourceHandleApplyConfiguration{} -} - -// WithVendorClassParameters sets the VendorClassParameters 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 VendorClassParameters field is set to the value of the last call. -func (b *StructuredResourceHandleApplyConfiguration) WithVendorClassParameters(value runtime.RawExtension) *StructuredResourceHandleApplyConfiguration { - b.VendorClassParameters = &value - return b -} - -// WithVendorClaimParameters sets the VendorClaimParameters 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 VendorClaimParameters field is set to the value of the last call. -func (b *StructuredResourceHandleApplyConfiguration) WithVendorClaimParameters(value runtime.RawExtension) *StructuredResourceHandleApplyConfiguration { - b.VendorClaimParameters = &value - return b -} - -// WithNodeName sets the NodeName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NodeName field is set to the value of the last call. -func (b *StructuredResourceHandleApplyConfiguration) WithNodeName(value string) *StructuredResourceHandleApplyConfiguration { - b.NodeName = &value - return b -} - -// WithResults adds the given value to the Results 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 Results field. -func (b *StructuredResourceHandleApplyConfiguration) WithResults(values ...*DriverAllocationResultApplyConfiguration) *StructuredResourceHandleApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResults") - } - b.Results = append(b.Results, *values[i]) - } - return b -} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/allocationresult.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/allocationresult.go new file mode 100644 index 0000000000000..3090b2f9d3538 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/allocationresult.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use +// with apply. +type AllocationResultApplyConfiguration struct { + Devices *DeviceAllocationResultApplyConfiguration `json:"devices,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + Controller *string `json:"controller,omitempty"` +} + +// AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with +// apply. +func AllocationResult() *AllocationResultApplyConfiguration { + return &AllocationResultApplyConfiguration{} +} + +// WithDevices sets the Devices 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 Devices field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithDevices(value *DeviceAllocationResultApplyConfiguration) *AllocationResultApplyConfiguration { + b.Devices = 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 *AllocationResultApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithController sets the Controller 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 Controller field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithController(value string) *AllocationResultApplyConfiguration { + b.Controller = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go new file mode 100644 index 0000000000000..e6b7745082855 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go @@ -0,0 +1,65 @@ +/* +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 ( + v1alpha3 "k8s.io/api/resource/v1alpha3" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use +// with apply. +type BasicDeviceApplyConfiguration struct { + Attributes map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` + Capacity map[v1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"` +} + +// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with +// apply. +func BasicDevice() *BasicDeviceApplyConfiguration { + return &BasicDeviceApplyConfiguration{} +} + +// WithAttributes puts the entries into the Attributes 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 Attributes field, +// overwriting an existing map entries in Attributes field with the same key. +func (b *BasicDeviceApplyConfiguration) WithAttributes(entries map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration) *BasicDeviceApplyConfiguration { + if b.Attributes == nil && len(entries) > 0 { + b.Attributes = make(map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Attributes[k] = v + } + return b +} + +// WithCapacity puts the entries into the Capacity 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 Capacity field, +// overwriting an existing map entries in Capacity field with the same key. +func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[v1alpha3.QualifiedName]resource.Quantity) *BasicDeviceApplyConfiguration { + if b.Capacity == nil && len(entries) > 0 { + b.Capacity = make(map[v1alpha3.QualifiedName]resource.Quantity, len(entries)) + } + for k, v := range entries { + b.Capacity[k] = v + } + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/celdeviceselector.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/celdeviceselector.go new file mode 100644 index 0000000000000..c59b6a2e37039 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/celdeviceselector.go @@ -0,0 +1,39 @@ +/* +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 + +// CELDeviceSelectorApplyConfiguration represents a declarative configuration of the CELDeviceSelector type for use +// with apply. +type CELDeviceSelectorApplyConfiguration struct { + Expression *string `json:"expression,omitempty"` +} + +// CELDeviceSelectorApplyConfiguration constructs a declarative configuration of the CELDeviceSelector type for use with +// apply. +func CELDeviceSelector() *CELDeviceSelectorApplyConfiguration { + return &CELDeviceSelectorApplyConfiguration{} +} + +// WithExpression sets the Expression 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 Expression field is set to the value of the last call. +func (b *CELDeviceSelectorApplyConfiguration) WithExpression(value string) *CELDeviceSelectorApplyConfiguration { + b.Expression = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/device.go similarity index 50% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/device.go index 7baf9558de130..efdb5f37a9e1c 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/device.go @@ -16,24 +16,33 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 -// NamedResourcesAllocationResultApplyConfiguration represents a declarative configuration of the NamedResourcesAllocationResult type for use +// DeviceApplyConfiguration represents a declarative configuration of the Device type for use // with apply. -type NamedResourcesAllocationResultApplyConfiguration struct { - Name *string `json:"name,omitempty"` +type DeviceApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Basic *BasicDeviceApplyConfiguration `json:"basic,omitempty"` } -// NamedResourcesAllocationResultApplyConfiguration constructs a declarative configuration of the NamedResourcesAllocationResult type for use with +// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with // apply. -func NamedResourcesAllocationResult() *NamedResourcesAllocationResultApplyConfiguration { - return &NamedResourcesAllocationResultApplyConfiguration{} +func Device() *DeviceApplyConfiguration { + return &DeviceApplyConfiguration{} } // 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 *NamedResourcesAllocationResultApplyConfiguration) WithName(value string) *NamedResourcesAllocationResultApplyConfiguration { +func (b *DeviceApplyConfiguration) WithName(value string) *DeviceApplyConfiguration { b.Name = &value return b } + +// WithBasic sets the Basic field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Basic field is set to the value of the last call. +func (b *DeviceApplyConfiguration) WithBasic(value *BasicDeviceApplyConfiguration) *DeviceApplyConfiguration { + b.Basic = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go new file mode 100644 index 0000000000000..342e724ef0226 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go @@ -0,0 +1,63 @@ +/* +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 ( + v1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceAllocationConfigurationApplyConfiguration represents a declarative configuration of the DeviceAllocationConfiguration type for use +// with apply. +type DeviceAllocationConfigurationApplyConfiguration struct { + Source *v1alpha3.AllocationConfigSource `json:"source,omitempty"` + Requests []string `json:"requests,omitempty"` + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with +// apply. +func DeviceAllocationConfiguration() *DeviceAllocationConfigurationApplyConfiguration { + return &DeviceAllocationConfigurationApplyConfiguration{} +} + +// WithSource sets the Source 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 Source field is set to the value of the last call. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithSource(value v1alpha3.AllocationConfigSource) *DeviceAllocationConfigurationApplyConfiguration { + b.Source = &value + return b +} + +// WithRequests adds the given value to the Requests 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 Requests field. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceAllocationConfigurationApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceAllocationConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationresult.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationresult.go new file mode 100644 index 0000000000000..0cfb264b4eae5 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationresult.go @@ -0,0 +1,58 @@ +/* +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 + +// DeviceAllocationResultApplyConfiguration represents a declarative configuration of the DeviceAllocationResult type for use +// with apply. +type DeviceAllocationResultApplyConfiguration struct { + Results []DeviceRequestAllocationResultApplyConfiguration `json:"results,omitempty"` + Config []DeviceAllocationConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceAllocationResult type for use with +// apply. +func DeviceAllocationResult() *DeviceAllocationResultApplyConfiguration { + return &DeviceAllocationResultApplyConfiguration{} +} + +// WithResults adds the given value to the Results 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 Results field. +func (b *DeviceAllocationResultApplyConfiguration) WithResults(values ...*DeviceRequestAllocationResultApplyConfiguration) *DeviceAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResults") + } + b.Results = append(b.Results, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config 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 Config field. +func (b *DeviceAllocationResultApplyConfiguration) WithConfig(values ...*DeviceAllocationConfigurationApplyConfiguration) *DeviceAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceattribute.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceattribute.go new file mode 100644 index 0000000000000..6b0b7a40ac738 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceattribute.go @@ -0,0 +1,66 @@ +/* +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 + +// DeviceAttributeApplyConfiguration represents a declarative configuration of the DeviceAttribute type for use +// with apply. +type DeviceAttributeApplyConfiguration struct { + IntValue *int64 `json:"int,omitempty"` + BoolValue *bool `json:"bool,omitempty"` + StringValue *string `json:"string,omitempty"` + VersionValue *string `json:"version,omitempty"` +} + +// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with +// apply. +func DeviceAttribute() *DeviceAttributeApplyConfiguration { + return &DeviceAttributeApplyConfiguration{} +} + +// WithIntValue sets the IntValue 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 IntValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithIntValue(value int64) *DeviceAttributeApplyConfiguration { + b.IntValue = &value + return b +} + +// WithBoolValue sets the BoolValue 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 BoolValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithBoolValue(value bool) *DeviceAttributeApplyConfiguration { + b.BoolValue = &value + return b +} + +// WithStringValue sets the StringValue 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 StringValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithStringValue(value string) *DeviceAttributeApplyConfiguration { + b.StringValue = &value + return b +} + +// WithVersionValue sets the VersionValue 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 VersionValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *DeviceAttributeApplyConfiguration { + b.VersionValue = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaim.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaim.go new file mode 100644 index 0000000000000..ce3ab56d8b7e7 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaim.go @@ -0,0 +1,72 @@ +/* +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 + +// DeviceClaimApplyConfiguration represents a declarative configuration of the DeviceClaim type for use +// with apply. +type DeviceClaimApplyConfiguration struct { + Requests []DeviceRequestApplyConfiguration `json:"requests,omitempty"` + Constraints []DeviceConstraintApplyConfiguration `json:"constraints,omitempty"` + Config []DeviceClaimConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceClaimApplyConfiguration constructs a declarative configuration of the DeviceClaim type for use with +// apply. +func DeviceClaim() *DeviceClaimApplyConfiguration { + return &DeviceClaimApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests 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 Requests field. +func (b *DeviceClaimApplyConfiguration) WithRequests(values ...*DeviceRequestApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequests") + } + b.Requests = append(b.Requests, *values[i]) + } + return b +} + +// WithConstraints adds the given value to the Constraints 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 Constraints field. +func (b *DeviceClaimApplyConfiguration) WithConstraints(values ...*DeviceConstraintApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConstraints") + } + b.Constraints = append(b.Constraints, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config 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 Config field. +func (b *DeviceClaimApplyConfiguration) WithConfig(values ...*DeviceClaimConfigurationApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go new file mode 100644 index 0000000000000..4cabe985997e9 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go @@ -0,0 +1,50 @@ +/* +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 + +// DeviceClaimConfigurationApplyConfiguration represents a declarative configuration of the DeviceClaimConfiguration type for use +// with apply. +type DeviceClaimConfigurationApplyConfiguration struct { + Requests []string `json:"requests,omitempty"` + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with +// apply. +func DeviceClaimConfiguration() *DeviceClaimConfigurationApplyConfiguration { + return &DeviceClaimConfigurationApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests 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 Requests field. +func (b *DeviceClaimConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceClaimConfigurationApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call. +func (b *DeviceClaimConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClaimConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclass.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclass.go new file mode 100644 index 0000000000000..abaadbb366f63 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclass.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DeviceClassApplyConfiguration represents a declarative configuration of the DeviceClass type for use +// with apply. +type DeviceClassApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *DeviceClassSpecApplyConfiguration `json:"spec,omitempty"` +} + +// DeviceClass constructs a declarative configuration of the DeviceClass type for use with +// apply. +func DeviceClass(name string) *DeviceClassApplyConfiguration { + b := &DeviceClassApplyConfiguration{} + b.WithName(name) + b.WithKind("DeviceClass") + b.WithAPIVersion("resource.k8s.io/v1alpha3") + return b +} + +// ExtractDeviceClass extracts the applied configuration owned by fieldManager from +// deviceClass. If no managedFields are found in deviceClass for fieldManager, a +// DeviceClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deviceClass must be a unmodified DeviceClass API object that was retrieved from the Kubernetes API. +// ExtractDeviceClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeviceClass(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { + return extractDeviceClass(deviceClass, fieldManager, "") +} + +// ExtractDeviceClassStatus is the same as ExtractDeviceClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeviceClassStatus(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { + return extractDeviceClass(deviceClass, fieldManager, "status") +} + +func extractDeviceClass(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string, subresource string) (*DeviceClassApplyConfiguration, error) { + b := &DeviceClassApplyConfiguration{} + err := managedfields.ExtractInto(deviceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha3.DeviceClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deviceClass.Name) + + b.WithKind("DeviceClass") + b.WithAPIVersion("resource.k8s.io/v1alpha3") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithKind(value string) *DeviceClassApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithAPIVersion(value string) *DeviceClassApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithName(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithGenerateName(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithNamespace(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithUID(value types.UID) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithResourceVersion(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithGeneration(value int64) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *DeviceClassApplyConfiguration) WithLabels(entries map[string]string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *DeviceClassApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *DeviceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *DeviceClassApplyConfiguration) WithFinalizers(values ...string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *DeviceClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithSpec(value *DeviceClassSpecApplyConfiguration) *DeviceClassApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeviceClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go new file mode 100644 index 0000000000000..cb3758a3e3e64 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go @@ -0,0 +1,39 @@ +/* +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 + +// DeviceClassConfigurationApplyConfiguration represents a declarative configuration of the DeviceClassConfiguration type for use +// with apply. +type DeviceClassConfigurationApplyConfiguration struct { + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with +// apply. +func DeviceClassConfiguration() *DeviceClassConfigurationApplyConfiguration { + return &DeviceClassConfigurationApplyConfiguration{} +} + +// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call. +func (b *DeviceClassConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClassConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassspec.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassspec.go new file mode 100644 index 0000000000000..d40a43de66f06 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassspec.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use +// with apply. +type DeviceClassSpecApplyConfiguration struct { + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + SuitableNodes *v1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"` +} + +// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with +// apply. +func DeviceClassSpec() *DeviceClassSpecApplyConfiguration { + return &DeviceClassSpecApplyConfiguration{} +} + +// WithSelectors adds the given value to the Selectors 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 Selectors field. +func (b *DeviceClassSpecApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config 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 Config field. +func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassConfigurationApplyConfiguration) *DeviceClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} + +// WithSuitableNodes sets the SuitableNodes 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 SuitableNodes field is set to the value of the last call. +func (b *DeviceClassSpecApplyConfiguration) WithSuitableNodes(value *v1.NodeSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { + b.SuitableNodes = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconfiguration.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconfiguration.go new file mode 100644 index 0000000000000..62c0d997de13f --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconfiguration.go @@ -0,0 +1,39 @@ +/* +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 + +// DeviceConfigurationApplyConfiguration represents a declarative configuration of the DeviceConfiguration type for use +// with apply. +type DeviceConfigurationApplyConfiguration struct { + Opaque *OpaqueDeviceConfigurationApplyConfiguration `json:"opaque,omitempty"` +} + +// DeviceConfigurationApplyConfiguration constructs a declarative configuration of the DeviceConfiguration type for use with +// apply. +func DeviceConfiguration() *DeviceConfigurationApplyConfiguration { + return &DeviceConfigurationApplyConfiguration{} +} + +// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call. +func (b *DeviceConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconstraint.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconstraint.go new file mode 100644 index 0000000000000..479acd57c2b90 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconstraint.go @@ -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 + +import ( + v1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceConstraintApplyConfiguration represents a declarative configuration of the DeviceConstraint type for use +// with apply. +type DeviceConstraintApplyConfiguration struct { + Requests []string `json:"requests,omitempty"` + MatchAttribute *v1alpha3.FullyQualifiedName `json:"matchAttribute,omitempty"` +} + +// DeviceConstraintApplyConfiguration constructs a declarative configuration of the DeviceConstraint type for use with +// apply. +func DeviceConstraint() *DeviceConstraintApplyConfiguration { + return &DeviceConstraintApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests 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 Requests field. +func (b *DeviceConstraintApplyConfiguration) WithRequests(values ...string) *DeviceConstraintApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithMatchAttribute sets the MatchAttribute 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 MatchAttribute field is set to the value of the last call. +func (b *DeviceConstraintApplyConfiguration) WithMatchAttribute(value v1alpha3.FullyQualifiedName) *DeviceConstraintApplyConfiguration { + b.MatchAttribute = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go new file mode 100644 index 0000000000000..eed90f0f30097 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go @@ -0,0 +1,93 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceRequestApplyConfiguration represents a declarative configuration of the DeviceRequest type for use +// with apply. +type DeviceRequestApplyConfiguration struct { + Name *string `json:"name,omitempty"` + DeviceClassName *string `json:"deviceClassName,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + CountMode *resourcev1alpha3.DeviceCountMode `json:"countMode,omitempty"` + Count *int64 `json:"count,omitempty"` + AdminAccess *bool `json:"adminAccess,omitempty"` +} + +// DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with +// apply. +func DeviceRequest() *DeviceRequestApplyConfiguration { + return &DeviceRequestApplyConfiguration{} +} + +// 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 *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration { + b.Name = &value + return b +} + +// WithDeviceClassName sets the DeviceClassName 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 DeviceClassName field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceRequestApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithSelectors adds the given value to the Selectors 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 Selectors field. +func (b *DeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithCountMode sets the CountMode 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 CountMode field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithCountMode(value resourcev1alpha3.DeviceCountMode) *DeviceRequestApplyConfiguration { + b.CountMode = &value + return b +} + +// WithCount sets the Count 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 Count field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithCount(value int64) *DeviceRequestApplyConfiguration { + b.Count = &value + return b +} + +// WithAdminAccess sets the AdminAccess 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 AdminAccess field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestApplyConfiguration { + b.AdminAccess = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go new file mode 100644 index 0000000000000..712b9bf9b1832 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go @@ -0,0 +1,66 @@ +/* +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 + +// DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use +// with apply. +type DeviceRequestAllocationResultApplyConfiguration struct { + Request *string `json:"request,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` +} + +// DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with +// apply. +func DeviceRequestAllocationResult() *DeviceRequestAllocationResultApplyConfiguration { + return &DeviceRequestAllocationResultApplyConfiguration{} +} + +// WithRequest sets the Request 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 Request field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithRequest(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Request = &value + return b +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithDriver(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithPool(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Pool = &value + return b +} + +// WithDevice sets the Device field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Device field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithDevice(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Device = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceselector.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceselector.go new file mode 100644 index 0000000000000..574299d15e4e0 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceselector.go @@ -0,0 +1,39 @@ +/* +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 + +// DeviceSelectorApplyConfiguration represents a declarative configuration of the DeviceSelector type for use +// with apply. +type DeviceSelectorApplyConfiguration struct { + CEL *CELDeviceSelectorApplyConfiguration `json:"cel,omitempty"` +} + +// DeviceSelectorApplyConfiguration constructs a declarative configuration of the DeviceSelector type for use with +// apply. +func DeviceSelector() *DeviceSelectorApplyConfiguration { + return &DeviceSelectorApplyConfiguration{} +} + +// WithCEL sets the CEL 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 CEL field is set to the value of the last call. +func (b *DeviceSelectorApplyConfiguration) WithCEL(value *CELDeviceSelectorApplyConfiguration) *DeviceSelectorApplyConfiguration { + b.CEL = value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/vendorparameters.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go similarity index 54% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/vendorparameters.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go index 851c7cdfbac20..caf9d059c3f97 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/vendorparameters.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go @@ -16,37 +16,37 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// VendorParametersApplyConfiguration represents a declarative configuration of the VendorParameters type for use +// OpaqueDeviceConfigurationApplyConfiguration represents a declarative configuration of the OpaqueDeviceConfiguration type for use // with apply. -type VendorParametersApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` +type OpaqueDeviceConfigurationApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` Parameters *runtime.RawExtension `json:"parameters,omitempty"` } -// VendorParametersApplyConfiguration constructs a declarative configuration of the VendorParameters type for use with +// OpaqueDeviceConfigurationApplyConfiguration constructs a declarative configuration of the OpaqueDeviceConfiguration type for use with // apply. -func VendorParameters() *VendorParametersApplyConfiguration { - return &VendorParametersApplyConfiguration{} +func OpaqueDeviceConfiguration() *OpaqueDeviceConfigurationApplyConfiguration { + return &OpaqueDeviceConfigurationApplyConfiguration{} } -// WithDriverName sets the DriverName field in the declarative configuration to the given value +// WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *VendorParametersApplyConfiguration) WithDriverName(value string) *VendorParametersApplyConfiguration { - b.DriverName = &value +// If called multiple times, the Driver field is set to the value of the last call. +func (b *OpaqueDeviceConfigurationApplyConfiguration) WithDriver(value string) *OpaqueDeviceConfigurationApplyConfiguration { + b.Driver = &value return b } // WithParameters sets the Parameters 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 Parameters field is set to the value of the last call. -func (b *VendorParametersApplyConfiguration) WithParameters(value runtime.RawExtension) *VendorParametersApplyConfiguration { +func (b *OpaqueDeviceConfigurationApplyConfiguration) WithParameters(value runtime.RawExtension) *OpaqueDeviceConfigurationApplyConfiguration { b.Parameters = &value return b } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontext.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontext.go similarity index 96% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontext.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontext.go index 1eae9582dde67..ee8e73ebe2b57 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontext.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontext.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -43,7 +43,7 @@ func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConf b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodSchedulingContext") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -58,20 +58,20 @@ func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConf // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractPodSchedulingContext(podSchedulingContext *resourcev1alpha2.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { +func ExtractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { return extractPodSchedulingContext(podSchedulingContext, fieldManager, "") } // ExtractPodSchedulingContextStatus is the same as ExtractPodSchedulingContext except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractPodSchedulingContextStatus(podSchedulingContext *resourcev1alpha2.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { +func ExtractPodSchedulingContextStatus(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { return extractPodSchedulingContext(podSchedulingContext, fieldManager, "status") } -func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha2.PodSchedulingContext, fieldManager string, subresource string) (*PodSchedulingContextApplyConfiguration, error) { +func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string, subresource string) (*PodSchedulingContextApplyConfiguration, error) { b := &PodSchedulingContextApplyConfiguration{} - err := managedfields.ExtractInto(podSchedulingContext, internal.Parser().Type("io.k8s.api.resource.v1alpha2.PodSchedulingContext"), fieldManager, b, subresource) + err := managedfields.ExtractInto(podSchedulingContext, internal.Parser().Type("io.k8s.api.resource.v1alpha3.PodSchedulingContext"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -79,7 +79,7 @@ func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha2.PodSched b.WithNamespace(podSchedulingContext.Namespace) b.WithKind("PodSchedulingContext") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go similarity index 99% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go index 7cee78ec85ee9..fd25df7a531c9 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodSchedulingContextSpecApplyConfiguration represents a declarative configuration of the PodSchedulingContextSpec type for use // with apply. diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go similarity index 99% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go index 4a8f00ffc0f4a..a06e370cc3c03 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodSchedulingContextStatusApplyConfiguration represents a declarative configuration of the PodSchedulingContextStatus type for use // with apply. diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaim.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaim.go similarity index 96% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaim.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaim.go index 8ad61dfbd41b4..6161595588108 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaim.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaim.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -43,7 +43,7 @@ func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaim") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -58,20 +58,20 @@ func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClaim(resourceClaim *resourcev1alpha2.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { +func ExtractResourceClaim(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { return extractResourceClaim(resourceClaim, fieldManager, "") } // ExtractResourceClaimStatus is the same as ExtractResourceClaim except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClaimStatus(resourceClaim *resourcev1alpha2.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { +func ExtractResourceClaimStatus(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { return extractResourceClaim(resourceClaim, fieldManager, "status") } -func extractResourceClaim(resourceClaim *resourcev1alpha2.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) { +func extractResourceClaim(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) { b := &ResourceClaimApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaim"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaim"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -79,7 +79,7 @@ func extractResourceClaim(resourceClaim *resourcev1alpha2.ResourceClaim, fieldMa b.WithNamespace(resourceClaim.Namespace) b.WithKind("ResourceClaim") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go similarity index 99% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go index a383f461d7066..96196d7c952a0 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( types "k8s.io/apimachinery/pkg/types" diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go similarity index 99% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go index f9e07b7467f48..caab89acdb4b7 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceClaimSchedulingStatusApplyConfiguration represents a declarative configuration of the ResourceClaimSchedulingStatus type for use // with apply. diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimspec.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimspec.go new file mode 100644 index 0000000000000..7c5b65681dfc1 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimspec.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use +// with apply. +type ResourceClaimSpecApplyConfiguration struct { + Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"` + Controller *string `json:"controller,omitempty"` +} + +// ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with +// apply. +func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration { + return &ResourceClaimSpecApplyConfiguration{} +} + +// WithDevices sets the Devices 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 Devices field is set to the value of the last call. +func (b *ResourceClaimSpecApplyConfiguration) WithDevices(value *DeviceClaimApplyConfiguration) *ResourceClaimSpecApplyConfiguration { + b.Devices = value + return b +} + +// WithController sets the Controller 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 Controller field is set to the value of the last call. +func (b *ResourceClaimSpecApplyConfiguration) WithController(value string) *ResourceClaimSpecApplyConfiguration { + b.Controller = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go similarity index 84% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go index 635a4c4dc20b8..a52af3ec366f5 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go @@ -16,12 +16,11 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use // with apply. type ResourceClaimStatusApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"` ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"` DeallocationRequested *bool `json:"deallocationRequested,omitempty"` @@ -33,14 +32,6 @@ func ResourceClaimStatus() *ResourceClaimStatusApplyConfiguration { return &ResourceClaimStatusApplyConfiguration{} } -// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. -func (b *ResourceClaimStatusApplyConfiguration) WithDriverName(value string) *ResourceClaimStatusApplyConfiguration { - b.DriverName = &value - return b -} - // WithAllocation sets the Allocation 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 Allocation field is set to the value of the last call. diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go similarity index 96% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go index 0ee0ae36e0416..6f371d0c05112 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -42,7 +42,7 @@ func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyCo b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaimTemplate") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -57,20 +57,20 @@ func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyCo // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { +func ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "") } // ExtractResourceClaimTemplateStatus is the same as ExtractResourceClaimTemplate except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { +func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "status") } -func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) { +func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) { b := &ResourceClaimTemplateApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaimTemplate"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaimTemplate"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -78,7 +78,7 @@ func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha2.Resour b.WithNamespace(resourceClaimTemplate.Namespace) b.WithKind("ResourceClaimTemplate") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go similarity index 99% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go index 334de324e2bf3..5b03ab7553511 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepool.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepool.go new file mode 100644 index 0000000000000..23825d137f906 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepool.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// ResourcePoolApplyConfiguration represents a declarative configuration of the ResourcePool type for use +// with apply. +type ResourcePoolApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Generation *int64 `json:"generation,omitempty"` + ResourceSliceCount *int64 `json:"resourceSliceCount,omitempty"` +} + +// ResourcePoolApplyConfiguration constructs a declarative configuration of the ResourcePool type for use with +// apply. +func ResourcePool() *ResourcePoolApplyConfiguration { + return &ResourcePoolApplyConfiguration{} +} + +// 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 *ResourcePoolApplyConfiguration) WithName(value string) *ResourcePoolApplyConfiguration { + b.Name = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithGeneration(value int64) *ResourcePoolApplyConfiguration { + b.Generation = &value + return b +} + +// WithResourceSliceCount sets the ResourceSliceCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceSliceCount field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithResourceSliceCount(value int64) *ResourcePoolApplyConfiguration { + b.ResourceSliceCount = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceslice.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslice.go similarity index 86% rename from staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceslice.go rename to staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslice.go index 90cde67d7bd37..aaad68612ecc0 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceslice.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -32,9 +32,7 @@ import ( type ResourceSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - DriverName *string `json:"driverName,omitempty"` - ResourceModelApplyConfiguration `json:",inline"` + Spec *ResourceSliceSpecApplyConfiguration `json:"spec,omitempty"` } // ResourceSlice constructs a declarative configuration of the ResourceSlice type for use with @@ -43,7 +41,7 @@ func ResourceSlice(name string) *ResourceSliceApplyConfiguration { b := &ResourceSliceApplyConfiguration{} b.WithName(name) b.WithKind("ResourceSlice") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -58,27 +56,27 @@ func ResourceSlice(name string) *ResourceSliceApplyConfiguration { // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { +func ExtractResourceSlice(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { return extractResourceSlice(resourceSlice, fieldManager, "") } // ExtractResourceSliceStatus is the same as ExtractResourceSlice except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { +func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { return extractResourceSlice(resourceSlice, fieldManager, "status") } -func extractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) { +func extractResourceSlice(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) { b := &ResourceSliceApplyConfiguration{} - err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceSlice"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceSlice"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceSlice.Name) b.WithKind("ResourceSlice") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } @@ -240,27 +238,11 @@ func (b *ResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExis } } -// WithNodeName sets the NodeName field in the declarative configuration to the given value +// WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NodeName field is set to the value of the last call. -func (b *ResourceSliceApplyConfiguration) WithNodeName(value string) *ResourceSliceApplyConfiguration { - b.NodeName = &value - return b -} - -// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call. -func (b *ResourceSliceApplyConfiguration) WithDriverName(value string) *ResourceSliceApplyConfiguration { - b.DriverName = &value - return b -} - -// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call. -func (b *ResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceSliceApplyConfiguration { - b.NamedResources = value +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithSpec(value *ResourceSliceSpecApplyConfiguration) *ResourceSliceApplyConfiguration { + b.Spec = value return b } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go new file mode 100644 index 0000000000000..2ded7590739d5 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go @@ -0,0 +1,93 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// 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"` +} + +// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with +// apply. +func ResourceSliceSpec() *ResourceSliceSpecApplyConfiguration { + return &ResourceSliceSpecApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithDriver(value string) *ResourceSliceSpecApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPool(value *ResourcePoolApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + b.Pool = value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithNodeName(value string) *ResourceSliceSpecApplyConfiguration { + 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 *ResourceSliceSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + 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 *ResourceSliceSpecApplyConfiguration) WithAllNodes(value bool) *ResourceSliceSpecApplyConfiguration { + b.AllNodes = &value + return b +} + +// WithDevices adds the given value to the Devices 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 Devices field. +func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDevices") + } + b.Devices = append(b.Devices, *values[i]) + } + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/utils.go b/staging/src/k8s.io/client-go/applyconfigurations/utils.go index 7672fb091737d..5a6d6a20aefdd 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/utils.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/utils.go @@ -59,7 +59,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -112,7 +112,7 @@ import ( applyconfigurationsrbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" applyconfigurationsrbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" applyconfigurationsrbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" @@ -1549,81 +1549,69 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case rbacv1beta1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsrbacv1beta1.SubjectApplyConfiguration{} - // Group=resource.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithKind("AllocationResult"): - return &resourcev1alpha2.AllocationResultApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("AllocationResultModel"): - return &resourcev1alpha2.AllocationResultModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("DriverAllocationResult"): - return &resourcev1alpha2.DriverAllocationResultApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("DriverRequests"): - return &resourcev1alpha2.DriverRequestsApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAllocationResult"): - return &resourcev1alpha2.NamedResourcesAllocationResultApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAttribute"): - return &resourcev1alpha2.NamedResourcesAttributeApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAttributeValue"): - return &resourcev1alpha2.NamedResourcesAttributeValueApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesFilter"): - return &resourcev1alpha2.NamedResourcesFilterApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesInstance"): - return &resourcev1alpha2.NamedResourcesInstanceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesIntSlice"): - return &resourcev1alpha2.NamedResourcesIntSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesRequest"): - return &resourcev1alpha2.NamedResourcesRequestApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesResources"): - return &resourcev1alpha2.NamedResourcesResourcesApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesStringSlice"): - return &resourcev1alpha2.NamedResourcesStringSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"): - return &resourcev1alpha2.PodSchedulingContextApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): - return &resourcev1alpha2.PodSchedulingContextSpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"): - return &resourcev1alpha2.PodSchedulingContextStatusApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaim"): - return &resourcev1alpha2.ResourceClaimApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): - return &resourcev1alpha2.ResourceClaimConsumerReferenceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParameters"): - return &resourcev1alpha2.ResourceClaimParametersApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParametersReference"): - return &resourcev1alpha2.ResourceClaimParametersReferenceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): - return &resourcev1alpha2.ResourceClaimSchedulingStatusApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimSpec"): - return &resourcev1alpha2.ResourceClaimSpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimStatus"): - return &resourcev1alpha2.ResourceClaimStatusApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): - return &resourcev1alpha2.ResourceClaimTemplateApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): - return &resourcev1alpha2.ResourceClaimTemplateSpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClass"): - return &resourcev1alpha2.ResourceClassApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParameters"): - return &resourcev1alpha2.ResourceClassParametersApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParametersReference"): - return &resourcev1alpha2.ResourceClassParametersReferenceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceFilter"): - return &resourcev1alpha2.ResourceFilterApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceFilterModel"): - return &resourcev1alpha2.ResourceFilterModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceHandle"): - return &resourcev1alpha2.ResourceHandleApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceModel"): - return &resourcev1alpha2.ResourceModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequest"): - return &resourcev1alpha2.ResourceRequestApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequestModel"): - return &resourcev1alpha2.ResourceRequestModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice"): - return &resourcev1alpha2.ResourceSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("StructuredResourceHandle"): - return &resourcev1alpha2.StructuredResourceHandleApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("VendorParameters"): - return &resourcev1alpha2.VendorParametersApplyConfiguration{} + // Group=resource.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithKind("AllocationResult"): + return &resourcev1alpha3.AllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("BasicDevice"): + return &resourcev1alpha3.BasicDeviceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"): + return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("Device"): + return &resourcev1alpha3.DeviceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): + return &resourcev1alpha3.DeviceAllocationConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationResult"): + return &resourcev1alpha3.DeviceAllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceAttribute"): + return &resourcev1alpha3.DeviceAttributeApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaim"): + return &resourcev1alpha3.DeviceClaimApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaimConfiguration"): + return &resourcev1alpha3.DeviceClaimConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClass"): + return &resourcev1alpha3.DeviceClassApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassConfiguration"): + return &resourcev1alpha3.DeviceClassConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassSpec"): + return &resourcev1alpha3.DeviceClassSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceConfiguration"): + return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"): + return &resourcev1alpha3.DeviceConstraintApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequest"): + return &resourcev1alpha3.DeviceRequestApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): + return &resourcev1alpha3.DeviceRequestAllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceSelector"): + return &resourcev1alpha3.DeviceSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): + return &resourcev1alpha3.OpaqueDeviceConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext"): + return &resourcev1alpha3.PodSchedulingContextApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): + return &resourcev1alpha3.PodSchedulingContextSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"): + return &resourcev1alpha3.PodSchedulingContextStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim"): + return &resourcev1alpha3.ResourceClaimApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): + return &resourcev1alpha3.ResourceClaimConsumerReferenceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): + return &resourcev1alpha3.ResourceClaimSchedulingStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSpec"): + return &resourcev1alpha3.ResourceClaimSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimStatus"): + return &resourcev1alpha3.ResourceClaimStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): + return &resourcev1alpha3.ResourceClaimTemplateApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): + return &resourcev1alpha3.ResourceClaimTemplateSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourcePool"): + return &resourcev1alpha3.ResourcePoolApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice"): + return &resourcev1alpha3.ResourceSliceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceSliceSpec"): + return &resourcev1alpha3.ResourceSliceSpecApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): diff --git a/staging/src/k8s.io/client-go/informers/generic.go b/staging/src/k8s.io/client-go/informers/generic.go index db1eb4a833115..c7df13f2525c8 100644 --- a/staging/src/k8s.io/client-go/informers/generic.go +++ b/staging/src/k8s.io/client-go/informers/generic.go @@ -60,7 +60,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -366,21 +366,17 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case rbacv1beta1.SchemeGroupVersion.WithResource("rolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil - // Group=resource.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("podschedulingcontexts"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().PodSchedulingContexts().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclaims"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaims().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimParameters().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclaimtemplates"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimTemplates().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClasses().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClassParameters().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceslices"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceSlices().Informer()}, nil + // Group=resource.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithResource("deviceclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceClasses().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().PodSchedulingContexts().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclaims"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaims().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaimTemplates().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceslices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceSlices().Informer()}, nil // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): diff --git a/staging/src/k8s.io/client-go/informers/resource/interface.go b/staging/src/k8s.io/client-go/informers/resource/interface.go index 3fcce8ae9dc96..170d29d8088a6 100644 --- a/staging/src/k8s.io/client-go/informers/resource/interface.go +++ b/staging/src/k8s.io/client-go/informers/resource/interface.go @@ -20,13 +20,13 @@ package resource import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - v1alpha2 "k8s.io/client-go/informers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/informers/resource/v1alpha3" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface + // V1alpha3 provides access to shared informers for resources in V1alpha3. + V1alpha3() v1alpha3.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha3 returns a new v1alpha3.Interface. +func (g *group) V1alpha3() v1alpha3.Interface { + return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimparameters.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimparameters.go deleted file mode 100644 index 3064ac9f5596f..0000000000000 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimparameters.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - time "time" - - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" - cache "k8s.io/client-go/tools/cache" -) - -// ResourceClaimParametersInformer provides access to a shared informer and lister for -// ResourceClaimParameters. -type ResourceClaimParametersInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClaimParametersLister -} - -type resourceClaimParametersInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewResourceClaimParametersInformer constructs a new informer for ResourceClaimParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewResourceClaimParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredResourceClaimParametersInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredResourceClaimParametersInformer constructs a new informer for ResourceClaimParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredResourceClaimParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha2().ResourceClaimParameters(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha2().ResourceClaimParameters(namespace).Watch(context.TODO(), options) - }, - }, - &resourcev1alpha2.ResourceClaimParameters{}, - resyncPeriod, - indexers, - ) -} - -func (f *resourceClaimParametersInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredResourceClaimParametersInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *resourceClaimParametersInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimParameters{}, f.defaultInformer) -} - -func (f *resourceClaimParametersInformer) Lister() v1alpha2.ResourceClaimParametersLister { - return v1alpha2.NewResourceClaimParametersLister(f.Informer().GetIndexer()) -} diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclassparameters.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclassparameters.go deleted file mode 100644 index 71fbefe162027..0000000000000 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclassparameters.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - time "time" - - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" - cache "k8s.io/client-go/tools/cache" -) - -// ResourceClassParametersInformer provides access to a shared informer and lister for -// ResourceClassParameters. -type ResourceClassParametersInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClassParametersLister -} - -type resourceClassParametersInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewResourceClassParametersInformer constructs a new informer for ResourceClassParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewResourceClassParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredResourceClassParametersInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredResourceClassParametersInformer constructs a new informer for ResourceClassParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredResourceClassParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha2().ResourceClassParameters(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha2().ResourceClassParameters(namespace).Watch(context.TODO(), options) - }, - }, - &resourcev1alpha2.ResourceClassParameters{}, - resyncPeriod, - indexers, - ) -} - -func (f *resourceClassParametersInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredResourceClassParametersInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *resourceClassParametersInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClassParameters{}, f.defaultInformer) -} - -func (f *resourceClassParametersInformer) Lister() v1alpha2.ResourceClassParametersLister { - return v1alpha2.NewResourceClassParametersLister(f.Informer().GetIndexer()) -} diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclass.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go similarity index 52% rename from staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclass.go rename to staging/src/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go index cb76d78fe4978..c0bcbd1905cae 100644 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclass.go +++ b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go @@ -16,74 +16,74 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) -// ResourceClassInformer provides access to a shared informer and lister for -// ResourceClasses. -type ResourceClassInformer interface { +// DeviceClassInformer provides access to a shared informer and lister for +// DeviceClasses. +type DeviceClassInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClassLister + Lister() v1alpha3.DeviceClassLister } -type resourceClassInformer struct { +type deviceClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewResourceClassInformer constructs a new informer for ResourceClass type. +// NewDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewResourceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredResourceClassInformer(client, resyncPeriod, indexers, nil) +func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDeviceClassInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredResourceClassInformer constructs a new informer for ResourceClass type. +// NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredResourceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClasses().List(context.TODO(), options) + return client.ResourceV1alpha3().DeviceClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClasses().Watch(context.TODO(), options) + return client.ResourceV1alpha3().DeviceClasses().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClass{}, + &resourcev1alpha3.DeviceClass{}, resyncPeriod, indexers, ) } -func (f *resourceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredResourceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDeviceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *resourceClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClass{}, f.defaultInformer) +func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha3.DeviceClass{}, f.defaultInformer) } -func (f *resourceClassInformer) Lister() v1alpha2.ResourceClassLister { - return v1alpha2.NewResourceClassLister(f.Informer().GetIndexer()) +func (f *deviceClassInformer) Lister() v1alpha3.DeviceClassLister { + return v1alpha3.NewDeviceClassLister(f.Informer().GetIndexer()) } diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/interface.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/interface.go similarity index 70% rename from staging/src/k8s.io/client-go/informers/resource/v1alpha2/interface.go rename to staging/src/k8s.io/client-go/informers/resource/v1alpha3/interface.go index aa4a5ae7dcae1..481a7de451880 100644 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/interface.go +++ b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" @@ -24,18 +24,14 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // DeviceClasses returns a DeviceClassInformer. + DeviceClasses() DeviceClassInformer // PodSchedulingContexts returns a PodSchedulingContextInformer. PodSchedulingContexts() PodSchedulingContextInformer // ResourceClaims returns a ResourceClaimInformer. ResourceClaims() ResourceClaimInformer - // ResourceClaimParameters returns a ResourceClaimParametersInformer. - ResourceClaimParameters() ResourceClaimParametersInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. ResourceClaimTemplates() ResourceClaimTemplateInformer - // ResourceClasses returns a ResourceClassInformer. - ResourceClasses() ResourceClassInformer - // ResourceClassParameters returns a ResourceClassParametersInformer. - ResourceClassParameters() ResourceClassParametersInformer // ResourceSlices returns a ResourceSliceInformer. ResourceSlices() ResourceSliceInformer } @@ -51,6 +47,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// DeviceClasses returns a DeviceClassInformer. +func (v *version) DeviceClasses() DeviceClassInformer { + return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // PodSchedulingContexts returns a PodSchedulingContextInformer. func (v *version) PodSchedulingContexts() PodSchedulingContextInformer { return &podSchedulingContextInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -61,26 +62,11 @@ func (v *version) ResourceClaims() ResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClaimParameters returns a ResourceClaimParametersInformer. -func (v *version) ResourceClaimParameters() ResourceClaimParametersInformer { - return &resourceClaimParametersInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClasses returns a ResourceClassInformer. -func (v *version) ResourceClasses() ResourceClassInformer { - return &resourceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// ResourceClassParameters returns a ResourceClassParametersInformer. -func (v *version) ResourceClassParameters() ResourceClassParametersInformer { - return &resourceClassParametersInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ResourceSlices returns a ResourceSliceInformer. func (v *version) ResourceSlices() ResourceSliceInformer { return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/podschedulingcontext.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/podschedulingcontext.go similarity index 86% rename from staging/src/k8s.io/client-go/informers/resource/v1alpha2/podschedulingcontext.go rename to staging/src/k8s.io/client-go/informers/resource/v1alpha3/podschedulingcontext.go index b4aabb3761ce4..62fb3614fcdca 100644 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/podschedulingcontext.go +++ b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/podschedulingcontext.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // PodSchedulingContexts. type PodSchedulingContextInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.PodSchedulingContextLister + Lister() v1alpha3.PodSchedulingContextLister } type podSchedulingContextInformer struct { @@ -62,16 +62,16 @@ func NewFilteredPodSchedulingContextInformer(client kubernetes.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().PodSchedulingContexts(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().PodSchedulingContexts(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().PodSchedulingContexts(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().PodSchedulingContexts(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.PodSchedulingContext{}, + &resourcev1alpha3.PodSchedulingContext{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *podSchedulingContextInformer) defaultInformer(client kubernetes.Interfa } func (f *podSchedulingContextInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.PodSchedulingContext{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.PodSchedulingContext{}, f.defaultInformer) } -func (f *podSchedulingContextInformer) Lister() v1alpha2.PodSchedulingContextLister { - return v1alpha2.NewPodSchedulingContextLister(f.Informer().GetIndexer()) +func (f *podSchedulingContextInformer) Lister() v1alpha3.PodSchedulingContextLister { + return v1alpha3.NewPodSchedulingContextLister(f.Informer().GetIndexer()) } diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaim.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go similarity index 85% rename from staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaim.go rename to staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go index 3af93689191ff..fa644579b13c2 100644 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaim.go +++ b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClaims. type ResourceClaimInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClaimLister + Lister() v1alpha3.ResourceClaimLister } type resourceClaimInformer struct { @@ -62,16 +62,16 @@ func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaims(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaims(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaims(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaim{}, + &resourcev1alpha3.ResourceClaim{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, res } func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaim{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClaim{}, f.defaultInformer) } -func (f *resourceClaimInformer) Lister() v1alpha2.ResourceClaimLister { - return v1alpha2.NewResourceClaimLister(f.Informer().GetIndexer()) +func (f *resourceClaimInformer) Lister() v1alpha3.ResourceClaimLister { + return v1alpha3.NewResourceClaimLister(f.Informer().GetIndexer()) } diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimtemplate.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go similarity index 86% rename from staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimtemplate.go rename to staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go index 13f4ad835cfbc..294755661cc0c 100644 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceclaimtemplate.go +++ b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClaimTemplates. type ResourceClaimTemplateInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClaimTemplateLister + Lister() v1alpha3.ResourceClaimTemplateLister } type resourceClaimTemplateInformer struct { @@ -62,16 +62,16 @@ func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimTemplates(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaimTemplate{}, + &resourcev1alpha3.ResourceClaimTemplate{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interf } func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimTemplate{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClaimTemplate{}, f.defaultInformer) } -func (f *resourceClaimTemplateInformer) Lister() v1alpha2.ResourceClaimTemplateLister { - return v1alpha2.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) +func (f *resourceClaimTemplateInformer) Lister() v1alpha3.ResourceClaimTemplateLister { + return v1alpha3.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) } diff --git a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceslice.go b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go similarity index 85% rename from staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceslice.go rename to staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go index da9d2a0243ca7..108083530c50a 100644 --- a/staging/src/k8s.io/client-go/informers/resource/v1alpha2/resourceslice.go +++ b/staging/src/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceSlices. type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceSliceLister + Lister() v1alpha3.ResourceSliceLister } type resourceSliceInformer struct { @@ -61,16 +61,16 @@ func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceSlices().List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceSlices().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceSlices().Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceSlices().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceSlice{}, + &resourcev1alpha3.ResourceSlice{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, res } func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceSlice{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceSlice{}, f.defaultInformer) } -func (f *resourceSliceInformer) Lister() v1alpha2.ResourceSliceLister { - return v1alpha2.NewResourceSliceLister(f.Informer().GetIndexer()) +func (f *resourceSliceInformer) Lister() v1alpha3.ResourceSliceLister { + return v1alpha3.NewResourceSliceLister(f.Informer().GetIndexer()) } diff --git a/staging/src/k8s.io/client-go/kubernetes/clientset.go b/staging/src/k8s.io/client-go/kubernetes/clientset.go index eaa206ff65d97..ce17f8ed8eab3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/clientset.go +++ b/staging/src/k8s.io/client-go/kubernetes/clientset.go @@ -67,7 +67,7 @@ import ( rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" - resourcev1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" @@ -125,7 +125,7 @@ type Interface interface { RbacV1() rbacv1.RbacV1Interface RbacV1beta1() rbacv1beta1.RbacV1beta1Interface RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface - ResourceV1alpha2() resourcev1alpha2.ResourceV1alpha2Interface + ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface SchedulingV1() schedulingv1.SchedulingV1Interface @@ -182,7 +182,7 @@ type Clientset struct { rbacV1 *rbacv1.RbacV1Client rbacV1beta1 *rbacv1beta1.RbacV1beta1Client rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client - resourceV1alpha2 *resourcev1alpha2.ResourceV1alpha2Client + resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client schedulingV1 *schedulingv1.SchedulingV1Client @@ -412,9 +412,9 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return c.rbacV1alpha1 } -// ResourceV1alpha2 retrieves the ResourceV1alpha2Client -func (c *Clientset) ResourceV1alpha2() resourcev1alpha2.ResourceV1alpha2Interface { - return c.resourceV1alpha2 +// ResourceV1alpha3 retrieves the ResourceV1alpha3Client +func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { + return c.resourceV1alpha3 } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client @@ -672,7 +672,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.resourceV1alpha2, err = resourcev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.resourceV1alpha3, err = resourcev1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -769,7 +769,7 @@ func New(c rest.Interface) *Clientset { cs.rbacV1 = rbacv1.New(c) cs.rbacV1beta1 = rbacv1beta1.New(c) cs.rbacV1alpha1 = rbacv1alpha1.New(c) - cs.resourceV1alpha2 = resourcev1alpha2.New(c) + cs.resourceV1alpha3 = resourcev1alpha3.New(c) cs.schedulingV1alpha1 = schedulingv1alpha1.New(c) cs.schedulingV1beta1 = schedulingv1beta1.New(c) cs.schedulingV1 = schedulingv1.New(c) diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go index 7808a94a2f48f..63f384b139c52 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -113,8 +113,8 @@ import ( fakerbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake" - resourcev1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" - fakeresourcev1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake" + resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" + fakeresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" @@ -438,9 +438,9 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} } -// ResourceV1alpha2 retrieves the ResourceV1alpha2Client -func (c *Clientset) ResourceV1alpha2() resourcev1alpha2.ResourceV1alpha2Interface { - return &fakeresourcev1alpha2.FakeResourceV1alpha2{Fake: &c.Fake} +// ResourceV1alpha3 retrieves the ResourceV1alpha3Client +func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { + return &fakeresourcev1alpha3.FakeResourceV1alpha3{Fake: &c.Fake} } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/register.go b/staging/src/k8s.io/client-go/kubernetes/fake/register.go index 339983fe0afa6..2cd83ecb57763 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/register.go +++ b/staging/src/k8s.io/client-go/kubernetes/fake/register.go @@ -63,7 +63,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -126,7 +126,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, - resourcev1alpha2.AddToScheme, + resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, diff --git a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go index 8ebfb7cea568c..1b15a4f247c10 100644 --- a/staging/src/k8s.io/client-go/kubernetes/scheme/register.go +++ b/staging/src/k8s.io/client-go/kubernetes/scheme/register.go @@ -63,7 +63,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -126,7 +126,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, - resourcev1alpha2.AddToScheme, + resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go deleted file mode 100644 index e141835ac0e69..0000000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClaimParameters implements ResourceClaimParametersInterface -type FakeResourceClaimParameters struct { - Fake *FakeResourceV1alpha2 - ns string -} - -var resourceclaimparametersResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters") - -var resourceclaimparametersKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParameters") - -// Get takes name of the resourceClaimParameters, and returns the corresponding resourceClaimParameters object, and an error if there is any. -func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourceclaimparametersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClaimParameters), err -} - -// List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. -func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { - emptyResult := &v1alpha2.ResourceClaimParametersList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.ResourceClaimParametersList{ListMeta: obj.(*v1alpha2.ResourceClaimParametersList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClaimParametersList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClaimParameters. -func (c *FakeResourceClaimParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimparametersResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceClaimParameters and creates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClaimParameters), err -} - -// Update takes the representation of a resourceClaimParameters and updates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *FakeResourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClaimParameters), err -} - -// Delete takes name of the resourceClaimParameters and deletes it. Returns an error if one occurs. -func (c *FakeResourceClaimParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimparametersResource, c.ns, name, opts), &v1alpha2.ResourceClaimParameters{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClaimParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourceclaimparametersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimParametersList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClaimParameters. -func (c *FakeResourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClaimParameters), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimParameters. -func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - if resourceClaimParameters == nil { - return nil, fmt.Errorf("resourceClaimParameters provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClaimParameters) - if err != nil { - return nil, err - } - name := resourceClaimParameters.Name - if name == nil { - return nil, fmt.Errorf("resourceClaimParameters.Name must be provided to Apply") - } - emptyResult := &v1alpha2.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClaimParameters), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go deleted file mode 100644 index 660f7c7f1dda5..0000000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClasses implements ResourceClassInterface -type FakeResourceClasses struct { - Fake *FakeResourceV1alpha2 -} - -var resourceclassesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclasses") - -var resourceclassesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClass") - -// Get takes name of the resourceClass, and returns the corresponding resourceClass object, and an error if there is any. -func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(resourceclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClass), err -} - -// List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. -func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { - emptyResult := &v1alpha2.ResourceClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(resourceclassesResource, resourceclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.ResourceClassList{ListMeta: obj.(*v1alpha2.ResourceClassList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClasses. -func (c *FakeResourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(resourceclassesResource, opts)) -} - -// Create takes the representation of a resourceClass and creates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClass), err -} - -// Update takes the representation of a resourceClass and updates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *FakeResourceClasses) Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClass), err -} - -// Delete takes name of the resourceClass and deletes it. Returns an error if one occurs. -func (c *FakeResourceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceclassesResource, name, opts), &v1alpha2.ResourceClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(resourceclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClassList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClass. -func (c *FakeResourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClass. -func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resourcev1alpha2.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClass, err error) { - if resourceClass == nil { - return nil, fmt.Errorf("resourceClass provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClass) - if err != nil { - return nil, err - } - name := resourceClass.Name - if name == nil { - return nil, fmt.Errorf("resourceClass.Name must be provided to Apply") - } - emptyResult := &v1alpha2.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClass), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go deleted file mode 100644 index b58eedeca86ce..0000000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClassParameters implements ResourceClassParametersInterface -type FakeResourceClassParameters struct { - Fake *FakeResourceV1alpha2 - ns string -} - -var resourceclassparametersResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters") - -var resourceclassparametersKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParameters") - -// Get takes name of the resourceClassParameters, and returns the corresponding resourceClassParameters object, and an error if there is any. -func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourceclassparametersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClassParameters), err -} - -// List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. -func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { - emptyResult := &v1alpha2.ResourceClassParametersList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.ResourceClassParametersList{ListMeta: obj.(*v1alpha2.ResourceClassParametersList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClassParametersList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClassParameters. -func (c *FakeResourceClassParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourceclassparametersResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceClassParameters and creates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClassParameters), err -} - -// Update takes the representation of a resourceClassParameters and updates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *FakeResourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClassParameters), err -} - -// Delete takes name of the resourceClassParameters and deletes it. Returns an error if one occurs. -func (c *FakeResourceClassParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclassparametersResource, c.ns, name, opts), &v1alpha2.ResourceClassParameters{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClassParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourceclassparametersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClassParametersList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClassParameters. -func (c *FakeResourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClassParameters), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClassParameters. -func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClassParameters, err error) { - if resourceClassParameters == nil { - return nil, fmt.Errorf("resourceClassParameters provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClassParameters) - if err != nil { - return nil, err - } - name := resourceClassParameters.Name - if name == nil { - return nil, fmt.Errorf("resourceClassParameters.Name must be provided to Apply") - } - emptyResult := &v1alpha2.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ResourceClassParameters), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go deleted file mode 100644 index e3fb474cd022b..0000000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" - gentype "k8s.io/client-go/gentype" - scheme "k8s.io/client-go/kubernetes/scheme" -) - -// ResourceClaimParametersGetter has a method to return a ResourceClaimParametersInterface. -// A group's client should implement this interface. -type ResourceClaimParametersGetter interface { - ResourceClaimParameters(namespace string) ResourceClaimParametersInterface -} - -// ResourceClaimParametersInterface has methods to work with ResourceClaimParameters resources. -type ResourceClaimParametersInterface interface { - Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (*v1alpha2.ResourceClaimParameters, error) - Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (*v1alpha2.ResourceClaimParameters, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClaimParameters, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimParametersList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) - Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimParameters, err error) - ResourceClaimParametersExpansion -} - -// resourceClaimParameters implements ResourceClaimParametersInterface -type resourceClaimParameters struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaimParameters, *v1alpha2.ResourceClaimParametersList, *resourcev1alpha2.ResourceClaimParametersApplyConfiguration] -} - -// newResourceClaimParameters returns a ResourceClaimParameters -func newResourceClaimParameters(c *ResourceV1alpha2Client, namespace string) *resourceClaimParameters { - return &resourceClaimParameters{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaimParameters, *v1alpha2.ResourceClaimParametersList, *resourcev1alpha2.ResourceClaimParametersApplyConfiguration]( - "resourceclaimparameters", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha2.ResourceClaimParameters { return &v1alpha2.ResourceClaimParameters{} }, - func() *v1alpha2.ResourceClaimParametersList { return &v1alpha2.ResourceClaimParametersList{} }), - } -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclass.go deleted file mode 100644 index c4600d3475652..0000000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclass.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" - gentype "k8s.io/client-go/gentype" - scheme "k8s.io/client-go/kubernetes/scheme" -) - -// ResourceClassesGetter has a method to return a ResourceClassInterface. -// A group's client should implement this interface. -type ResourceClassesGetter interface { - ResourceClasses() ResourceClassInterface -} - -// ResourceClassInterface has methods to work with ResourceClass resources. -type ResourceClassInterface interface { - Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (*v1alpha2.ResourceClass, error) - Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (*v1alpha2.ResourceClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) - Apply(ctx context.Context, resourceClass *resourcev1alpha2.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClass, err error) - ResourceClassExpansion -} - -// resourceClasses implements ResourceClassInterface -type resourceClasses struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClass, *v1alpha2.ResourceClassList, *resourcev1alpha2.ResourceClassApplyConfiguration] -} - -// newResourceClasses returns a ResourceClasses -func newResourceClasses(c *ResourceV1alpha2Client) *resourceClasses { - return &resourceClasses{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClass, *v1alpha2.ResourceClassList, *resourcev1alpha2.ResourceClassApplyConfiguration]( - "resourceclasses", - c.RESTClient(), - scheme.ParameterCodec, - "", - func() *v1alpha2.ResourceClass { return &v1alpha2.ResourceClass{} }, - func() *v1alpha2.ResourceClassList { return &v1alpha2.ResourceClassList{} }), - } -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go deleted file mode 100644 index e7cdddce4d039..0000000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - - v1alpha2 "k8s.io/api/resource/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" - gentype "k8s.io/client-go/gentype" - scheme "k8s.io/client-go/kubernetes/scheme" -) - -// ResourceClassParametersGetter has a method to return a ResourceClassParametersInterface. -// A group's client should implement this interface. -type ResourceClassParametersGetter interface { - ResourceClassParameters(namespace string) ResourceClassParametersInterface -} - -// ResourceClassParametersInterface has methods to work with ResourceClassParameters resources. -type ResourceClassParametersInterface interface { - Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (*v1alpha2.ResourceClassParameters, error) - Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (*v1alpha2.ResourceClassParameters, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClassParameters, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassParametersList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) - Apply(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClassParameters, err error) - ResourceClassParametersExpansion -} - -// resourceClassParameters implements ResourceClassParametersInterface -type resourceClassParameters struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClassParameters, *v1alpha2.ResourceClassParametersList, *resourcev1alpha2.ResourceClassParametersApplyConfiguration] -} - -// newResourceClassParameters returns a ResourceClassParameters -func newResourceClassParameters(c *ResourceV1alpha2Client, namespace string) *resourceClassParameters { - return &resourceClassParameters{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClassParameters, *v1alpha2.ResourceClassParametersList, *resourcev1alpha2.ResourceClassParametersApplyConfiguration]( - "resourceclassparameters", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha2.ResourceClassParameters { return &v1alpha2.ResourceClassParameters{} }, - func() *v1alpha2.ResourceClassParametersList { return &v1alpha2.ResourceClassParametersList{} }), - } -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/deviceclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/deviceclass.go new file mode 100644 index 0000000000000..35455dfa35796 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/deviceclass.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + "context" + + v1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// DeviceClassesGetter has a method to return a DeviceClassInterface. +// A group's client should implement this interface. +type DeviceClassesGetter interface { + DeviceClasses() DeviceClassInterface +} + +// DeviceClassInterface has methods to work with DeviceClass resources. +type DeviceClassInterface interface { + Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (*v1alpha3.DeviceClass, error) + Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (*v1alpha3.DeviceClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.DeviceClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.DeviceClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) + Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) + DeviceClassExpansion +} + +// deviceClasses implements DeviceClassInterface +type deviceClasses struct { + *gentype.ClientWithListAndApply[*v1alpha3.DeviceClass, *v1alpha3.DeviceClassList, *resourcev1alpha3.DeviceClassApplyConfiguration] +} + +// newDeviceClasses returns a DeviceClasses +func newDeviceClasses(c *ResourceV1alpha3Client) *deviceClasses { + return &deviceClasses{ + gentype.NewClientWithListAndApply[*v1alpha3.DeviceClass, *v1alpha3.DeviceClassList, *resourcev1alpha3.DeviceClassApplyConfiguration]( + "deviceclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha3.DeviceClass { return &v1alpha3.DeviceClass{} }, + func() *v1alpha3.DeviceClassList { return &v1alpha3.DeviceClassList{} }), + } +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/doc.go similarity index 97% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/doc.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/doc.go index baaf2d9853708..fdb23fd37c260 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha2 +package v1alpha3 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go similarity index 100% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/doc.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go new file mode 100644 index 0000000000000..d96cbd2219891 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go @@ -0,0 +1,151 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" + testing "k8s.io/client-go/testing" +) + +// FakeDeviceClasses implements DeviceClassInterface +type FakeDeviceClasses struct { + Fake *FakeResourceV1alpha3 +} + +var deviceclassesResource = v1alpha3.SchemeGroupVersion.WithResource("deviceclasses") + +var deviceclassesKind = v1alpha3.SchemeGroupVersion.WithKind("DeviceClass") + +// Get takes name of the deviceClass, and returns the corresponding deviceClass object, and an error if there is any. +func (c *FakeDeviceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(deviceclassesResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// List takes label and field selectors, and returns the list of DeviceClasses that match those selectors. +func (c *FakeDeviceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.DeviceClassList, err error) { + emptyResult := &v1alpha3.DeviceClassList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(deviceclassesResource, deviceclassesKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha3.DeviceClassList{ListMeta: obj.(*v1alpha3.DeviceClassList).ListMeta} + for _, item := range obj.(*v1alpha3.DeviceClassList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested deviceClasses. +func (c *FakeDeviceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(deviceclassesResource, opts)) +} + +// Create takes the representation of a deviceClass and creates it. Returns the server's representation of the deviceClass, and an error, if there is any. +func (c *FakeDeviceClasses) Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// Update takes the representation of a deviceClass and updates it. Returns the server's representation of the deviceClass, and an error, if there is any. +func (c *FakeDeviceClasses) Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// Delete takes name of the deviceClass and deletes it. Returns an error if one occurs. +func (c *FakeDeviceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(deviceclassesResource, name, opts), &v1alpha3.DeviceClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDeviceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(deviceclassesResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha3.DeviceClassList{}) + return err +} + +// Patch applies the patch and returns the patched deviceClass. +func (c *FakeDeviceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied deviceClass. +func (c *FakeDeviceClasses) Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) { + if deviceClass == nil { + return nil, fmt.Errorf("deviceClass provided to Apply must not be nil") + } + data, err := json.Marshal(deviceClass) + if err != nil { + return nil, err + } + name := deviceClass.Name + if name == nil { + return nil, fmt.Errorf("deviceClass.Name must be provided to Apply") + } + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go similarity index 74% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go index b208415522a2f..54898993e5d29 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakePodSchedulingContexts implements PodSchedulingContextInterface type FakePodSchedulingContexts struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var podschedulingcontextsResource = v1alpha2.SchemeGroupVersion.WithResource("podschedulingcontexts") +var podschedulingcontextsResource = v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts") -var podschedulingcontextsKind = v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext") +var podschedulingcontextsKind = v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext") // Get takes name of the podSchedulingContext, and returns the corresponding podSchedulingContext object, and an error if there is any. -func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(podschedulingcontextsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. -func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { - emptyResult := &v1alpha2.PodSchedulingContextList{} +func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.PodSchedulingContextList, err error) { + emptyResult := &v1alpha3.PodSchedulingContextList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOption if label == nil { label = labels.Everything() } - list := &v1alpha2.PodSchedulingContextList{ListMeta: obj.(*v1alpha2.PodSchedulingContextList).ListMeta} - for _, item := range obj.(*v1alpha2.PodSchedulingContextList).Items { + list := &v1alpha3.PodSchedulingContextList{ListMeta: obj.(*v1alpha3.PodSchedulingContextList).ListMeta} + for _, item := range obj.(*v1alpha3.PodSchedulingContextList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,46 +85,46 @@ func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptio } // Create takes the representation of a podSchedulingContext and creates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // Update takes the representation of a podSchedulingContext and updates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(podschedulingcontextsResource, "status", c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // Delete takes name of the podSchedulingContext and deletes it. Returns an error if one occurs. func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(podschedulingcontextsResource, c.ns, name, opts), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewDeleteActionWithOptions(podschedulingcontextsResource, c.ns, name, opts), &v1alpha3.PodSchedulingContext{}) return err } @@ -133,24 +133,24 @@ func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opt func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(podschedulingcontextsResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.PodSchedulingContextList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.PodSchedulingContextList{}) return err } // Patch applies the patch and returns the patched podSchedulingContext. -func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // Apply takes the given apply declarative configuration, applies it and returns the applied podSchedulingContext. -func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) { +func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { if podSchedulingContext == nil { return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") } @@ -162,19 +162,19 @@ func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingCont if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } - emptyResult := &v1alpha2.PodSchedulingContext{} + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) { +func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { if podSchedulingContext == nil { return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") } @@ -186,12 +186,12 @@ func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podScheduli if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } - emptyResult := &v1alpha2.PodSchedulingContext{} + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go similarity index 51% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go index 6f69d0fa795a0..4523d9f09cda8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go @@ -19,46 +19,38 @@ limitations under the License. package fake import ( - v1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeResourceV1alpha2 struct { +type FakeResourceV1alpha3 struct { *testing.Fake } -func (c *FakeResourceV1alpha2) PodSchedulingContexts(namespace string) v1alpha2.PodSchedulingContextInterface { - return &FakePodSchedulingContexts{c, namespace} +func (c *FakeResourceV1alpha3) DeviceClasses() v1alpha3.DeviceClassInterface { + return &FakeDeviceClasses{c} } -func (c *FakeResourceV1alpha2) ResourceClaims(namespace string) v1alpha2.ResourceClaimInterface { - return &FakeResourceClaims{c, namespace} +func (c *FakeResourceV1alpha3) PodSchedulingContexts(namespace string) v1alpha3.PodSchedulingContextInterface { + return &FakePodSchedulingContexts{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClaimParameters(namespace string) v1alpha2.ResourceClaimParametersInterface { - return &FakeResourceClaimParameters{c, namespace} +func (c *FakeResourceV1alpha3) ResourceClaims(namespace string) v1alpha3.ResourceClaimInterface { + return &FakeResourceClaims{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClaimTemplates(namespace string) v1alpha2.ResourceClaimTemplateInterface { +func (c *FakeResourceV1alpha3) ResourceClaimTemplates(namespace string) v1alpha3.ResourceClaimTemplateInterface { return &FakeResourceClaimTemplates{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClasses() v1alpha2.ResourceClassInterface { - return &FakeResourceClasses{c} -} - -func (c *FakeResourceV1alpha2) ResourceClassParameters(namespace string) v1alpha2.ResourceClassParametersInterface { - return &FakeResourceClassParameters{c, namespace} -} - -func (c *FakeResourceV1alpha2) ResourceSlices() v1alpha2.ResourceSliceInterface { +func (c *FakeResourceV1alpha3) ResourceSlices() v1alpha3.ResourceSliceInterface { return &FakeResourceSlices{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeResourceV1alpha2) RESTClient() rest.Interface { +func (c *FakeResourceV1alpha3) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go similarity index 75% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go index f0d028ba27014..db38b3d60c751 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaims implements ResourceClaimInterface type FakeResourceClaims struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var resourceclaimsResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaims") +var resourceclaimsResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaims") -var resourceclaimsKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaim") +var resourceclaimsKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim") // Get takes name of the resourceClaim, and returns the corresponding resourceClaim object, and an error if there is any. -func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. -func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { - emptyResult := &v1alpha2.ResourceClaimList{} +func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimList, err error) { + emptyResult := &v1alpha3.ResourceClaimList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClaimList{ListMeta: obj.(*v1alpha2.ResourceClaimList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClaimList).Items { + list := &v1alpha3.ResourceClaimList{ListMeta: obj.(*v1alpha3.ResourceClaimList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClaimList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,46 +85,46 @@ func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a resourceClaim and creates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // Update takes the representation of a resourceClaim and updates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(resourceclaimsResource, "status", c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // Delete takes name of the resourceClaim and deletes it. Returns an error if one occurs. func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimsResource, c.ns, name, opts), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewDeleteActionWithOptions(resourceclaimsResource, c.ns, name, opts), &v1alpha3.ResourceClaim{}) return err } @@ -133,24 +133,24 @@ func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.De func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimsResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimList{}) return err } // Patch applies the patch and returns the patched resourceClaim. -func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaim. -func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) { +func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { if resourceClaim == nil { return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") } @@ -162,19 +162,19 @@ func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaim{} + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) { +func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { if resourceClaim == nil { return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") } @@ -186,12 +186,12 @@ func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *res if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaim{} + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go similarity index 75% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go index f3bca1991bbd9..28db7261f936e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaimTemplates implements ResourceClaimTemplateInterface type FakeResourceClaimTemplates struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var resourceclaimtemplatesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaimtemplates") +var resourceclaimtemplatesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates") -var resourceclaimtemplatesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimTemplate") +var resourceclaimtemplatesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate") // Get takes name of the resourceClaimTemplate, and returns the corresponding resourceClaimTemplate object, and an error if there is any. -func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimtemplatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. -func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplateList{} +func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimTemplateList, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplateList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptio if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClaimTemplateList{ListMeta: obj.(*v1alpha2.ResourceClaimTemplateList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClaimTemplateList).Items { + list := &v1alpha3.ResourceClaimTemplateList{ListMeta: obj.(*v1alpha3.ResourceClaimTemplateList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClaimTemplateList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,33 +85,33 @@ func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOpti } // Create takes the representation of a resourceClaimTemplate and creates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // Update takes the representation of a resourceClaimTemplate and updates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // Delete takes name of the resourceClaimTemplate and deletes it. Returns an error if one occurs. func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimtemplatesResource, c.ns, name, opts), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewDeleteActionWithOptions(resourceclaimtemplatesResource, c.ns, name, opts), &v1alpha3.ResourceClaimTemplate{}) return err } @@ -120,24 +120,24 @@ func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, op func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimtemplatesResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimTemplateList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimTemplateList{}) return err } // Patch applies the patch and returns the patched resourceClaimTemplate. -func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimTemplate. -func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { +func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { if resourceClaimTemplate == nil { return nil, fmt.Errorf("resourceClaimTemplate provided to Apply must not be nil") } @@ -149,12 +149,12 @@ func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTem if name == nil { return nil, fmt.Errorf("resourceClaimTemplate.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaimTemplate{} + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go similarity index 75% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go index 7890e8af49bba..c355fc454aa06 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go @@ -23,38 +23,38 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceSlices implements ResourceSliceInterface type FakeResourceSlices struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 } -var resourceslicesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceslices") +var resourceslicesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceslices") -var resourceslicesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice") +var resourceslicesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice") // Get takes name of the resourceSlice, and returns the corresponding resourceSlice object, and an error if there is any. -func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(resourceslicesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. -func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { - emptyResult := &v1alpha2.ResourceSliceList{} +func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceSliceList, err error) { + emptyResult := &v1alpha3.ResourceSliceList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(resourceslicesResource, resourceslicesKind, opts), emptyResult) if obj == nil { @@ -65,8 +65,8 @@ func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceSliceList{ListMeta: obj.(*v1alpha2.ResourceSliceList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceSliceList).Items { + list := &v1alpha3.ResourceSliceList{ListMeta: obj.(*v1alpha3.ResourceSliceList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceSliceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -81,31 +81,31 @@ func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // Update takes the representation of a resourceSlice and updates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // Delete takes name of the resourceSlice and deletes it. Returns an error if one occurs. func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceslicesResource, name, opts), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootDeleteActionWithOptions(resourceslicesResource, name, opts), &v1alpha3.ResourceSlice{}) return err } @@ -113,23 +113,23 @@ func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.De func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(resourceslicesResource, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceSliceList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceSliceList{}) return err } // Patch applies the patch and returns the patched resourceSlice. -func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceSlice. -func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceSlice, err error) { +func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) { if resourceSlice == nil { return nil, fmt.Errorf("resourceSlice provided to Apply must not be nil") } @@ -141,11 +141,11 @@ func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev if name == nil { return nil, fmt.Errorf("resourceSlice.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceSlice{} + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go similarity index 83% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/generated_expansion.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go index d11410bb9b997..747e564b769ed 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go @@ -16,18 +16,14 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 + +type DeviceClassExpansion interface{} type PodSchedulingContextExpansion interface{} type ResourceClaimExpansion interface{} -type ResourceClaimParametersExpansion interface{} - type ResourceClaimTemplateExpansion interface{} -type ResourceClassExpansion interface{} - -type ResourceClassParametersExpansion interface{} - type ResourceSliceExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go similarity index 66% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go index 0ffdc1501332d..af598432127a1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,36 +38,36 @@ type PodSchedulingContextsGetter interface { // PodSchedulingContextInterface has methods to work with PodSchedulingContext resources. type PodSchedulingContextInterface interface { - Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (*v1alpha2.PodSchedulingContext, error) - Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) + Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (*v1alpha3.PodSchedulingContext, error) + Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha3.PodSchedulingContext, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) + UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha3.PodSchedulingContext, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.PodSchedulingContext, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.PodSchedulingContextList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.PodSchedulingContext, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.PodSchedulingContextList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) - Apply(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) + Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) + ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) PodSchedulingContextExpansion } // podSchedulingContexts implements PodSchedulingContextInterface type podSchedulingContexts struct { - *gentype.ClientWithListAndApply[*v1alpha2.PodSchedulingContext, *v1alpha2.PodSchedulingContextList, *resourcev1alpha2.PodSchedulingContextApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.PodSchedulingContext, *v1alpha3.PodSchedulingContextList, *resourcev1alpha3.PodSchedulingContextApplyConfiguration] } // newPodSchedulingContexts returns a PodSchedulingContexts -func newPodSchedulingContexts(c *ResourceV1alpha2Client, namespace string) *podSchedulingContexts { +func newPodSchedulingContexts(c *ResourceV1alpha3Client, namespace string) *podSchedulingContexts { return &podSchedulingContexts{ - gentype.NewClientWithListAndApply[*v1alpha2.PodSchedulingContext, *v1alpha2.PodSchedulingContextList, *resourcev1alpha2.PodSchedulingContextApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.PodSchedulingContext, *v1alpha3.PodSchedulingContextList, *resourcev1alpha3.PodSchedulingContextApplyConfiguration]( "podschedulingcontexts", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.PodSchedulingContext { return &v1alpha2.PodSchedulingContext{} }, - func() *v1alpha2.PodSchedulingContextList { return &v1alpha2.PodSchedulingContextList{} }), + func() *v1alpha3.PodSchedulingContext { return &v1alpha3.PodSchedulingContext{} }, + func() *v1alpha3.PodSchedulingContextList { return &v1alpha3.PodSchedulingContextList{} }), } } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resource_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go similarity index 61% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resource_client.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go index 8e258b3e1ca7d..879f0990d73d9 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resource_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go @@ -16,64 +16,54 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "net/http" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) -type ResourceV1alpha2Interface interface { +type ResourceV1alpha3Interface interface { RESTClient() rest.Interface + DeviceClassesGetter PodSchedulingContextsGetter ResourceClaimsGetter - ResourceClaimParametersGetter ResourceClaimTemplatesGetter - ResourceClassesGetter - ResourceClassParametersGetter ResourceSlicesGetter } -// ResourceV1alpha2Client is used to interact with features provided by the resource.k8s.io group. -type ResourceV1alpha2Client struct { +// ResourceV1alpha3Client is used to interact with features provided by the resource.k8s.io group. +type ResourceV1alpha3Client struct { restClient rest.Interface } -func (c *ResourceV1alpha2Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { - return newPodSchedulingContexts(c, namespace) +func (c *ResourceV1alpha3Client) DeviceClasses() DeviceClassInterface { + return newDeviceClasses(c) } -func (c *ResourceV1alpha2Client) ResourceClaims(namespace string) ResourceClaimInterface { - return newResourceClaims(c, namespace) +func (c *ResourceV1alpha3Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { + return newPodSchedulingContexts(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClaimParameters(namespace string) ResourceClaimParametersInterface { - return newResourceClaimParameters(c, namespace) +func (c *ResourceV1alpha3Client) ResourceClaims(namespace string) ResourceClaimInterface { + return newResourceClaims(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { +func (c *ResourceV1alpha3Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { return newResourceClaimTemplates(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClasses() ResourceClassInterface { - return newResourceClasses(c) -} - -func (c *ResourceV1alpha2Client) ResourceClassParameters(namespace string) ResourceClassParametersInterface { - return newResourceClassParameters(c, namespace) -} - -func (c *ResourceV1alpha2Client) ResourceSlices() ResourceSliceInterface { +func (c *ResourceV1alpha3Client) ResourceSlices() ResourceSliceInterface { return newResourceSlices(c) } -// NewForConfig creates a new ResourceV1alpha2Client for the given config. +// NewForConfig creates a new ResourceV1alpha3Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ResourceV1alpha2Client, error) { +func NewForConfig(c *rest.Config) (*ResourceV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -85,9 +75,9 @@ func NewForConfig(c *rest.Config) (*ResourceV1alpha2Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new ResourceV1alpha2Client for the given config and http client. +// NewForConfigAndClient creates a new ResourceV1alpha3Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha2Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -96,12 +86,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha2Cli if err != nil { return nil, err } - return &ResourceV1alpha2Client{client}, nil + return &ResourceV1alpha3Client{client}, nil } -// NewForConfigOrDie creates a new ResourceV1alpha2Client for the given config and +// NewForConfigOrDie creates a new ResourceV1alpha3Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha2Client { +func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha3Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -109,13 +99,13 @@ func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha2Client { return client } -// New creates a new ResourceV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *ResourceV1alpha2Client { - return &ResourceV1alpha2Client{c} +// New creates a new ResourceV1alpha3Client for the given RESTClient. +func New(c rest.Interface) *ResourceV1alpha3Client { + return &ResourceV1alpha3Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.SchemeGroupVersion + gv := v1alpha3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -129,7 +119,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *ResourceV1alpha2Client) RESTClient() rest.Interface { +func (c *ResourceV1alpha3Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaim.go similarity index 63% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaim.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaim.go index 0f81e5008c6e8..2ac65c005e04b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaim.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,36 +38,36 @@ type ResourceClaimsGetter interface { // ResourceClaimInterface has methods to work with ResourceClaim resources. type ResourceClaimInterface interface { - Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (*v1alpha2.ResourceClaim, error) - Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) + Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (*v1alpha3.ResourceClaim, error) + Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (*v1alpha3.ResourceClaim, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) + UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (*v1alpha3.ResourceClaim, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClaim, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaim, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) - Apply(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) + Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) + ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) ResourceClaimExpansion } // resourceClaims implements ResourceClaimInterface type resourceClaims struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaim, *v1alpha2.ResourceClaimList, *resourcev1alpha2.ResourceClaimApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaim, *v1alpha3.ResourceClaimList, *resourcev1alpha3.ResourceClaimApplyConfiguration] } // newResourceClaims returns a ResourceClaims -func newResourceClaims(c *ResourceV1alpha2Client, namespace string) *resourceClaims { +func newResourceClaims(c *ResourceV1alpha3Client, namespace string) *resourceClaims { return &resourceClaims{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaim, *v1alpha2.ResourceClaimList, *resourcev1alpha2.ResourceClaimApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaim, *v1alpha3.ResourceClaimList, *resourcev1alpha3.ResourceClaimApplyConfiguration]( "resourceclaims", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ResourceClaim { return &v1alpha2.ResourceClaim{} }, - func() *v1alpha2.ResourceClaimList { return &v1alpha2.ResourceClaimList{} }), + func() *v1alpha3.ResourceClaim { return &v1alpha3.ResourceClaim{} }, + func() *v1alpha3.ResourceClaimList { return &v1alpha3.ResourceClaimList{} }), } } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go similarity index 67% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go index 3b6451a9a6aa3..87997bfee5806 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceClaimTemplatesGetter interface { // ResourceClaimTemplateInterface has methods to work with ResourceClaimTemplate resources. type ResourceClaimTemplateInterface interface { - Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (*v1alpha2.ResourceClaimTemplate, error) - Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (*v1alpha2.ResourceClaimTemplate, error) + Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (*v1alpha3.ResourceClaimTemplate, error) + Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (*v1alpha3.ResourceClaimTemplate, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClaimTemplate, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimTemplateList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaimTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimTemplateList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) - Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimTemplate, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) + Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) ResourceClaimTemplateExpansion } // resourceClaimTemplates implements ResourceClaimTemplateInterface type resourceClaimTemplates struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaimTemplate, *v1alpha2.ResourceClaimTemplateList, *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaimTemplate, *v1alpha3.ResourceClaimTemplateList, *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration] } // newResourceClaimTemplates returns a ResourceClaimTemplates -func newResourceClaimTemplates(c *ResourceV1alpha2Client, namespace string) *resourceClaimTemplates { +func newResourceClaimTemplates(c *ResourceV1alpha3Client, namespace string) *resourceClaimTemplates { return &resourceClaimTemplates{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaimTemplate, *v1alpha2.ResourceClaimTemplateList, *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaimTemplate, *v1alpha3.ResourceClaimTemplateList, *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration]( "resourceclaimtemplates", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ResourceClaimTemplate { return &v1alpha2.ResourceClaimTemplate{} }, - func() *v1alpha2.ResourceClaimTemplateList { return &v1alpha2.ResourceClaimTemplateList{} }), + func() *v1alpha3.ResourceClaimTemplate { return &v1alpha3.ResourceClaimTemplate{} }, + func() *v1alpha3.ResourceClaimTemplateList { return &v1alpha3.ResourceClaimTemplateList{} }), } } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceslice.go b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceslice.go similarity index 65% rename from staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceslice.go rename to staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceslice.go index fafeab70614a0..08190414081df 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceslice.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceslice.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceSlicesGetter interface { // ResourceSliceInterface has methods to work with ResourceSlice resources. type ResourceSliceInterface interface { - Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (*v1alpha2.ResourceSlice, error) - Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (*v1alpha2.ResourceSlice, error) + Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (*v1alpha3.ResourceSlice, error) + Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (*v1alpha3.ResourceSlice, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceSlice, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceSliceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) - Apply(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceSlice, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) + Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) ResourceSliceExpansion } // resourceSlices implements ResourceSliceInterface type resourceSlices struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceSlice, *v1alpha2.ResourceSliceList, *resourcev1alpha2.ResourceSliceApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceSlice, *v1alpha3.ResourceSliceList, *resourcev1alpha3.ResourceSliceApplyConfiguration] } // newResourceSlices returns a ResourceSlices -func newResourceSlices(c *ResourceV1alpha2Client) *resourceSlices { +func newResourceSlices(c *ResourceV1alpha3Client) *resourceSlices { return &resourceSlices{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceSlice, *v1alpha2.ResourceSliceList, *resourcev1alpha2.ResourceSliceApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceSlice, *v1alpha3.ResourceSliceList, *resourcev1alpha3.ResourceSliceApplyConfiguration]( "resourceslices", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha2.ResourceSlice { return &v1alpha2.ResourceSlice{} }, - func() *v1alpha2.ResourceSliceList { return &v1alpha2.ResourceSliceList{} }), + func() *v1alpha3.ResourceSlice { return &v1alpha3.ResourceSlice{} }, + func() *v1alpha3.ResourceSliceList { return &v1alpha3.ResourceSliceList{} }), } } diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimparameters.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimparameters.go deleted file mode 100644 index ad751a6cee77f..0000000000000 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimparameters.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" -) - -// ResourceClaimParametersLister helps list ResourceClaimParameters. -// All objects returned here must be treated as read-only. -type ResourceClaimParametersLister interface { - // List lists all ResourceClaimParameters in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimParameters, err error) - // ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. - ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister - ResourceClaimParametersListerExpansion -} - -// resourceClaimParametersLister implements the ResourceClaimParametersLister interface. -type resourceClaimParametersLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimParameters] -} - -// NewResourceClaimParametersLister returns a new ResourceClaimParametersLister. -func NewResourceClaimParametersLister(indexer cache.Indexer) ResourceClaimParametersLister { - return &resourceClaimParametersLister{listers.New[*v1alpha2.ResourceClaimParameters](indexer, v1alpha2.Resource("resourceclaimparameters"))} -} - -// ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. -func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister { - return resourceClaimParametersNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaimParameters](s.ResourceIndexer, namespace)} -} - -// ResourceClaimParametersNamespaceLister helps list and get ResourceClaimParameters. -// All objects returned here must be treated as read-only. -type ResourceClaimParametersNamespaceLister interface { - // List lists all ResourceClaimParameters in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimParameters, err error) - // Get retrieves the ResourceClaimParameters from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClaimParameters, error) - ResourceClaimParametersNamespaceListerExpansion -} - -// resourceClaimParametersNamespaceLister implements the ResourceClaimParametersNamespaceLister -// interface. -type resourceClaimParametersNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimParameters] -} diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclassparameters.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclassparameters.go deleted file mode 100644 index f731bfe13388b..0000000000000 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclassparameters.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" -) - -// ResourceClassParametersLister helps list ResourceClassParameters. -// All objects returned here must be treated as read-only. -type ResourceClassParametersLister interface { - // List lists all ResourceClassParameters in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClassParameters, err error) - // ResourceClassParameters returns an object that can list and get ResourceClassParameters. - ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister - ResourceClassParametersListerExpansion -} - -// resourceClassParametersLister implements the ResourceClassParametersLister interface. -type resourceClassParametersLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClassParameters] -} - -// NewResourceClassParametersLister returns a new ResourceClassParametersLister. -func NewResourceClassParametersLister(indexer cache.Indexer) ResourceClassParametersLister { - return &resourceClassParametersLister{listers.New[*v1alpha2.ResourceClassParameters](indexer, v1alpha2.Resource("resourceclassparameters"))} -} - -// ResourceClassParameters returns an object that can list and get ResourceClassParameters. -func (s *resourceClassParametersLister) ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister { - return resourceClassParametersNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClassParameters](s.ResourceIndexer, namespace)} -} - -// ResourceClassParametersNamespaceLister helps list and get ResourceClassParameters. -// All objects returned here must be treated as read-only. -type ResourceClassParametersNamespaceLister interface { - // List lists all ResourceClassParameters in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClassParameters, err error) - // Get retrieves the ResourceClassParameters from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClassParameters, error) - ResourceClassParametersNamespaceListerExpansion -} - -// resourceClassParametersNamespaceLister implements the ResourceClassParametersNamespaceLister -// interface. -type resourceClassParametersNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClassParameters] -} diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclass.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/deviceclass.go similarity index 52% rename from staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclass.go rename to staging/src/k8s.io/client-go/listers/resource/v1alpha3/deviceclass.go index ecbe18a767b67..0950691e2b09d 100644 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclass.go +++ b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/deviceclass.go @@ -16,33 +16,33 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) -// ResourceClassLister helps list ResourceClasses. +// DeviceClassLister helps list DeviceClasses. // All objects returned here must be treated as read-only. -type ResourceClassLister interface { - // List lists all ResourceClasses in the indexer. +type DeviceClassLister interface { + // List lists all DeviceClasses in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClass, err error) - // Get retrieves the ResourceClass from the index for a given name. + List(selector labels.Selector) (ret []*v1alpha3.DeviceClass, err error) + // Get retrieves the DeviceClass from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClass, error) - ResourceClassListerExpansion + Get(name string) (*v1alpha3.DeviceClass, error) + DeviceClassListerExpansion } -// resourceClassLister implements the ResourceClassLister interface. -type resourceClassLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClass] +// deviceClassLister implements the DeviceClassLister interface. +type deviceClassLister struct { + listers.ResourceIndexer[*v1alpha3.DeviceClass] } -// NewResourceClassLister returns a new ResourceClassLister. -func NewResourceClassLister(indexer cache.Indexer) ResourceClassLister { - return &resourceClassLister{listers.New[*v1alpha2.ResourceClass](indexer, v1alpha2.Resource("resourceclass"))} +// NewDeviceClassLister returns a new DeviceClassLister. +func NewDeviceClassLister(indexer cache.Indexer) DeviceClassLister { + return &deviceClassLister{listers.New[*v1alpha3.DeviceClass](indexer, v1alpha3.Resource("deviceclass"))} } diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/expansion_generated.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go similarity index 66% rename from staging/src/k8s.io/client-go/listers/resource/v1alpha2/expansion_generated.go rename to staging/src/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go index 68861832d9c8d..b6642f635f95d 100644 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/expansion_generated.go +++ b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go @@ -16,7 +16,11 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 + +// DeviceClassListerExpansion allows custom methods to be added to +// DeviceClassLister. +type DeviceClassListerExpansion interface{} // PodSchedulingContextListerExpansion allows custom methods to be added to // PodSchedulingContextLister. @@ -34,14 +38,6 @@ type ResourceClaimListerExpansion interface{} // ResourceClaimNamespaceLister. type ResourceClaimNamespaceListerExpansion interface{} -// ResourceClaimParametersListerExpansion allows custom methods to be added to -// ResourceClaimParametersLister. -type ResourceClaimParametersListerExpansion interface{} - -// ResourceClaimParametersNamespaceListerExpansion allows custom methods to be added to -// ResourceClaimParametersNamespaceLister. -type ResourceClaimParametersNamespaceListerExpansion interface{} - // ResourceClaimTemplateListerExpansion allows custom methods to be added to // ResourceClaimTemplateLister. type ResourceClaimTemplateListerExpansion interface{} @@ -50,18 +46,6 @@ type ResourceClaimTemplateListerExpansion interface{} // ResourceClaimTemplateNamespaceLister. type ResourceClaimTemplateNamespaceListerExpansion interface{} -// ResourceClassListerExpansion allows custom methods to be added to -// ResourceClassLister. -type ResourceClassListerExpansion interface{} - -// ResourceClassParametersListerExpansion allows custom methods to be added to -// ResourceClassParametersLister. -type ResourceClassParametersListerExpansion interface{} - -// ResourceClassParametersNamespaceListerExpansion allows custom methods to be added to -// ResourceClassParametersNamespaceLister. -type ResourceClassParametersNamespaceListerExpansion interface{} - // ResourceSliceListerExpansion allows custom methods to be added to // ResourceSliceLister. type ResourceSliceListerExpansion interface{} diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/podschedulingcontext.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/podschedulingcontext.go similarity index 81% rename from staging/src/k8s.io/client-go/listers/resource/v1alpha2/podschedulingcontext.go rename to staging/src/k8s.io/client-go/listers/resource/v1alpha3/podschedulingcontext.go index 9aca7bfbf9306..ed9b049432331 100644 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/podschedulingcontext.go +++ b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/podschedulingcontext.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type PodSchedulingContextLister interface { // List lists all PodSchedulingContexts in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.PodSchedulingContext, err error) + List(selector labels.Selector) (ret []*v1alpha3.PodSchedulingContext, err error) // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister PodSchedulingContextListerExpansion @@ -38,17 +38,17 @@ type PodSchedulingContextLister interface { // podSchedulingContextLister implements the PodSchedulingContextLister interface. type podSchedulingContextLister struct { - listers.ResourceIndexer[*v1alpha2.PodSchedulingContext] + listers.ResourceIndexer[*v1alpha3.PodSchedulingContext] } // NewPodSchedulingContextLister returns a new PodSchedulingContextLister. func NewPodSchedulingContextLister(indexer cache.Indexer) PodSchedulingContextLister { - return &podSchedulingContextLister{listers.New[*v1alpha2.PodSchedulingContext](indexer, v1alpha2.Resource("podschedulingcontext"))} + return &podSchedulingContextLister{listers.New[*v1alpha3.PodSchedulingContext](indexer, v1alpha3.Resource("podschedulingcontext"))} } // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. func (s *podSchedulingContextLister) PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister { - return podSchedulingContextNamespaceLister{listers.NewNamespaced[*v1alpha2.PodSchedulingContext](s.ResourceIndexer, namespace)} + return podSchedulingContextNamespaceLister{listers.NewNamespaced[*v1alpha3.PodSchedulingContext](s.ResourceIndexer, namespace)} } // PodSchedulingContextNamespaceLister helps list and get PodSchedulingContexts. @@ -56,15 +56,15 @@ func (s *podSchedulingContextLister) PodSchedulingContexts(namespace string) Pod type PodSchedulingContextNamespaceLister interface { // List lists all PodSchedulingContexts in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.PodSchedulingContext, err error) + List(selector labels.Selector) (ret []*v1alpha3.PodSchedulingContext, err error) // Get retrieves the PodSchedulingContext from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.PodSchedulingContext, error) + Get(name string) (*v1alpha3.PodSchedulingContext, error) PodSchedulingContextNamespaceListerExpansion } // podSchedulingContextNamespaceLister implements the PodSchedulingContextNamespaceLister // interface. type podSchedulingContextNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.PodSchedulingContext] + listers.ResourceIndexer[*v1alpha3.PodSchedulingContext] } diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaim.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceclaim.go similarity index 81% rename from staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaim.go rename to staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceclaim.go index 8d789314dbc48..ac6a3e1564035 100644 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaim.go +++ b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceclaim.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type ResourceClaimLister interface { // List lists all ResourceClaims in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaim, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaim, err error) // ResourceClaims returns an object that can list and get ResourceClaims. ResourceClaims(namespace string) ResourceClaimNamespaceLister ResourceClaimListerExpansion @@ -38,17 +38,17 @@ type ResourceClaimLister interface { // resourceClaimLister implements the ResourceClaimLister interface. type resourceClaimLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaim] + listers.ResourceIndexer[*v1alpha3.ResourceClaim] } // NewResourceClaimLister returns a new ResourceClaimLister. func NewResourceClaimLister(indexer cache.Indexer) ResourceClaimLister { - return &resourceClaimLister{listers.New[*v1alpha2.ResourceClaim](indexer, v1alpha2.Resource("resourceclaim"))} + return &resourceClaimLister{listers.New[*v1alpha3.ResourceClaim](indexer, v1alpha3.Resource("resourceclaim"))} } // ResourceClaims returns an object that can list and get ResourceClaims. func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimNamespaceLister { - return resourceClaimNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaim](s.ResourceIndexer, namespace)} + return resourceClaimNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaim](s.ResourceIndexer, namespace)} } // ResourceClaimNamespaceLister helps list and get ResourceClaims. @@ -56,15 +56,15 @@ func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimName type ResourceClaimNamespaceLister interface { // List lists all ResourceClaims in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaim, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaim, err error) // Get retrieves the ResourceClaim from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClaim, error) + Get(name string) (*v1alpha3.ResourceClaim, error) ResourceClaimNamespaceListerExpansion } // resourceClaimNamespaceLister implements the ResourceClaimNamespaceLister // interface. type resourceClaimNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaim] + listers.ResourceIndexer[*v1alpha3.ResourceClaim] } diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimtemplate.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceclaimtemplate.go similarity index 82% rename from staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimtemplate.go rename to staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceclaimtemplate.go index 7ad1c769fac85..6c15f82bba8dc 100644 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceclaimtemplate.go +++ b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceclaimtemplate.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type ResourceClaimTemplateLister interface { // List lists all ResourceClaimTemplates in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimTemplate, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimTemplate, err error) // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister ResourceClaimTemplateListerExpansion @@ -38,17 +38,17 @@ type ResourceClaimTemplateLister interface { // resourceClaimTemplateLister implements the ResourceClaimTemplateLister interface. type resourceClaimTemplateLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimTemplate] + listers.ResourceIndexer[*v1alpha3.ResourceClaimTemplate] } // NewResourceClaimTemplateLister returns a new ResourceClaimTemplateLister. func NewResourceClaimTemplateLister(indexer cache.Indexer) ResourceClaimTemplateLister { - return &resourceClaimTemplateLister{listers.New[*v1alpha2.ResourceClaimTemplate](indexer, v1alpha2.Resource("resourceclaimtemplate"))} + return &resourceClaimTemplateLister{listers.New[*v1alpha3.ResourceClaimTemplate](indexer, v1alpha3.Resource("resourceclaimtemplate"))} } // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister { - return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaimTemplate](s.ResourceIndexer, namespace)} + return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaimTemplate](s.ResourceIndexer, namespace)} } // ResourceClaimTemplateNamespaceLister helps list and get ResourceClaimTemplates. @@ -56,15 +56,15 @@ func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) R type ResourceClaimTemplateNamespaceLister interface { // List lists all ResourceClaimTemplates in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimTemplate, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimTemplate, err error) // Get retrieves the ResourceClaimTemplate from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClaimTemplate, error) + Get(name string) (*v1alpha3.ResourceClaimTemplate, error) ResourceClaimTemplateNamespaceListerExpansion } // resourceClaimTemplateNamespaceLister implements the ResourceClaimTemplateNamespaceLister // interface. type resourceClaimTemplateNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimTemplate] + listers.ResourceIndexer[*v1alpha3.ResourceClaimTemplate] } diff --git a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceslice.go b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceslice.go similarity index 80% rename from staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceslice.go rename to staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceslice.go index c5937df8277eb..ae87b8b66dfdc 100644 --- a/staging/src/k8s.io/client-go/listers/resource/v1alpha2/resourceslice.go +++ b/staging/src/k8s.io/client-go/listers/resource/v1alpha3/resourceslice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,19 +30,19 @@ import ( type ResourceSliceLister interface { // List lists all ResourceSlices in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceSlice, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceSlice, err error) // Get retrieves the ResourceSlice from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceSlice, error) + Get(name string) (*v1alpha3.ResourceSlice, error) ResourceSliceListerExpansion } // resourceSliceLister implements the ResourceSliceLister interface. type resourceSliceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceSlice] + listers.ResourceIndexer[*v1alpha3.ResourceSlice] } // NewResourceSliceLister returns a new ResourceSliceLister. func NewResourceSliceLister(indexer cache.Indexer) ResourceSliceLister { - return &resourceSliceLister{listers.New[*v1alpha2.ResourceSlice](indexer, v1alpha2.Resource("resourceslice"))} + return &resourceSliceLister{listers.New[*v1alpha3.ResourceSlice](indexer, v1alpha3.Resource("resourceslice"))} } diff --git a/staging/src/k8s.io/dynamic-resource-allocation/cel/compile.go b/staging/src/k8s.io/dynamic-resource-allocation/cel/compile.go new file mode 100644 index 0000000000000..45b08b0e2dd89 --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/cel/compile.go @@ -0,0 +1,286 @@ +/* +Copyright 2022 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. +*/ + +package cel + +import ( + "context" + "errors" + "fmt" + "reflect" + "strings" + + "github.com/blang/semver/v4" + "github.com/google/cel-go/cel" + "github.com/google/cel-go/common/types" + "github.com/google/cel-go/common/types/ref" + "github.com/google/cel-go/common/types/traits" + "github.com/google/cel-go/ext" + + resourceapi "k8s.io/api/resource/v1alpha3" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/version" + celconfig "k8s.io/apiserver/pkg/apis/cel" + apiservercel "k8s.io/apiserver/pkg/cel" + "k8s.io/apiserver/pkg/cel/environment" +) + +const ( + deviceVar = "device" + driverVar = "driver" + attributesVar = "attributes" + capacityVar = "capacity" +) + +var ( + Compiler = newCompiler() +) + +// CompilationResult represents a compiled expression. +type CompilationResult struct { + Program cel.Program + Error *apiservercel.Error + Expression string + OutputType *cel.Type + Environment *cel.Env + + emptyMapVal ref.Val +} + +// Device defines the input values for a CEL selector expression. +type Device struct { + // Driver gets used as domain for any attribute which does not already + // have a domain prefix. If set, then it is also made available as a + // string attribute. + Driver string + Attributes map[resourceapi.QualifiedName]resourceapi.DeviceAttribute + Capacity map[resourceapi.QualifiedName]resource.Quantity +} + +type compiler struct { + envset *environment.EnvSet +} + +func newCompiler() *compiler { + return &compiler{envset: mustBuildEnv()} +} + +// CompileCELExpression returns a compiled CEL expression. It evaluates to bool. +// +// TODO: validate AST to detect invalid attribute names. +func (c compiler) CompileCELExpression(expression string, envType environment.Type) CompilationResult { + resultError := func(errorString string, errType apiservercel.ErrorType) CompilationResult { + return CompilationResult{ + Error: &apiservercel.Error{ + Type: errType, + Detail: errorString, + }, + Expression: expression, + } + } + + env, err := c.envset.Env(envType) + if err != nil { + return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal) + } + + ast, issues := env.Compile(expression) + if issues != nil { + return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid) + } + expectedReturnType := cel.BoolType + if ast.OutputType() != expectedReturnType && + ast.OutputType() != cel.AnyType { + return resultError(fmt.Sprintf("must evaluate to %v or the unknown type, not %v", expectedReturnType.String(), ast.OutputType().String()), apiservercel.ErrorTypeInvalid) + } + _, err = cel.AstToCheckedExpr(ast) + if err != nil { + // should be impossible since env.Compile returned no issues + return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal) + } + prog, err := env.Program(ast, + cel.InterruptCheckFrequency(celconfig.CheckFrequency), + ) + if err != nil { + return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal) + } + return CompilationResult{ + Program: prog, + Expression: expression, + OutputType: ast.OutputType(), + Environment: env, + emptyMapVal: env.CELTypeAdapter().NativeToValue(map[string]any{}), + } +} + +// getAttributeValue returns the native representation of the one value that +// should be stored in the attribute, otherwise an error. An error is +// also returned when there is no supported value. +func getAttributeValue(attr resourceapi.DeviceAttribute) (any, error) { + switch { + case attr.IntValue != nil: + return *attr.IntValue, nil + case attr.BoolValue != nil: + return *attr.BoolValue, nil + case attr.StringValue != nil: + return *attr.StringValue, nil + case attr.VersionValue != nil: + v, err := semver.Parse(*attr.VersionValue) + if err != nil { + return nil, fmt.Errorf("parse semantic version: %w", err) + } + return Semver{Version: v}, nil + default: + return nil, errors.New("unsupported attribute value") + } +} + +var boolType = reflect.TypeOf(true) + +func (c CompilationResult) DeviceMatches(ctx context.Context, input Device) (bool, error) { + // TODO (future): avoid building these maps and instead use a proxy + // which wraps the underlying maps and directly looks up values. + attributes := make(map[string]any) + for name, attr := range input.Attributes { + value, err := getAttributeValue(attr) + if err != nil { + return false, fmt.Errorf("attribute %s: %w", name, err) + } + domain, id := parseQualifiedName(name, input.Driver) + if attributes[domain] == nil { + attributes[domain] = make(map[string]any) + } + attributes[domain].(map[string]any)[id] = value + } + + capacity := make(map[string]any) + for name, quantity := range input.Capacity { + domain, id := parseQualifiedName(name, input.Driver) + if capacity[domain] == nil { + capacity[domain] = make(map[string]apiservercel.Quantity) + } + capacity[domain].(map[string]apiservercel.Quantity)[id] = apiservercel.Quantity{Quantity: &quantity} + } + + variables := map[string]any{ + deviceVar: map[string]any{ + driverVar: input.Driver, + attributesVar: newStringInterfaceMapWithDefault(c.Environment.CELTypeAdapter(), attributes, c.emptyMapVal), + capacityVar: newStringInterfaceMapWithDefault(c.Environment.CELTypeAdapter(), capacity, c.emptyMapVal), + }, + } + + result, _, err := c.Program.ContextEval(ctx, variables) + if err != nil { + return false, err + } + resultAny, err := result.ConvertToNative(boolType) + if err != nil { + return false, fmt.Errorf("CEL result of type %s could not be converted to bool: %w", result.Type().TypeName(), err) + } + resultBool, ok := resultAny.(bool) + if !ok { + return false, fmt.Errorf("CEL native result value should have been a bool, got instead: %T", resultAny) + } + return resultBool, nil +} + +func mustBuildEnv() *environment.EnvSet { + envset := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), false /* strictCost */) + field := func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField { + return apiservercel.NewDeclField(name, declType, required, nil, nil) + } + fields := func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField { + result := make(map[string]*apiservercel.DeclField, len(fields)) + for _, f := range fields { + result[f.Name] = f + } + return result + } + deviceType := apiservercel.NewObjectType("kubernetes.DRADevice", fields( + field(driverVar, apiservercel.StringType, true), + field(attributesVar, apiservercel.NewMapType(apiservercel.StringType, apiservercel.NewMapType(apiservercel.StringType, apiservercel.AnyType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), true), + field(capacityVar, apiservercel.NewMapType(apiservercel.StringType, apiservercel.NewMapType(apiservercel.StringType, apiservercel.AnyType /* TODO (future): is there a QuantityType that can be used here? */, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), true), + )) + + versioned := []environment.VersionedOptions{ + { + // Feature epoch was actually 1.31, but we artificially set it to 1.0 because these + // options should always be present. + // + // TODO (https://github.com/kubernetes/kubernetes/issues/123687): set this + // version properly before going to beta. + IntroducedVersion: version.MajorMinor(1, 0), + EnvOptions: []cel.EnvOption{ + cel.Variable(deviceVar, deviceType.CelType()), + + SemverLib(), + + // https://pkg.go.dev/github.com/google/cel-go/ext#Bindings + // + // This is useful to simplify attribute lookups because the + // domain only needs to be given once: + // + // cel.bind(dra, device.attributes["dra.example.com"], dra.oneBool && dra.anotherBool) + ext.Bindings(), + }, + DeclTypes: []*apiservercel.DeclType{ + deviceType, + }, + }, + } + envset, err := envset.Extend(versioned...) + if err != nil { + panic(fmt.Errorf("internal error building CEL environment: %w", err)) + } + return envset +} + +// parseQualifiedName splits into domain and identified, using the default domain +// if the name does not contain one. +func parseQualifiedName(name resourceapi.QualifiedName, defaultDomain string) (string, string) { + sep := strings.Index(string(name), "/") + if sep == -1 { + return defaultDomain, string(name) + } + return string(name[0:sep]), string(name[sep+1:]) +} + +// newStringInterfaceMapWithDefault is like +// https://pkg.go.dev/github.com/google/cel-go@v0.20.1/common/types#NewStringInterfaceMap, +// except that looking up an unknown key returns a default value. +func newStringInterfaceMapWithDefault(adapter types.Adapter, value map[string]any, defaultValue ref.Val) traits.Mapper { + return mapper{ + Mapper: types.NewStringInterfaceMap(adapter, value), + defaultValue: defaultValue, + } +} + +type mapper struct { + traits.Mapper + defaultValue ref.Val +} + +// Find wraps the mapper's Find so that a default empty map is returned when +// the lookup did not find the entry. +func (m mapper) Find(key ref.Val) (ref.Val, bool) { + value, found := m.Mapper.Find(key) + if found { + return value, true + } + + return m.defaultValue, true +} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/cel/compile_test.go b/staging/src/k8s.io/dynamic-resource-allocation/cel/compile_test.go new file mode 100644 index 0000000000000..99c5241448e10 --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/cel/compile_test.go @@ -0,0 +1,212 @@ +/* +Copyright 2022 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. +*/ + +package cel + +import ( + "strings" + "testing" + + resourceapi "k8s.io/api/resource/v1alpha3" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apiserver/pkg/cel/environment" + "k8s.io/klog/v2/ktesting" + "k8s.io/utils/ptr" +) + +func TestCompile(t *testing.T) { + for name, scenario := range map[string]struct { + expression string + driver string + attributes map[resourceapi.QualifiedName]resourceapi.DeviceAttribute + capacity map[resourceapi.QualifiedName]resource.Quantity + expectCompileError string + expectMatchError string + expectMatch bool + }{ + "true": { + expression: "true", + expectMatch: true, + }, + "false": { + expression: "false", + expectMatch: false, + }, + "syntax-error": { + expression: "?!", + expectCompileError: "Syntax error", + }, + "type-error": { + expression: `1`, + expectCompileError: "must evaluate to bool or the unknown type, not int", + }, + "runtime-error-lookup-identifier": { + expression: `device.attributes["no-such-domain"].noSuchAttr.isGreaterThan(quantity("0"))`, + expectMatchError: "no such key: noSuchAttr", + }, + "runtime-error-lookup-map": { + expression: `device.attributes["no-such-domain"]["noSuchAttr"].isGreaterThan(quantity("0"))`, + expectMatchError: "no such key: noSuchAttr", + }, + "domain-check-negative": { + expression: `"no-such-domain" in device.attributes`, + expectMatch: false, + }, + "domain-check-positive": { + expression: `"dra.example.com" in device.attributes`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"dra.example.com/something": {BoolValue: ptr.To(true)}}, + expectMatch: true, + }, + "empty-driver-name": { + expression: `device.driver == ""`, + expectMatch: true, + }, + "real-driver-name": { + expression: `device.driver == "dra.example.com"`, + driver: "dra.example.com", + expectMatch: true, + }, + "driver-name-qualifier": { + expression: `device.attributes["dra.example.com"].name`, + driver: "dra.example.com", + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {BoolValue: ptr.To(true)}}, + expectMatch: true, + }, + "driver-name-qualifier-map-lookup": { + expression: `device.attributes["dra.example.com"]["name"]`, + driver: "dra.example.com", + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {BoolValue: ptr.To(true)}}, + expectMatch: true, + }, + "bind": { + expression: `cel.bind(dra, device.attributes["dra.example.com"], dra.name)`, + driver: "dra.example.com", + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {BoolValue: ptr.To(true)}}, + expectMatch: true, + }, + "qualified-attribute-name": { + expression: `device.attributes["other.example.com"].name`, + driver: "dra.example.com", + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"other.example.com/name": {BoolValue: ptr.To(true)}}, + expectMatch: true, + }, + "bool": { + expression: `device.attributes["dra.example.com"].name`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {BoolValue: ptr.To(true)}}, + driver: "dra.example.com", + expectMatch: true, + }, + "int": { + expression: `device.attributes["dra.example.com"].name > 0`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {IntValue: ptr.To(int64(1))}}, + driver: "dra.example.com", + expectMatch: true, + }, + "string": { + expression: `device.attributes["dra.example.com"].name == "fish"`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {StringValue: ptr.To("fish")}}, + driver: "dra.example.com", + expectMatch: true, + }, + "version": { + expression: `device.attributes["dra.example.com"].name.isGreaterThan(semver("0.0.1"))`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{"name": {VersionValue: ptr.To("1.0.0")}}, + driver: "dra.example.com", + expectMatch: true, + }, + "quantity": { + expression: `device.capacity["dra.example.com"].name.isGreaterThan(quantity("1Ki"))`, + capacity: map[resourceapi.QualifiedName]resource.Quantity{"name": resource.MustParse("1Mi")}, + driver: "dra.example.com", + expectMatch: true, + }, + "check-positive": { + expression: `"name" in device.capacity["dra.example.com"] && device.capacity["dra.example.com"].name.isGreaterThan(quantity("1Ki"))`, + capacity: map[resourceapi.QualifiedName]resource.Quantity{"name": resource.MustParse("1Mi")}, + driver: "dra.example.com", + expectMatch: true, + }, + "check-negative": { + expression: `!("name" in device.capacity["dra.example.com"]) || device.capacity["dra.example.com"].name.isGreaterThan(quantity("1Ki"))`, + expectMatch: true, + }, + "all": { + expression: ` +device.capacity["dra.example.com"].quantity.isGreaterThan(quantity("1Ki")) && +device.attributes["dra.example.com"].bool && +device.attributes["dra.example.com"].int > 0 && +device.attributes["dra.example.com"].string == "fish" && +device.attributes["dra.example.com"].version.isGreaterThan(semver("0.0.1")) && +device.capacity["dra.example.com"]["quantity"].isGreaterThan(quantity("1Ki")) && +device.attributes["dra.example.com"]["bool"] && +device.attributes["dra.example.com"]["int"] > 0 && +device.attributes["dra.example.com"]["string"] == "fish" && +device.attributes["dra.example.com"]["version"].isGreaterThan(semver("0.0.1")) +`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "bool": {BoolValue: ptr.To(true)}, + "int": {IntValue: ptr.To(int64(1))}, + "string": {StringValue: ptr.To("fish")}, + "version": {VersionValue: ptr.To("1.0.0")}, + }, + capacity: map[resourceapi.QualifiedName]resource.Quantity{ + "quantity": resource.MustParse("1Mi"), + }, + driver: "dra.example.com", + expectMatch: true, + }, + "many": { + expression: `device.attributes["dra.example.com"].a && device.attributes["dra.example.com"].b && device.attributes["dra.example.com"].c`, + attributes: map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "a": {BoolValue: ptr.To(true)}, + "b": {BoolValue: ptr.To(true)}, + "c": {BoolValue: ptr.To(true)}, + }, + driver: "dra.example.com", + expectMatch: true, + }, + } { + t.Run(name, func(t *testing.T) { + _, ctx := ktesting.NewTestContext(t) + result := Compiler.CompileCELExpression(scenario.expression, environment.StoredExpressions) + if scenario.expectCompileError != "" && result.Error == nil { + t.Fatalf("expected compile error %q, got none", scenario.expectCompileError) + } + if result.Error != nil { + if scenario.expectCompileError == "" { + t.Fatalf("unexpected compile error: %v", result.Error) + } + if !strings.Contains(result.Error.Error(), scenario.expectCompileError) { + t.Fatalf("expected compile error to contain %q, but got instead: %v", scenario.expectCompileError, result.Error) + } + return + } + match, err := result.DeviceMatches(ctx, Device{Attributes: scenario.attributes, Capacity: scenario.capacity, Driver: scenario.driver}) + if err != nil { + if scenario.expectMatchError == "" { + t.Fatalf("unexpected evaluation error: %v", err) + } + if !strings.Contains(err.Error(), scenario.expectMatchError) { + t.Fatalf("expected evaluation error to contain %q, but got instead: %v", scenario.expectMatchError, err) + } + return + } + if match != scenario.expectMatch { + t.Fatalf("expected result %v, got %v", scenario.expectMatch, match) + } + }) + } +} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semver.go b/staging/src/k8s.io/dynamic-resource-allocation/cel/semver.go similarity index 100% rename from staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semver.go rename to staging/src/k8s.io/dynamic-resource-allocation/cel/semver.go diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semver_test.go b/staging/src/k8s.io/dynamic-resource-allocation/cel/semver_test.go similarity index 98% rename from staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semver_test.go rename to staging/src/k8s.io/dynamic-resource-allocation/cel/semver_test.go index 38f43d15fb1df..d71cfdf91ff5d 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semver_test.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/cel/semver_test.go @@ -27,7 +27,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/sets" - library "k8s.io/dynamic-resource-allocation/structured/namedresources/cel" + library "k8s.io/dynamic-resource-allocation/cel" ) func testSemver(t *testing.T, expr string, expectResult ref.Val, expectRuntimeErrPattern string, expectCompileErrs []string) { diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semverlib.go b/staging/src/k8s.io/dynamic-resource-allocation/cel/semverlib.go similarity index 100% rename from staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/semverlib.go rename to staging/src/k8s.io/dynamic-resource-allocation/cel/semverlib.go diff --git a/staging/src/k8s.io/dynamic-resource-allocation/controller/controller.go b/staging/src/k8s.io/dynamic-resource-allocation/controller/controller.go index 473e613cfe679..2a0ae0b2a79da 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/controller/controller.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/controller/controller.go @@ -28,7 +28,7 @@ import ( "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -37,7 +37,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" corev1types "k8s.io/client-go/kubernetes/typed/core/v1" - resourcev1alpha2listers "k8s.io/client-go/listers/resource/v1alpha2" + resourcelisters "k8s.io/client-go/listers/resource/v1alpha3" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" @@ -62,20 +62,6 @@ type Controller interface { // Driver provides the actual allocation and deallocation operations. type Driver interface { - // GetClassParameters is called to retrieve the parameter object - // referenced by a class. The content should be validated now if - // possible. class.Parameters may be nil. - // - // The caller wraps the error to include the parameter reference. - GetClassParameters(ctx context.Context, class *resourcev1alpha2.ResourceClass) (interface{}, error) - - // GetClaimParameters is called to retrieve the parameter object - // referenced by a claim. The content should be validated now if - // possible. claim.Spec.Parameters may be nil. - // - // The caller wraps the error to include the parameter reference. - GetClaimParameters(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, class *resourcev1alpha2.ResourceClass, classParameters interface{}) (interface{}, error) - // Allocate is called when all same-driver ResourceClaims for Pod are ready // to be allocated. The selectedNode is empty for ResourceClaims with immediate // allocation, in which case the resource driver decides itself where @@ -111,7 +97,7 @@ type Driver interface { // Deallocate may be called when a previous allocation got // interrupted. Deallocate must then stop any on-going allocation // activity and free resources before returning without an error. - Deallocate(ctx context.Context, claim *resourcev1alpha2.ResourceClaim) error + Deallocate(ctx context.Context, claim *resourceapi.ResourceClaim) error // UnsuitableNodes checks all pending claims with delayed allocation // for a pod. All claims are ready for allocation by the driver @@ -136,11 +122,9 @@ type Driver interface { // ClaimAllocation represents information about one particular // pod.Spec.ResourceClaim entry. type ClaimAllocation struct { - PodClaimName string - Claim *resourcev1alpha2.ResourceClaim - Class *resourcev1alpha2.ResourceClass - ClaimParameters interface{} - ClassParameters interface{} + PodClaimName string + Claim *resourceapi.ResourceClaim + DeviceClasses map[string]*resourceapi.DeviceClass // UnsuitableNodes needs to be filled in by the driver when // Driver.UnsuitableNodes gets called. @@ -148,7 +132,7 @@ type ClaimAllocation struct { // Driver must populate this field with resources that were // allocated for the claim in case of successful allocation. - Allocation *resourcev1alpha2.AllocationResult + Allocation *resourceapi.AllocationResult // In case of error allocating particular claim, driver must // populate this field. Error error @@ -162,15 +146,12 @@ type controller struct { driver Driver setReservedFor bool kubeClient kubernetes.Interface - claimNameLookup *resourceclaim.Lookup queue workqueue.TypedRateLimitingInterface[string] eventRecorder record.EventRecorder - rcLister resourcev1alpha2listers.ResourceClassLister - rcSynced cache.InformerSynced + dcLister resourcelisters.DeviceClassLister claimCache cache.MutationCache - schedulingCtxLister resourcev1alpha2listers.PodSchedulingContextLister - claimSynced cache.InformerSynced - schedulingCtxSynced cache.InformerSynced + schedulingCtxLister resourcelisters.PodSchedulingContextLister + synced []cache.InformerSynced } // TODO: make it configurable @@ -184,10 +165,9 @@ func New( kubeClient kubernetes.Interface, informerFactory informers.SharedInformerFactory) Controller { logger := klog.LoggerWithName(klog.FromContext(ctx), "resource controller") - rcInformer := informerFactory.Resource().V1alpha2().ResourceClasses() - claimInformer := informerFactory.Resource().V1alpha2().ResourceClaims() - schedulingCtxInformer := informerFactory.Resource().V1alpha2().PodSchedulingContexts() - claimNameLookup := resourceclaim.NewNameLookup(kubeClient) + dcInformer := informerFactory.Resource().V1alpha3().DeviceClasses() + claimInformer := informerFactory.Resource().V1alpha3().ResourceClaims() + schedulingCtxInformer := informerFactory.Resource().V1alpha3().PodSchedulingContexts() eventBroadcaster := record.NewBroadcaster(record.WithContext(ctx)) go func() { @@ -228,15 +208,16 @@ func New( driver: driver, setReservedFor: true, kubeClient: kubeClient, - claimNameLookup: claimNameLookup, - rcLister: rcInformer.Lister(), - rcSynced: rcInformer.Informer().HasSynced, + dcLister: dcInformer.Lister(), claimCache: claimCache, - claimSynced: claimInformer.Informer().HasSynced, schedulingCtxLister: schedulingCtxInformer.Lister(), - schedulingCtxSynced: schedulingCtxInformer.Informer().HasSynced, queue: queue, eventRecorder: eventRecorder, + synced: []cache.InformerSynced{ + dcInformer.Informer().HasSynced, + claimInformer.Informer().HasSynced, + schedulingCtxInformer.Informer().HasSynced, + }, } loggerV6 := logger.V(6) @@ -321,9 +302,9 @@ func getKey(obj interface{}) (string, error) { } prefix := "" switch obj.(type) { - case *resourcev1alpha2.ResourceClaim: + case *resourceapi.ResourceClaim: prefix = claimKeyPrefix - case *resourcev1alpha2.PodSchedulingContext: + case *resourceapi.PodSchedulingContext: prefix = schedulingCtxKeyPrefix default: return "", fmt.Errorf("unexpected object: %T", obj) @@ -341,7 +322,7 @@ func (ctrl *controller) Run(workers int) { stopCh := ctrl.ctx.Done() - if !cache.WaitForCacheSync(stopCh, ctrl.rcSynced, ctrl.claimSynced, ctrl.schedulingCtxSynced) { + if !cache.WaitForCacheSync(stopCh, ctrl.synced...) { ctrl.logger.Error(nil, "Cannot sync caches") return } @@ -427,7 +408,7 @@ func (ctrl *controller) syncKey(ctx context.Context, key string) (obj runtime.Ob return } -func (ctrl *controller) getCachedClaim(ctx context.Context, key string) (*resourcev1alpha2.ResourceClaim, error) { +func (ctrl *controller) getCachedClaim(ctx context.Context, key string) (*resourceapi.ResourceClaim, error) { claimObj, exists, err := ctrl.claimCache.GetByKey(key) if !exists || k8serrors.IsNotFound(err) { klog.FromContext(ctx).V(5).Info("ResourceClaim not found, no need to process it") @@ -436,16 +417,16 @@ func (ctrl *controller) getCachedClaim(ctx context.Context, key string) (*resour if err != nil { return nil, err } - claim, ok := claimObj.(*resourcev1alpha2.ResourceClaim) + claim, ok := claimObj.(*resourceapi.ResourceClaim) if !ok { - return nil, fmt.Errorf("internal error: got %T instead of *resourcev1alpha2.ResourceClaim from claim cache", claimObj) + return nil, fmt.Errorf("internal error: got %T instead of *resourceapi.ResourceClaim from claim cache", claimObj) } return claim, nil } // syncClaim determines which next action may be needed for a ResourceClaim // and does it. -func (ctrl *controller) syncClaim(ctx context.Context, claim *resourcev1alpha2.ResourceClaim) error { +func (ctrl *controller) syncClaim(ctx context.Context, claim *resourceapi.ResourceClaim) error { var err error logger := klog.FromContext(ctx) @@ -471,37 +452,36 @@ func (ctrl *controller) syncClaim(ctx context.Context, claim *resourcev1alpha2.R if claim.Status.Allocation != nil { // Allocation was completed. Deallocate before proceeding. if err := ctrl.driver.Deallocate(ctx, claim); err != nil { - return fmt.Errorf("deallocate: %v", err) + return fmt.Errorf("deallocate: %w", err) } claim.Status.Allocation = nil - claim.Status.DriverName = "" claim.Status.DeallocationRequested = false - claim, err = ctrl.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) + claim, err = ctrl.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) if err != nil { - return fmt.Errorf("remove allocation: %v", err) + return fmt.Errorf("remove allocation: %w", err) } ctrl.claimCache.Mutation(claim) } else { // Ensure that there is no on-going allocation. if err := ctrl.driver.Deallocate(ctx, claim); err != nil { - return fmt.Errorf("stop allocation: %v", err) + return fmt.Errorf("stop allocation: %w", err) } } if claim.Status.DeallocationRequested { // Still need to remove it. claim.Status.DeallocationRequested = false - claim, err = ctrl.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) + claim, err = ctrl.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) if err != nil { - return fmt.Errorf("remove deallocation: %v", err) + return fmt.Errorf("remove deallocation: %w", err) } ctrl.claimCache.Mutation(claim) } claim.Finalizers = ctrl.removeFinalizer(claim.Finalizers) - claim, err = ctrl.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) + claim, err = ctrl.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) if err != nil { - return fmt.Errorf("remove finalizer: %v", err) + return fmt.Errorf("remove finalizer: %w", err) } ctrl.claimCache.Mutation(claim) } @@ -515,72 +495,13 @@ func (ctrl *controller) syncClaim(ctx context.Context, claim *resourcev1alpha2.R logger.V(5).Info("ResourceClaim is allocated") return nil } - if claim.Spec.AllocationMode != resourcev1alpha2.AllocationModeImmediate { - logger.V(5).Info("ResourceClaim waiting for first consumer") - return nil - } - - // We need the ResourceClass to determine whether we should allocate it. - class, err := ctrl.rcLister.Get(claim.Spec.ResourceClassName) - if err != nil { - return err - } - if class.DriverName != ctrl.name { - // Not ours *at the moment*. This can change, so requeue and - // check again. We could trigger a faster check when the - // ResourceClass changes, but that shouldn't occur much in - // practice and thus isn't worth the effort. - // - // We use exponential backoff because it is unlikely that - // the ResourceClass changes much. - logger.V(5).Info("ResourceClaim is handled by other driver", "driver", class.DriverName) - return errRequeue - } - - // Check parameters. Do not record event to Claim if its parameters are invalid, - // syncKey will record the error. - claimParameters, classParameters, err := ctrl.getParameters(ctx, claim, class, false) - if err != nil { - return err - } - - claimAllocations := claimAllocations{&ClaimAllocation{ - Claim: claim, - ClaimParameters: claimParameters, - Class: class, - ClassParameters: classParameters, - }} - - ctrl.allocateClaims(ctx, claimAllocations, "", nil) - - if claimAllocations[0].Error != nil { - return fmt.Errorf("allocate: %v", claimAllocations[0].Error) - } - + logger.V(5).Info("ResourceClaim waiting for first consumer") return nil } -func (ctrl *controller) getParameters(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, class *resourcev1alpha2.ResourceClass, notifyClaim bool) (claimParameters, classParameters interface{}, err error) { - classParameters, err = ctrl.driver.GetClassParameters(ctx, class) - if err != nil { - ctrl.eventRecorder.Event(class, v1.EventTypeWarning, "Failed", err.Error()) - err = fmt.Errorf("class parameters %s: %v", class.ParametersRef, err) - return - } - claimParameters, err = ctrl.driver.GetClaimParameters(ctx, claim, class, classParameters) - if err != nil { - if notifyClaim { - ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, "Failed", err.Error()) - } - err = fmt.Errorf("claim parameters %s: %v", claim.Spec.ParametersRef, err) - return - } - return -} - // allocateClaims filters list of claims, keeps those needing allocation and asks driver to do the allocations. // Driver is supposed to write the AllocationResult and Error field into argument claims slice. -func (ctrl *controller) allocateClaims(ctx context.Context, claims []*ClaimAllocation, selectedNode string, selectedUser *resourcev1alpha2.ResourceClaimConsumerReference) { +func (ctrl *controller) allocateClaims(ctx context.Context, claims []*ClaimAllocation, selectedNode string, selectedUser *resourceapi.ResourceClaimConsumerReference) { logger := klog.FromContext(ctx) needAllocation := make([]*ClaimAllocation, 0, len(claims)) @@ -610,10 +531,10 @@ func (ctrl *controller) allocateClaims(ctx context.Context, claims []*ClaimAlloc logger.V(5).Info("Adding finalizer", "claim", claim.Name) claim.Finalizers = append(claim.Finalizers, ctrl.finalizer) var err error - claim, err = ctrl.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) + claim, err = ctrl.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).Update(ctx, claim, metav1.UpdateOptions{}) if err != nil { logger.Error(err, "add finalizer", "claim", claim.Name) - claimAllocation.Error = fmt.Errorf("add finalizer: %v", err) + claimAllocation.Error = fmt.Errorf("add finalizer: %w", err) // Do not save claim to ask for Allocate from Driver. continue } @@ -643,14 +564,14 @@ func (ctrl *controller) allocateClaims(ctx context.Context, claims []*ClaimAlloc logger.V(5).Info("successfully allocated", "claim", klog.KObj(claimAllocation.Claim)) claim := claimAllocation.Claim.DeepCopy() claim.Status.Allocation = claimAllocation.Allocation - claim.Status.DriverName = ctrl.name + claim.Status.Allocation.Controller = ctrl.name if selectedUser != nil && ctrl.setReservedFor { claim.Status.ReservedFor = append(claim.Status.ReservedFor, *selectedUser) } logger.V(6).Info("Updating claim after allocation", "claim", claim) - claim, err := ctrl.kubeClient.ResourceV1alpha2().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) + claim, err := ctrl.kubeClient.ResourceV1alpha3().ResourceClaims(claim.Namespace).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) if err != nil { - claimAllocation.Error = fmt.Errorf("add allocation: %v", err) + claimAllocation.Error = fmt.Errorf("add allocation: %w", err) continue } @@ -660,7 +581,7 @@ func (ctrl *controller) allocateClaims(ctx context.Context, claims []*ClaimAlloc } func (ctrl *controller) checkPodClaim(ctx context.Context, pod *v1.Pod, podClaim v1.PodResourceClaim) (*ClaimAllocation, error) { - claimName, mustCheckOwner, err := ctrl.claimNameLookup.Name(pod, &podClaim) + claimName, mustCheckOwner, err := resourceclaim.Name(pod, &podClaim) if err != nil { return nil, err } @@ -678,40 +599,40 @@ func (ctrl *controller) checkPodClaim(ctx context.Context, pod *v1.Pod, podClaim return nil, err } } - if claim.Spec.AllocationMode != resourcev1alpha2.AllocationModeWaitForFirstConsumer { - // Nothing to do for it as part of pod scheduling. - return nil, nil - } if claim.Status.Allocation != nil { // Already allocated, class and parameter are not needed and nothing // need to be done for the claim either. return nil, nil } - class, err := ctrl.rcLister.Get(claim.Spec.ResourceClassName) - if err != nil { - return nil, err - } - if class.DriverName != ctrl.name { + if claim.Spec.Controller != ctrl.name { return nil, nil } - // Check parameters. Record event to claim and pod if parameters are invalid. - claimParameters, classParameters, err := ctrl.getParameters(ctx, claim, class, true) - if err != nil { - ctrl.eventRecorder.Event(pod, v1.EventTypeWarning, "Failed", fmt.Sprintf("claim %v: %v", claim.Name, err.Error())) - return nil, err + + // Sanity checks and preparations... + ca := &ClaimAllocation{ + PodClaimName: podClaim.Name, + Claim: claim, + DeviceClasses: make(map[string]*resourceapi.DeviceClass), } - return &ClaimAllocation{ - PodClaimName: podClaim.Name, - Claim: claim, - Class: class, - ClaimParameters: claimParameters, - ClassParameters: classParameters, - }, nil + for _, request := range claim.Spec.Devices.Requests { + if request.DeviceClassName == "" { + // Some unknown request. Abort! + return nil, fmt.Errorf("claim %s: unknown request type in request %s", klog.KObj(claim), request.Name) + } + deviceClassName := request.DeviceClassName + class, err := ctrl.dcLister.Get(deviceClassName) + if err != nil { + return nil, fmt.Errorf("claim %s: request %s: class %s: %w", klog.KObj(claim), request.Name, deviceClassName, err) + } + ca.DeviceClasses[deviceClassName] = class + } + + return ca, nil } // syncPodSchedulingContext determines which next action may be needed for a PodSchedulingContext object // and does it. -func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulingCtx *resourcev1alpha2.PodSchedulingContext) error { +func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulingCtx *resourceapi.PodSchedulingContext) error { logger := klog.FromContext(ctx) // Ignore deleted objects. @@ -754,7 +675,7 @@ func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulin for _, podClaim := range pod.Spec.ResourceClaims { delayed, err := ctrl.checkPodClaim(ctx, pod, podClaim) if err != nil { - return fmt.Errorf("pod claim %s: %v", podClaim.Name, err) + return fmt.Errorf("pod claim %s: %w", podClaim.Name, err) } if delayed == nil { // Nothing to do for it. This can change, so keep checking. @@ -784,7 +705,7 @@ func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulin } if len(schedulingCtx.Spec.PotentialNodes) > 0 { if err := ctrl.driver.UnsuitableNodes(ctx, pod, claims, potentialNodes); err != nil { - return fmt.Errorf("checking potential nodes: %v", err) + return fmt.Errorf("checking potential nodes: %w", err) } } logger.V(5).Info("pending pod claims", "claims", claims, "selectedNode", selectedNode) @@ -801,7 +722,7 @@ func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulin logger.V(2).Info("skipping allocation for unsuitable selected node", "node", selectedNode) } else { logger.V(2).Info("allocation for selected node", "node", selectedNode) - selectedUser := &resourcev1alpha2.ResourceClaimConsumerReference{ + selectedUser := &resourceapi.ResourceClaimConsumerReference{ Resource: "pods", Name: pod.Name, UID: pod.UID, @@ -817,7 +738,7 @@ func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulin allErrors = append(allErrors, delayed.Error) } else { // Include claim name, it's not in the underlying error. - allErrors = append(allErrors, fmt.Errorf("claim %s: %v", delayed.Claim.Name, delayed.Error)) + allErrors = append(allErrors, fmt.Errorf("claim %s: %w", delayed.Claim.Name, delayed.Error)) } } } @@ -838,7 +759,7 @@ func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulin if i < 0 { // Add new entry. schedulingCtx.Status.ResourceClaims = append(schedulingCtx.Status.ResourceClaims, - resourcev1alpha2.ResourceClaimSchedulingStatus{ + resourceapi.ResourceClaimSchedulingStatus{ Name: delayed.PodClaimName, UnsuitableNodes: truncateNodes(delayed.UnsuitableNodes, selectedNode), }) @@ -851,8 +772,8 @@ func (ctrl *controller) syncPodSchedulingContexts(ctx context.Context, schedulin } if modified { logger.V(6).Info("Updating pod scheduling with modified unsuitable nodes", "podSchedulingCtx", schedulingCtx) - if _, err := ctrl.kubeClient.ResourceV1alpha2().PodSchedulingContexts(schedulingCtx.Namespace).UpdateStatus(ctx, schedulingCtx, metav1.UpdateOptions{}); err != nil { - return fmt.Errorf("update unsuitable node status: %v", err) + if _, err := ctrl.kubeClient.ResourceV1alpha3().PodSchedulingContexts(schedulingCtx.Namespace).UpdateStatus(ctx, schedulingCtx, metav1.UpdateOptions{}); err != nil { + return fmt.Errorf("update unsuitable node status: %w", err) } } @@ -866,7 +787,7 @@ func truncateNodes(nodes []string, selectedNode string) []string { // this list might be too long by one element. When truncating it, make // sure that the selected node is listed. lenUnsuitable := len(nodes) - if lenUnsuitable > resourcev1alpha2.PodSchedulingNodeListMaxSize { + if lenUnsuitable > resourceapi.PodSchedulingNodeListMaxSize { if nodes[0] == selectedNode { // Truncate at the end and keep selected node in the first element. nodes = nodes[0 : lenUnsuitable-1] @@ -893,7 +814,7 @@ func (claims claimAllocations) MarshalLog() interface{} { var _ logr.Marshaler = claimAllocations{} // findClaim returns the index of the specified pod claim, -1 if not found. -func findClaim(claims []resourcev1alpha2.ResourceClaimSchedulingStatus, podClaimName string) int { +func findClaim(claims []resourceapi.ResourceClaimSchedulingStatus, podClaimName string) int { for i := range claims { if claims[i].Name == podClaimName { return i @@ -926,7 +847,7 @@ func stringsDiffer(a, b []string) bool { } // hasFinalizer checks if the claim has the finalizer of the driver. -func (ctrl *controller) hasFinalizer(claim *resourcev1alpha2.ResourceClaim) bool { +func (ctrl *controller) hasFinalizer(claim *resourceapi.ResourceClaim) bool { for _, finalizer := range claim.Finalizers { if finalizer == ctrl.finalizer { return true diff --git a/staging/src/k8s.io/dynamic-resource-allocation/controller/controller_test.go b/staging/src/k8s.io/dynamic-resource-allocation/controller/controller_test.go index 850a1e7e6ab46..a8d2f24748dd0 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/controller/controller_test.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/controller/controller_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/informers" @@ -44,17 +44,10 @@ func TestController(t *testing.T) { driverName := "mock-driver" className := "mock-class" otherDriverName := "other-driver" - otherClassName := "other-class" ourFinalizer := driverName + "/deletion-protection" otherFinalizer := otherDriverName + "/deletion-protection" - classes := []*resourcev1alpha2.ResourceClass{ - createClass(className, driverName), - createClass(otherClassName, otherDriverName), - } - claim := createClaim(claimName, claimNamespace, className) - otherClaim := createClaim(claimName, claimNamespace, otherClassName) - delayedClaim := claim.DeepCopy() - delayedClaim.Spec.AllocationMode = resourcev1alpha2.AllocationModeWaitForFirstConsumer + claim := createClaim(claimName, claimNamespace, driverName) + otherClaim := createClaim(claimName, claimNamespace, otherDriverName) podName := "pod" podKey := "schedulingCtx:default/pod" pod := createPod(podName, claimNamespace, nil) @@ -65,63 +58,62 @@ func TestController(t *testing.T) { otherNodeName := "worker-2" unsuitableNodes := []string{otherNodeName} potentialNodes := []string{nodeName, otherNodeName} - maxNodes := make([]string, resourcev1alpha2.PodSchedulingNodeListMaxSize) + maxNodes := make([]string, resourceapi.PodSchedulingNodeListMaxSize) for i := range maxNodes { maxNodes[i] = fmt.Sprintf("node-%d", i) } - withDeletionTimestamp := func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + withDeletionTimestamp := func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { var deleted metav1.Time claim = claim.DeepCopy() claim.DeletionTimestamp = &deleted return claim } - withReservedFor := func(claim *resourcev1alpha2.ResourceClaim, pod *corev1.Pod) *resourcev1alpha2.ResourceClaim { + withReservedFor := func(claim *resourceapi.ResourceClaim, pod *corev1.Pod) *resourceapi.ResourceClaim { claim = claim.DeepCopy() - claim.Status.ReservedFor = append(claim.Status.ReservedFor, resourcev1alpha2.ResourceClaimConsumerReference{ + claim.Status.ReservedFor = append(claim.Status.ReservedFor, resourceapi.ResourceClaimConsumerReference{ Resource: "pods", Name: pod.Name, UID: pod.UID, }) return claim } - withFinalizer := func(claim *resourcev1alpha2.ResourceClaim, finalizer string) *resourcev1alpha2.ResourceClaim { + withFinalizer := func(claim *resourceapi.ResourceClaim, finalizer string) *resourceapi.ResourceClaim { claim = claim.DeepCopy() claim.Finalizers = append(claim.Finalizers, finalizer) return claim } - allocation := resourcev1alpha2.AllocationResult{} - withAllocate := func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + allocation := resourceapi.AllocationResult{Controller: driverName} + withAllocate := func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { // Any allocated claim must have our finalizer. claim = withFinalizer(claim, ourFinalizer) claim.Status.Allocation = &allocation - claim.Status.DriverName = driverName return claim } - withDeallocate := func(claim *resourcev1alpha2.ResourceClaim) *resourcev1alpha2.ResourceClaim { + withDeallocate := func(claim *resourceapi.ResourceClaim) *resourceapi.ResourceClaim { claim.Status.DeallocationRequested = true return claim } - withSelectedNode := func(podSchedulingCtx *resourcev1alpha2.PodSchedulingContext) *resourcev1alpha2.PodSchedulingContext { + withSelectedNode := func(podSchedulingCtx *resourceapi.PodSchedulingContext) *resourceapi.PodSchedulingContext { podSchedulingCtx = podSchedulingCtx.DeepCopy() podSchedulingCtx.Spec.SelectedNode = nodeName return podSchedulingCtx } - withSpecificUnsuitableNodes := func(podSchedulingCtx *resourcev1alpha2.PodSchedulingContext, unsuitableNodes []string) *resourcev1alpha2.PodSchedulingContext { + withSpecificUnsuitableNodes := func(podSchedulingCtx *resourceapi.PodSchedulingContext, unsuitableNodes []string) *resourceapi.PodSchedulingContext { podSchedulingCtx = podSchedulingCtx.DeepCopy() podSchedulingCtx.Status.ResourceClaims = append(podSchedulingCtx.Status.ResourceClaims, - resourcev1alpha2.ResourceClaimSchedulingStatus{Name: podClaimName, UnsuitableNodes: unsuitableNodes}, + resourceapi.ResourceClaimSchedulingStatus{Name: podClaimName, UnsuitableNodes: unsuitableNodes}, ) return podSchedulingCtx } - withUnsuitableNodes := func(podSchedulingCtx *resourcev1alpha2.PodSchedulingContext) *resourcev1alpha2.PodSchedulingContext { + withUnsuitableNodes := func(podSchedulingCtx *resourceapi.PodSchedulingContext) *resourceapi.PodSchedulingContext { return withSpecificUnsuitableNodes(podSchedulingCtx, unsuitableNodes) } - withSpecificPotentialNodes := func(podSchedulingCtx *resourcev1alpha2.PodSchedulingContext, potentialNodes []string) *resourcev1alpha2.PodSchedulingContext { + withSpecificPotentialNodes := func(podSchedulingCtx *resourceapi.PodSchedulingContext, potentialNodes []string) *resourceapi.PodSchedulingContext { podSchedulingCtx = podSchedulingCtx.DeepCopy() podSchedulingCtx.Spec.PotentialNodes = potentialNodes return podSchedulingCtx } - withPotentialNodes := func(podSchedulingCtx *resourcev1alpha2.PodSchedulingContext) *resourcev1alpha2.PodSchedulingContext { + withPotentialNodes := func(podSchedulingCtx *resourceapi.PodSchedulingContext) *resourceapi.PodSchedulingContext { return withSpecificPotentialNodes(podSchedulingCtx, potentialNodes) } @@ -130,10 +122,9 @@ func TestController(t *testing.T) { for name, test := range map[string]struct { key string driver mockDriver - classes []*resourcev1alpha2.ResourceClass pod *corev1.Pod - schedulingCtx, expectedSchedulingCtx *resourcev1alpha2.PodSchedulingContext - claim, expectedClaim *resourcev1alpha2.ResourceClaim + schedulingCtx, expectedSchedulingCtx *resourceapi.PodSchedulingContext + claim, expectedClaim *resourceapi.ResourceClaim expectedError string }{ "invalid-key": { @@ -145,103 +136,13 @@ func TestController(t *testing.T) { }, "wrong-driver": { key: claimKey, - classes: classes, claim: otherClaim, expectedClaim: otherClaim, - expectedError: errRequeue.Error(), // class might change - }, - // Immediate allocation: - // deletion time stamp set, our finalizer set, not allocated -> remove finalizer - "immediate-deleted-finalizer-removal": { - key: claimKey, - classes: classes, - claim: withFinalizer(withDeletionTimestamp(claim), ourFinalizer), - driver: m.expectDeallocate(map[string]error{claimName: nil}), - expectedClaim: withDeletionTimestamp(claim), - }, - // deletion time stamp set, our finalizer set, not allocated, stopping fails -> requeue - "immediate-deleted-finalizer-stop-failure": { - key: claimKey, - classes: classes, - claim: withFinalizer(withDeletionTimestamp(claim), ourFinalizer), - driver: m.expectDeallocate(map[string]error{claimName: errors.New("fake error")}), - expectedClaim: withFinalizer(withDeletionTimestamp(claim), ourFinalizer), - expectedError: "stop allocation: fake error", - }, - // deletion time stamp set, other finalizer set, not allocated -> do nothing - "immediate-deleted-finalizer-no-removal": { - key: claimKey, - classes: classes, - claim: withFinalizer(withDeletionTimestamp(claim), otherFinalizer), - expectedClaim: withFinalizer(withDeletionTimestamp(claim), otherFinalizer), - }, - // deletion time stamp set, finalizer set, allocated -> deallocate - "immediate-deleted-allocated": { - key: claimKey, - classes: classes, - claim: withAllocate(withDeletionTimestamp(claim)), - driver: m.expectDeallocate(map[string]error{claimName: nil}), - expectedClaim: withDeletionTimestamp(claim), - }, - // deletion time stamp set, finalizer set, allocated, deallocation fails -> requeue - "immediate-deleted-deallocate-failure": { - key: claimKey, - classes: classes, - claim: withAllocate(withDeletionTimestamp(claim)), - driver: m.expectDeallocate(map[string]error{claimName: errors.New("fake error")}), - expectedClaim: withAllocate(withDeletionTimestamp(claim)), - expectedError: "deallocate: fake error", - }, - // deletion time stamp set, finalizer not set -> do nothing - "immediate-deleted-no-finalizer": { - key: claimKey, - classes: classes, - claim: withDeletionTimestamp(claim), - expectedClaim: withDeletionTimestamp(claim), - }, - // not deleted, not allocated, no finalizer -> add finalizer, allocate - "immediate-do-allocation": { - key: claimKey, - classes: classes, - claim: claim, - driver: m.expectClassParameters(map[string]interface{}{className: 1}). - expectClaimParameters(map[string]interface{}{claimName: 2}). - expectAllocate(map[string]allocate{claimName: {allocResult: &allocation, allocErr: nil}}), - expectedClaim: withAllocate(claim), - }, - // not deleted, not allocated, finalizer -> allocate - "immediate-continue-allocation": { - key: claimKey, - classes: classes, - claim: withFinalizer(claim, ourFinalizer), - driver: m.expectClassParameters(map[string]interface{}{className: 1}). - expectClaimParameters(map[string]interface{}{claimName: 2}). - expectAllocate(map[string]allocate{claimName: {allocResult: &allocation, allocErr: nil}}), - expectedClaim: withAllocate(claim), - }, - // not deleted, not allocated, finalizer, fail allocation -> requeue - "immediate-fail-allocation": { - key: claimKey, - classes: classes, - claim: withFinalizer(claim, ourFinalizer), - driver: m.expectClassParameters(map[string]interface{}{className: 1}). - expectClaimParameters(map[string]interface{}{claimName: 2}). - expectAllocate(map[string]allocate{claimName: {allocErr: errors.New("fake error")}}), - expectedClaim: withFinalizer(claim, ourFinalizer), - expectedError: "allocate: fake error", - }, - // not deleted, allocated -> do nothing - "immediate-allocated-nop": { - key: claimKey, - classes: classes, - claim: withAllocate(claim), - expectedClaim: withAllocate(claim), }, // not deleted, reallocate -> deallocate "immediate-allocated-reallocate": { key: claimKey, - classes: classes, claim: withDeallocate(withAllocate(claim)), driver: m.expectDeallocate(map[string]error{claimName: nil}), expectedClaim: claim, @@ -250,69 +151,59 @@ func TestController(t *testing.T) { // not deleted, reallocate, deallocate failure -> requeue "immediate-allocated-fail-deallocation-during-reallocate": { key: claimKey, - classes: classes, claim: withDeallocate(withAllocate(claim)), driver: m.expectDeallocate(map[string]error{claimName: errors.New("fake error")}), expectedClaim: withDeallocate(withAllocate(claim)), expectedError: "deallocate: fake error", }, - // Delayed allocation is similar in some cases, but not quite - // the same. // deletion time stamp set, our finalizer set, not allocated -> remove finalizer - "delayed-deleted-finalizer-removal": { + "deleted-finalizer-removal": { key: claimKey, - classes: classes, - claim: withFinalizer(withDeletionTimestamp(delayedClaim), ourFinalizer), + claim: withFinalizer(withDeletionTimestamp(claim), ourFinalizer), driver: m.expectDeallocate(map[string]error{claimName: nil}), - expectedClaim: withDeletionTimestamp(delayedClaim), + expectedClaim: withDeletionTimestamp(claim), }, // deletion time stamp set, our finalizer set, not allocated, stopping fails -> requeue - "delayed-deleted-finalizer-stop-failure": { + "deleted-finalizer-stop-failure": { key: claimKey, - classes: classes, - claim: withFinalizer(withDeletionTimestamp(delayedClaim), ourFinalizer), + claim: withFinalizer(withDeletionTimestamp(claim), ourFinalizer), driver: m.expectDeallocate(map[string]error{claimName: errors.New("fake error")}), - expectedClaim: withFinalizer(withDeletionTimestamp(delayedClaim), ourFinalizer), + expectedClaim: withFinalizer(withDeletionTimestamp(claim), ourFinalizer), expectedError: "stop allocation: fake error", }, // deletion time stamp set, other finalizer set, not allocated -> do nothing - "delayed-deleted-finalizer-no-removal": { + "deleted-finalizer-no-removal": { key: claimKey, - classes: classes, - claim: withFinalizer(withDeletionTimestamp(delayedClaim), otherFinalizer), - expectedClaim: withFinalizer(withDeletionTimestamp(delayedClaim), otherFinalizer), + claim: withFinalizer(withDeletionTimestamp(claim), otherFinalizer), + expectedClaim: withFinalizer(withDeletionTimestamp(claim), otherFinalizer), }, // deletion time stamp set, finalizer set, allocated -> deallocate - "delayed-deleted-allocated": { + "deleted-allocated": { key: claimKey, - classes: classes, - claim: withAllocate(withDeletionTimestamp(delayedClaim)), + claim: withAllocate(withDeletionTimestamp(claim)), driver: m.expectDeallocate(map[string]error{claimName: nil}), - expectedClaim: withDeletionTimestamp(delayedClaim), + expectedClaim: withDeletionTimestamp(claim), }, // deletion time stamp set, finalizer set, allocated, deallocation fails -> requeue - "delayed-deleted-deallocate-failure": { + "deleted-deallocate-failure": { key: claimKey, - classes: classes, - claim: withAllocate(withDeletionTimestamp(delayedClaim)), + claim: withAllocate(withDeletionTimestamp(claim)), driver: m.expectDeallocate(map[string]error{claimName: errors.New("fake error")}), - expectedClaim: withAllocate(withDeletionTimestamp(delayedClaim)), + expectedClaim: withAllocate(withDeletionTimestamp(claim)), expectedError: "deallocate: fake error", }, // deletion time stamp set, finalizer not set -> do nothing - "delayed-deleted-no-finalizer": { + "deleted-no-finalizer": { key: claimKey, - classes: classes, - claim: withDeletionTimestamp(delayedClaim), - expectedClaim: withDeletionTimestamp(delayedClaim), + claim: withDeletionTimestamp(claim), + expectedClaim: withDeletionTimestamp(claim), }, // waiting for first consumer -> do nothing - "delayed-pending": { + "pending": { key: claimKey, - classes: classes, - claim: delayedClaim, - expectedClaim: delayedClaim, + claim: claim, + expectedClaim: claim, }, // pod with no claims -> shouldn't occur, check again anyway @@ -324,34 +215,21 @@ func TestController(t *testing.T) { expectedError: errPeriodic.Error(), }, - // pod with immediate allocation and selected node -> shouldn't occur, check again in case that claim changes - "pod-immediate": { + // no potential nodes -> shouldn't occur + "no-nodes": { key: podKey, claim: claim, expectedClaim: claim, pod: podWithClaim, - schedulingCtx: withSelectedNode(podSchedulingCtx), - expectedSchedulingCtx: withSelectedNode(podSchedulingCtx), - expectedError: errPeriodic.Error(), - }, - - // pod with delayed allocation, no potential nodes -> shouldn't occur - "pod-delayed-no-nodes": { - key: podKey, - classes: classes, - claim: delayedClaim, - expectedClaim: delayedClaim, - pod: podWithClaim, schedulingCtx: podSchedulingCtx, expectedSchedulingCtx: podSchedulingCtx, }, - // pod with delayed allocation, potential nodes -> provide unsuitable nodes - "pod-delayed-info": { + // potential nodes -> provide unsuitable nodes + "info": { key: podKey, - classes: classes, - claim: delayedClaim, - expectedClaim: delayedClaim, + claim: claim, + expectedClaim: claim, pod: podWithClaim, schedulingCtx: withPotentialNodes(podSchedulingCtx), driver: m.expectClassParameters(map[string]interface{}{className: 1}). @@ -361,23 +239,11 @@ func TestController(t *testing.T) { expectedError: errPeriodic.Error(), }, - // pod with delayed allocation, potential nodes, selected node, missing class -> failure - "pod-delayed-missing-class": { - key: podKey, - claim: delayedClaim, - expectedClaim: delayedClaim, - pod: podWithClaim, - schedulingCtx: withSelectedNode(withPotentialNodes(podSchedulingCtx)), - expectedSchedulingCtx: withSelectedNode(withPotentialNodes(podSchedulingCtx)), - expectedError: `pod claim my-pod-claim: resourceclass.resource.k8s.io "mock-class" not found`, - }, - - // pod with delayed allocation, potential nodes, selected node -> allocate - "pod-delayed-allocate": { + // potential nodes, selected node -> allocate + "allocate": { key: podKey, - classes: classes, - claim: delayedClaim, - expectedClaim: withReservedFor(withAllocate(delayedClaim), pod), + claim: claim, + expectedClaim: withReservedFor(withAllocate(claim), pod), pod: podWithClaim, schedulingCtx: withSelectedNode(withPotentialNodes(podSchedulingCtx)), driver: m.expectClassParameters(map[string]interface{}{className: 1}). @@ -387,12 +253,11 @@ func TestController(t *testing.T) { expectedSchedulingCtx: withUnsuitableNodes(withSelectedNode(withPotentialNodes(podSchedulingCtx))), expectedError: errPeriodic.Error(), }, - // pod with delayed allocation, potential nodes, selected node, all unsuitable -> update unsuitable nodes - "pod-selected-is-potential-node": { + // potential nodes, selected node, all unsuitable -> update unsuitable nodes + "is-potential-node": { key: podKey, - classes: classes, - claim: delayedClaim, - expectedClaim: delayedClaim, + claim: claim, + expectedClaim: claim, pod: podWithClaim, schedulingCtx: withPotentialNodes(withSelectedNode(withPotentialNodes(podSchedulingCtx))), driver: m.expectClassParameters(map[string]interface{}{className: 1}). @@ -401,12 +266,11 @@ func TestController(t *testing.T) { expectedSchedulingCtx: withSpecificUnsuitableNodes(withSelectedNode(withPotentialNodes(podSchedulingCtx)), potentialNodes), expectedError: errPeriodic.Error(), }, - // pod with delayed allocation, max potential nodes, other selected node, all unsuitable -> update unsuitable nodes with truncation at start - "pod-selected-is-potential-node-truncate-first": { + // max potential nodes, other selected node, all unsuitable -> update unsuitable nodes with truncation at start + "is-potential-node-truncate-first": { key: podKey, - classes: classes, - claim: delayedClaim, - expectedClaim: delayedClaim, + claim: claim, + expectedClaim: claim, pod: podWithClaim, schedulingCtx: withSpecificPotentialNodes(withSelectedNode(withSpecificPotentialNodes(podSchedulingCtx, maxNodes)), maxNodes), driver: m.expectClassParameters(map[string]interface{}{className: 1}). @@ -415,12 +279,11 @@ func TestController(t *testing.T) { expectedSchedulingCtx: withSpecificUnsuitableNodes(withSelectedNode(withSpecificPotentialNodes(podSchedulingCtx, maxNodes)), append(maxNodes[1:], nodeName)), expectedError: errPeriodic.Error(), }, - // pod with delayed allocation, max potential nodes, other selected node, all unsuitable (but in reverse order) -> update unsuitable nodes with truncation at end + // max potential nodes, other selected node, all unsuitable (but in reverse order) -> update unsuitable nodes with truncation at end "pod-selected-is-potential-node-truncate-last": { key: podKey, - classes: classes, - claim: delayedClaim, - expectedClaim: delayedClaim, + claim: claim, + expectedClaim: claim, pod: podWithClaim, schedulingCtx: withSpecificPotentialNodes(withSelectedNode(withSpecificPotentialNodes(podSchedulingCtx, maxNodes)), maxNodes), driver: m.expectClassParameters(map[string]interface{}{className: 1}). @@ -435,9 +298,6 @@ func TestController(t *testing.T) { ctx, cancel := context.WithCancel(ctx) initialObjects := []runtime.Object{} - for _, class := range test.classes { - initialObjects = append(initialObjects, class) - } if test.pod != nil { initialObjects = append(initialObjects, test.pod) } @@ -448,10 +308,9 @@ func TestController(t *testing.T) { initialObjects = append(initialObjects, test.claim) } kubeClient, informerFactory := fakeK8s(initialObjects) - rcInformer := informerFactory.Resource().V1alpha2().ResourceClasses() - claimInformer := informerFactory.Resource().V1alpha2().ResourceClaims() + claimInformer := informerFactory.Resource().V1alpha3().ResourceClaims() podInformer := informerFactory.Core().V1().Pods() - podSchedulingInformer := informerFactory.Resource().V1alpha2().PodSchedulingContexts() + podSchedulingInformer := informerFactory.Resource().V1alpha3().PodSchedulingContexts() // Order is important: on function exit, we first must // cancel, then wait (last-in-first-out). defer informerFactory.Shutdown() @@ -459,13 +318,11 @@ func TestController(t *testing.T) { for _, obj := range initialObjects { switch obj.(type) { - case *resourcev1alpha2.ResourceClass: - require.NoError(t, rcInformer.Informer().GetStore().Add(obj), "add resource class") - case *resourcev1alpha2.ResourceClaim: + case *resourceapi.ResourceClaim: require.NoError(t, claimInformer.Informer().GetStore().Add(obj), "add resource claim") case *corev1.Pod: require.NoError(t, podInformer.Informer().GetStore().Add(obj), "add pod") - case *resourcev1alpha2.PodSchedulingContext: + case *resourceapi.PodSchedulingContext: require.NoError(t, podSchedulingInformer.Informer().GetStore().Add(obj), "add pod scheduling") default: t.Fatalf("unknown initialObject type: %+v", obj) @@ -478,9 +335,8 @@ func TestController(t *testing.T) { ctrl := New(ctx, driverName, driver, kubeClient, informerFactory) informerFactory.Start(ctx.Done()) if !cache.WaitForCacheSync(ctx.Done(), - informerFactory.Resource().V1alpha2().ResourceClasses().Informer().HasSynced, - informerFactory.Resource().V1alpha2().ResourceClaims().Informer().HasSynced, - informerFactory.Resource().V1alpha2().PodSchedulingContexts().Informer().HasSynced, + informerFactory.Resource().V1alpha3().ResourceClaims().Informer().HasSynced, + informerFactory.Resource().V1alpha3().PodSchedulingContexts().Informer().HasSynced, ) { t.Fatal("could not sync caches") } @@ -494,17 +350,17 @@ func TestController(t *testing.T) { if err != nil && err.Error() != test.expectedError { t.Fatalf("expected error %q, got %q", test.expectedError, err.Error()) } - claims, err := kubeClient.ResourceV1alpha2().ResourceClaims("").List(ctx, metav1.ListOptions{}) + claims, err := kubeClient.ResourceV1alpha3().ResourceClaims("").List(ctx, metav1.ListOptions{}) require.NoError(t, err, "list claims") - var expectedClaims []resourcev1alpha2.ResourceClaim + var expectedClaims []resourceapi.ResourceClaim if test.expectedClaim != nil { expectedClaims = append(expectedClaims, *test.expectedClaim) } assert.Equal(t, expectedClaims, claims.Items) - podSchedulings, err := kubeClient.ResourceV1alpha2().PodSchedulingContexts("").List(ctx, metav1.ListOptions{}) + podSchedulings, err := kubeClient.ResourceV1alpha3().PodSchedulingContexts("").List(ctx, metav1.ListOptions{}) require.NoError(t, err, "list pod schedulings") - var expectedPodSchedulings []resourcev1alpha2.PodSchedulingContext + var expectedPodSchedulings []resourceapi.PodSchedulingContext if test.expectedSchedulingCtx != nil { expectedPodSchedulings = append(expectedPodSchedulings, *test.expectedSchedulingCtx) } @@ -532,7 +388,7 @@ type mockDriver struct { type allocate struct { selectedNode string - allocResult *resourcev1alpha2.AllocationResult + allocResult *resourceapi.AllocationResult allocErr error } @@ -562,30 +418,6 @@ func (m mockDriver) expectUnsuitableNodes(expected map[string][]string, err erro return m } -func (m mockDriver) GetClassParameters(ctx context.Context, class *resourcev1alpha2.ResourceClass) (interface{}, error) { - m.t.Logf("GetClassParameters(%s)", class) - result, ok := m.classParameters[class.Name] - if !ok { - m.t.Fatal("unexpected GetClassParameters call") - } - if err, ok := result.(error); ok { - return nil, err - } - return result, nil -} - -func (m mockDriver) GetClaimParameters(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, class *resourcev1alpha2.ResourceClass, classParameters interface{}) (interface{}, error) { - m.t.Logf("GetClaimParameters(%s)", claim) - result, ok := m.claimParameters[claim.Name] - if !ok { - m.t.Fatal("unexpected GetClaimParameters call") - } - if err, ok := result.(error); ok { - return nil, err - } - return result, nil -} - func (m mockDriver) Allocate(ctx context.Context, claims []*ClaimAllocation, selectedNode string) { m.t.Logf("Allocate(number of claims %d)", len(claims)) for _, claimAllocation := range claims { @@ -601,7 +433,7 @@ func (m mockDriver) Allocate(ctx context.Context, claims []*ClaimAllocation, sel return } -func (m mockDriver) Deallocate(ctx context.Context, claim *resourcev1alpha2.ResourceClaim) error { +func (m mockDriver) Deallocate(ctx context.Context, claim *resourceapi.ResourceClaim) error { m.t.Logf("Deallocate(%s)", claim) err, ok := m.deallocate[claim.Name] if !ok { @@ -635,24 +467,14 @@ func (m mockDriver) UnsuitableNodes(ctx context.Context, pod *corev1.Pod, claims return nil } -func createClass(className, driverName string) *resourcev1alpha2.ResourceClass { - return &resourcev1alpha2.ResourceClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: className, - }, - DriverName: driverName, - } -} - -func createClaim(claimName, claimNamespace, className string) *resourcev1alpha2.ResourceClaim { - return &resourcev1alpha2.ResourceClaim{ +func createClaim(claimName, claimNamespace, driverName string) *resourceapi.ResourceClaim { + return &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Name: claimName, Namespace: claimNamespace, }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: className, - AllocationMode: resourcev1alpha2.AllocationModeImmediate, + Spec: resourceapi.ResourceClaimSpec{ + Controller: driverName, }, } } @@ -676,9 +498,9 @@ func createPod(podName, podNamespace string, claims map[string]string) *corev1.P return pod } -func createPodSchedulingContexts(pod *corev1.Pod) *resourcev1alpha2.PodSchedulingContext { +func createPodSchedulingContexts(pod *corev1.Pod) *resourceapi.PodSchedulingContext { controller := true - return &resourcev1alpha2.PodSchedulingContext{ + return &resourceapi.PodSchedulingContext{ ObjectMeta: metav1.ObjectMeta{ Name: pod.Name, Namespace: pod.Namespace, diff --git a/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/draplugin.go b/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/draplugin.go index 4033d6056c390..f34d1ac61d3f7 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/draplugin.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/draplugin.go @@ -17,14 +17,20 @@ limitations under the License. package kubeletplugin import ( + "context" "errors" "fmt" "net" + "sync" "google.golang.org/grpc" "k8s.io/klog/v2" - drapbv1alpha3 "k8s.io/kubelet/pkg/apis/dra/v1alpha3" + resourceapi "k8s.io/api/resource/v1alpha3" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes" + "k8s.io/dynamic-resource-allocation/resourceslice" + drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha4" registerapi "k8s.io/kubelet/pkg/apis/pluginregistration/v1" ) @@ -39,12 +45,30 @@ type DRAPlugin interface { // received yet. RegistrationStatus() *registerapi.RegistrationStatus + // PublishResources may be called one or more times to publish + // resource information in ResourceSlice objects. If it never gets + // called, then the kubelet plugin does not manage any ResourceSlice + // objects. + // + // PublishResources does not block, so it might still take a while + // after it returns before all information is actually written + // to the API server. + // + // The caller must not modify the content after the call. + PublishResources(ctx context.Context, resources Resources) + // This unexported method ensures that we can modify the interface // without causing an API break of the package // (https://pkg.go.dev/golang.org/x/exp/apidiff#section-readme). internal() } +// Resources currently only supports named devices. Might get extended in the +// future. +type Resources struct { + Devices []resourceapi.Device +} + // Option implements the functional options pattern for Start. type Option func(o *options) error @@ -57,14 +81,6 @@ func DriverName(driverName string) Option { } } -// Logger overrides the default klog.Background logger. -func Logger(logger klog.Logger) Option { - return func(o *options) error { - o.logger = logger - return nil - } -} - // GRPCVerbosity sets the verbosity for logging gRPC calls. Default is 4. A negative // value disables logging. func GRPCVerbosity(level int) Option { @@ -162,15 +178,50 @@ func NodeV1alpha3(enabled bool) Option { } } +// KubeClient grants the plugin access to the API server. This is needed +// for syncing ResourceSlice objects. It's the responsibility of the DRA driver +// developer to ensure that this client has permission to read, write, +// patch and list such objects. It also needs permission to read node objects. +// Ideally, a validating admission policy should be used to limit write +// access to ResourceSlices which belong to the node. +func KubeClient(kubeClient kubernetes.Interface) Option { + return func(o *options) error { + o.kubeClient = kubeClient + return nil + } +} + +// NodeName tells the plugin on which node it is running. This is needed for +// syncing ResourceSlice objects. +func NodeName(nodeName string) Option { + return func(o *options) error { + o.nodeName = nodeName + return nil + } +} + +// NodeUID tells the plugin the UID of the v1.Node object. This is used +// when syncing ResourceSlice objects, but doesn't have to be used. If +// not supplied, the controller will look up the object once. +func NodeUID(nodeUID types.UID) Option { + return func(o *options) error { + o.nodeUID = nodeUID + return nil + } +} + type options struct { logger klog.Logger grpcVerbosity int driverName string + nodeName string + nodeUID types.UID draEndpoint endpoint draAddress string pluginRegistrationEndpoint endpoint unaryInterceptors []grpc.UnaryServerInterceptor streamInterceptors []grpc.StreamServerInterceptor + kubeClient kubernetes.Interface nodeV1alpha3 bool } @@ -178,18 +229,36 @@ type options struct { // draPlugin combines the kubelet registration service and the DRA node plugin // service. type draPlugin struct { - registrar *nodeRegistrar - plugin *grpcServer + // backgroundCtx is for activities that are started later. + backgroundCtx context.Context + // cancel cancels the backgroundCtx. + cancel func(cause error) + wg sync.WaitGroup + registrar *nodeRegistrar + plugin *grpcServer + driverName string + nodeName string + nodeUID types.UID + kubeClient kubernetes.Interface + + // Information about resource publishing changes concurrently and thus + // must be protected by the mutex. The controller gets started only + // if needed. + mutex sync.Mutex + resourceSliceController *resourceslice.Controller } // Start sets up two gRPC servers (one for registration, one for the DRA node // client). By default, all APIs implemented by the nodeServer get registered. -func Start(nodeServer interface{}, opts ...Option) (result DRAPlugin, finalErr error) { - d := &draPlugin{} - +// +// The context and/or DRAPlugin.Stop can be used to stop all background activity. +// Stop also blocks. A logger can be stored in the context to add values or +// a name to all log entries. +func Start(ctx context.Context, nodeServer interface{}, opts ...Option) (result DRAPlugin, finalErr error) { + logger := klog.FromContext(ctx) o := options{ logger: klog.Background(), - grpcVerbosity: 4, + grpcVerbosity: 6, // Logs requests and responses, which can be large. nodeV1alpha3: true, } for _, option := range opts { @@ -212,12 +281,42 @@ func Start(nodeServer interface{}, opts ...Option) (result DRAPlugin, finalErr e return nil, errors.New("a Unix domain socket path and/or listener must be set for the registrar") } + d := &draPlugin{ + driverName: o.driverName, + nodeName: o.nodeName, + nodeUID: o.nodeUID, + kubeClient: o.kubeClient, + } + + // Stop calls cancel and therefore both cancellation + // and Stop cause goroutines to stop. + ctx, cancel := context.WithCancelCause(ctx) + d.backgroundCtx, d.cancel = ctx, cancel + logger.V(3).Info("Starting") + d.wg.Add(1) + go func() { + defer d.wg.Done() + defer logger.V(3).Info("Stopping") + <-ctx.Done() + }() + + // Clean up if we don't finish succcessfully. + defer func() { + if r := recover(); r != nil { + d.Stop() + panic(r) + } + if finalErr != nil { + d.Stop() + } + }() + // Run the node plugin gRPC server first to ensure that it is ready. implemented := false - plugin, err := startGRPCServer(klog.LoggerWithName(o.logger, "dra"), o.grpcVerbosity, o.unaryInterceptors, o.streamInterceptors, o.draEndpoint, func(grpcServer *grpc.Server) { - if nodeServer, ok := nodeServer.(drapbv1alpha3.NodeServer); ok && o.nodeV1alpha3 { - o.logger.V(5).Info("registering drapbv1alpha3.NodeServer") - drapbv1alpha3.RegisterNodeServer(grpcServer, nodeServer) + plugin, err := startGRPCServer(klog.NewContext(ctx, klog.LoggerWithName(logger, "dra")), o.grpcVerbosity, o.unaryInterceptors, o.streamInterceptors, o.draEndpoint, func(grpcServer *grpc.Server) { + if nodeServer, ok := nodeServer.(drapb.NodeServer); ok && o.nodeV1alpha3 { + logger.V(5).Info("registering drapbv1alpha3.NodeServer") + drapb.RegisterNodeServer(grpcServer, nodeServer) implemented = true } }) @@ -225,38 +324,83 @@ func Start(nodeServer interface{}, opts ...Option) (result DRAPlugin, finalErr e return nil, fmt.Errorf("start node client: %v", err) } d.plugin = plugin - defer func() { - // Clean up if we didn't finish succcessfully. - if r := recover(); r != nil { - plugin.stop() - panic(r) - } - if finalErr != nil { - plugin.stop() - } - }() if !implemented { return nil, errors.New("no supported DRA gRPC API is implemented and enabled") } // Now make it available to kubelet. - registrar, err := startRegistrar(klog.LoggerWithName(o.logger, "registrar"), o.grpcVerbosity, o.unaryInterceptors, o.streamInterceptors, o.driverName, o.draAddress, o.pluginRegistrationEndpoint) + registrar, err := startRegistrar(klog.NewContext(ctx, klog.LoggerWithName(logger, "registrar")), o.grpcVerbosity, o.unaryInterceptors, o.streamInterceptors, o.driverName, o.draAddress, o.pluginRegistrationEndpoint) if err != nil { return nil, fmt.Errorf("start registrar: %v", err) } d.registrar = registrar + // startGRPCServer and startRegistrar don't implement cancellation + // themselves, we add that for both here. + d.wg.Add(1) + go func() { + defer d.wg.Done() + <-ctx.Done() + + // Time to stop. + d.plugin.stop() + d.registrar.stop() + + // d.resourceSliceController is set concurrently. + d.mutex.Lock() + d.resourceSliceController.Stop() + d.mutex.Unlock() + }() + return d, nil } +// Stop implements [DRAPlugin.Stop]. func (d *draPlugin) Stop() { if d == nil { return } - d.registrar.stop() - d.plugin.stop() + d.cancel(errors.New("DRA plugin was stopped")) + // Wait for goroutines in Start to clean up and exit. + d.wg.Wait() +} + +// PublishResources implements [DRAPlugin.PublishResources]. +func (d *draPlugin) PublishResources(ctx context.Context, resources Resources) { + d.mutex.Lock() + defer d.mutex.Unlock() + + owner := resourceslice.Owner{ + APIVersion: "v1", + Kind: "Node", + Name: d.nodeName, + UID: d.nodeUID, // Optional, will be determined by controller if empty. + } + driverResources := &resourceslice.DriverResources{ + Pools: map[string]resourceslice.Pool{ + d.nodeName: { + Devices: resources.Devices, + }, + }, + } + if d.resourceSliceController == nil { + // Start publishing the information. The controller is using + // our background context, not the one passed into this + // function, and thus is connected to the lifecycle of the + // plugin. + controllerCtx := d.backgroundCtx + controllerLogger := klog.FromContext(controllerCtx) + controllerLogger = klog.LoggerWithName(controllerLogger, "ResourceSlice controller") + controllerCtx = klog.NewContext(controllerCtx, controllerLogger) + d.resourceSliceController = resourceslice.StartController(controllerCtx, d.kubeClient, d.driverName, owner, driverResources) + return + } + + // Inform running controller about new information. + d.resourceSliceController.Update(driverResources) } +// RegistrationStatus implements [DRAPlugin.RegistrationStatus]. func (d *draPlugin) RegistrationStatus() *registerapi.RegistrationStatus { if d.registrar == nil { return nil diff --git a/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/noderegistrar.go b/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/noderegistrar.go index 579f86245a750..abcc6df2170f5 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/noderegistrar.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/noderegistrar.go @@ -17,30 +17,30 @@ limitations under the License. package kubeletplugin import ( + "context" "fmt" "google.golang.org/grpc" - "k8s.io/klog/v2" registerapi "k8s.io/kubelet/pkg/apis/pluginregistration/v1" ) type nodeRegistrar struct { - logger klog.Logger registrationServer server *grpcServer } // startRegistrar returns a running instance. -func startRegistrar(logger klog.Logger, grpcVerbosity int, interceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor, driverName string, endpoint string, pluginRegistrationEndpoint endpoint) (*nodeRegistrar, error) { +// +// The context is only used for additional values, cancellation is ignored. +func startRegistrar(valueCtx context.Context, grpcVerbosity int, interceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor, driverName string, endpoint string, pluginRegistrationEndpoint endpoint) (*nodeRegistrar, error) { n := &nodeRegistrar{ - logger: logger, registrationServer: registrationServer{ driverName: driverName, endpoint: endpoint, supportedVersions: []string{"1.0.0"}, // TODO: is this correct? }, } - s, err := startGRPCServer(logger, grpcVerbosity, interceptors, streamInterceptors, pluginRegistrationEndpoint, func(grpcServer *grpc.Server) { + s, err := startGRPCServer(valueCtx, grpcVerbosity, interceptors, streamInterceptors, pluginRegistrationEndpoint, func(grpcServer *grpc.Server) { registerapi.RegisterRegistrationServer(grpcServer, n) }) if err != nil { diff --git a/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/nonblockinggrpcserver.go b/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/nonblockinggrpcserver.go index c2d6cf18267fd..c8b0a2594d770 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/nonblockinggrpcserver.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/kubeletplugin/nonblockinggrpcserver.go @@ -26,15 +26,17 @@ import ( "google.golang.org/grpc" "k8s.io/klog/v2" + + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) +var requestID int64 + type grpcServer struct { - logger klog.Logger grpcVerbosity int wg sync.WaitGroup endpoint endpoint server *grpc.Server - requestID int64 } type registerService func(s *grpc.Server) @@ -54,9 +56,11 @@ type endpoint struct { // startGRPCServer sets up the GRPC server on a Unix domain socket and spawns a goroutine // which handles requests for arbitrary services. -func startGRPCServer(logger klog.Logger, grpcVerbosity int, unaryInterceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor, endpoint endpoint, services ...registerService) (*grpcServer, error) { +// +// The context is only used for additional values, cancellation is ignored. +func startGRPCServer(valueCtx context.Context, grpcVerbosity int, unaryInterceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor, endpoint endpoint, services ...registerService) (*grpcServer, error) { + logger := klog.FromContext(valueCtx) s := &grpcServer{ - logger: logger, endpoint: endpoint, grpcVerbosity: grpcVerbosity, } @@ -79,10 +83,11 @@ func startGRPCServer(logger klog.Logger, grpcVerbosity int, unaryInterceptors [] // Run a gRPC server. It will close the listening socket when // shutting down, so we don't need to do that. var opts []grpc.ServerOption - var finalUnaryInterceptors []grpc.UnaryServerInterceptor - var finalStreamInterceptors []grpc.StreamServerInterceptor + finalUnaryInterceptors := []grpc.UnaryServerInterceptor{unaryContextInterceptor(valueCtx)} + finalStreamInterceptors := []grpc.StreamServerInterceptor{streamContextInterceptor(valueCtx)} if grpcVerbosity >= 0 { finalUnaryInterceptors = append(finalUnaryInterceptors, s.interceptor) + finalStreamInterceptors = append(finalStreamInterceptors, s.streamInterceptor) } finalUnaryInterceptors = append(finalUnaryInterceptors, unaryInterceptors...) finalStreamInterceptors = append(finalStreamInterceptors, streamInterceptors...) @@ -103,16 +108,66 @@ func startGRPCServer(logger klog.Logger, grpcVerbosity int, unaryInterceptors [] } }() - logger.Info("GRPC server started") + logger.V(3).Info("GRPC server started") return s, nil } +// unaryContextInterceptor injects values from the context into the context +// used by the call chain. +func unaryContextInterceptor(valueCtx context.Context) grpc.UnaryServerInterceptor { + return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) { + ctx = mergeContexts(ctx, valueCtx) + return handler(ctx, req) + } +} + +// streamContextInterceptor does the same as UnaryContextInterceptor for streams. +func streamContextInterceptor(valueCtx context.Context) grpc.StreamServerInterceptor { + return func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + ctx := mergeContexts(ss.Context(), valueCtx) + return handler(srv, mergeServerStream{ServerStream: ss, ctx: ctx}) + } +} + +type mergeServerStream struct { + grpc.ServerStream + ctx context.Context +} + +func (m mergeServerStream) Context() context.Context { + return m.ctx +} + +// mergeContexts creates a new context where cancellation is handled by the +// root context. The values stored by the value context are used as fallback if +// the root context doesn't have a certain value. +func mergeContexts(rootCtx, valueCtx context.Context) context.Context { + return mergeCtx{ + Context: rootCtx, + valueCtx: valueCtx, + } +} + +type mergeCtx struct { + context.Context + valueCtx context.Context +} + +func (m mergeCtx) Value(i interface{}) interface{} { + if v := m.Context.Value(i); v != nil { + return v + } + return m.valueCtx.Value(i) +} + // interceptor is called for each request. It creates a logger with a unique, // sequentially increasing request ID and adds that logger to the context. It // also logs request and response. func (s *grpcServer) interceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - requestID := atomic.AddInt64(&s.requestID, 1) - logger := klog.LoggerWithValues(s.logger, "requestID", requestID) + + requestID := atomic.AddInt64(&requestID, 1) + logger := klog.FromContext(ctx) + logger = klog.LoggerWithValues(logger, "requestID", requestID, "method", info.FullMethod) ctx = klog.NewContext(ctx, logger) logger.V(s.grpcVerbosity).Info("handling request", "request", req) defer func() { @@ -123,13 +178,57 @@ func (s *grpcServer) interceptor(ctx context.Context, req interface{}, info *grp }() resp, err = handler(ctx, req) if err != nil { - logger.Error(err, "handling request failed", "request", req) + logger.Error(err, "handling request failed") } else { logger.V(s.grpcVerbosity).Info("handling request succeeded", "response", resp) } return } +func (s *grpcServer) streamInterceptor(server interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + requestID := atomic.AddInt64(&requestID, 1) + ctx := stream.Context() + logger := klog.FromContext(ctx) + logger = klog.LoggerWithValues(logger, "requestID", requestID, "method", info.FullMethod) + ctx = klog.NewContext(ctx, logger) + stream = logStream{ + ServerStream: stream, + ctx: ctx, + grpcVerbosity: s.grpcVerbosity, + } + logger.V(s.grpcVerbosity).Info("handling stream") + err := handler(server, stream) + if err != nil { + logger.Error(err, "handling stream failed") + } else { + logger.V(s.grpcVerbosity).Info("handling stream succeeded") + } + return err + +} + +type logStream struct { + grpc.ServerStream + ctx context.Context + grpcVerbosity int +} + +func (l logStream) Context() context.Context { + return l.ctx +} + +func (l logStream) SendMsg(msg interface{}) error { + logger := klog.FromContext(l.ctx) + logger.V(l.grpcVerbosity).Info("sending stream message", "message", msg) + err := l.ServerStream.SendMsg(msg) + if err != nil { + logger.Error(err, "sending stream message failed") + } else { + logger.V(l.grpcVerbosity).Info("sending stream message succeeded") + } + return err +} + // stop ensures that the server is not running anymore and cleans up all resources. // It is idempotent and may be called with a nil pointer. func (s *grpcServer) stop() { @@ -143,8 +242,7 @@ func (s *grpcServer) stop() { s.server = nil if s.endpoint.path != "" { if err := os.Remove(s.endpoint.path); err != nil && !os.IsNotExist(err) { - s.logger.Error(err, "remove Unix socket") + utilruntime.HandleError(fmt.Errorf("remove Unix socket: %w", err)) } } - s.logger.V(3).Info("GRPC server stopped") } diff --git a/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go b/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go index 665bfcb14cf39..3d59e85709ffb 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go @@ -26,15 +26,10 @@ package resourceclaim import ( "errors" "fmt" - "os" - "strings" - "sync/atomic" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" - "k8s.io/utils/ptr" ) var ( @@ -81,83 +76,11 @@ func Name(pod *v1.Pod, podClaim *v1.PodResourceClaim) (name *string, mustCheckOw } } -// NewNameLookup returns an object which handles determining the name of -// a ResourceClaim. In contrast to the stand-alone Name it is compatible -// also with Kubernetes < 1.28. -// -// Providing a client is optional. If none is available, then code can pass nil -// and users can set the DRA_WITH_DETERMINISTIC_RESOURCE_CLAIM_NAMES env -// variable to an arbitrary non-empty value to use the naming from Kubernetes < -// 1.28. -func NewNameLookup(client kubernetes.Interface) *Lookup { - return &Lookup{client: client} -} - -// Lookup stores the state which is necessary to look up ResourceClaim names. -type Lookup struct { - client kubernetes.Interface - usePodStatus atomic.Pointer[bool] -} - -// Name is a variant of the stand-alone Name with support also for Kubernetes < 1.28. -func (l *Lookup) Name(pod *v1.Pod, podClaim *v1.PodResourceClaim) (name *string, mustCheckOwner bool, err error) { - usePodStatus := l.usePodStatus.Load() - if usePodStatus == nil { - if value, _ := os.LookupEnv("DRA_WITH_DETERMINISTIC_RESOURCE_CLAIM_NAMES"); value != "" { - usePodStatus = ptr.To(false) - } else if l.client != nil { - // Check once. This does not detect upgrades or - // downgrades, but that is good enough for the simple - // test scenarios that the Kubernetes < 1.28 support is - // meant for. - info, err := l.client.Discovery().ServerVersion() - if err != nil { - return nil, false, fmt.Errorf("look up server version: %v", err) - } - if info.Major == "" { - // Fake client... - usePodStatus = ptr.To(true) - } else { - switch strings.Compare(info.Major, "1") { - case -1: - // Huh? - usePodStatus = ptr.To(false) - case 0: - // info.Minor may have a suffix which makes it larger than 28. - // We don't care about pre-releases here. - usePodStatus = ptr.To(strings.Compare("28", info.Minor) <= 0) - case 1: - // Kubernetes 2? Yeah! - usePodStatus = ptr.To(true) - } - } - } else { - // No information. Let's assume recent Kubernetes. - usePodStatus = ptr.To(true) - } - l.usePodStatus.Store(usePodStatus) - } - - if *usePodStatus { - return Name(pod, podClaim) - } - - switch { - case podClaim.ResourceClaimName != nil: - return podClaim.ResourceClaimName, false, nil - case podClaim.ResourceClaimTemplateName != nil: - name := pod.Name + "-" + podClaim.Name - return &name, true, nil - default: - return nil, false, fmt.Errorf(`pod "%s/%s", spec.resourceClaim %q: %w`, pod.Namespace, pod.Name, podClaim.Name, ErrAPIUnsupported) - } -} - // IsForPod checks that the ResourceClaim is the one that // was created for the Pod. It returns an error that is informative // enough to be returned by the caller without adding further details // about the Pod or ResourceClaim. -func IsForPod(pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) error { +func IsForPod(pod *v1.Pod, claim *resourceapi.ResourceClaim) error { // Checking the namespaces is just a precaution. The caller should // never pass in a ResourceClaim that isn't from the same namespace as the // Pod. @@ -169,7 +92,7 @@ func IsForPod(pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) error { // IsReservedForPod checks whether a claim lists the pod as one of the objects // that the claim was reserved for. -func IsReservedForPod(pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) bool { +func IsReservedForPod(pod *v1.Pod, claim *resourceapi.ResourceClaim) bool { for _, reserved := range claim.Status.ReservedFor { if reserved.UID == pod.UID { return true @@ -179,21 +102,7 @@ func IsReservedForPod(pod *v1.Pod, claim *resourcev1alpha2.ResourceClaim) bool { } // CanBeReserved checks whether the claim could be reserved for another object. -func CanBeReserved(claim *resourcev1alpha2.ResourceClaim) bool { - return claim.Status.Allocation.Shareable || - len(claim.Status.ReservedFor) == 0 -} - -// IsAllocatedWithStructuredParameters checks whether the claim is allocated -// and the allocation was done with structured parameters. -func IsAllocatedWithStructuredParameters(claim *resourcev1alpha2.ResourceClaim) bool { - if claim.Status.Allocation == nil { - return false - } - for _, handle := range claim.Status.Allocation.ResourceHandles { - if handle.StructuredData != nil { - return true - } - } - return false +func CanBeReserved(claim *resourceapi.ResourceClaim) bool { + // Currently no restrictions on sharing... + return true } diff --git a/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim_test.go b/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim_test.go index 0518ece1e255a..d5953ba8ad1bb 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim_test.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim_test.go @@ -21,7 +21,7 @@ import ( "testing" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -48,14 +48,14 @@ func TestResourceClaimIsForPod(t *testing.T) { UID: newUID(), }, } - claimNoOwner := &resourcev1alpha2.ResourceClaim{ + claimNoOwner := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "claimNoOwner", UID: newUID(), }, } - claimWithOwner := &resourcev1alpha2.ResourceClaim{ + claimWithOwner := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "claimNoOwner", @@ -68,7 +68,7 @@ func TestResourceClaimIsForPod(t *testing.T) { }, }, } - userClaimWithOwner := &resourcev1alpha2.ResourceClaim{ + userClaimWithOwner := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Namespace: "user-namespace", Name: "userClaimWithOwner", @@ -84,7 +84,7 @@ func TestResourceClaimIsForPod(t *testing.T) { testcases := map[string]struct { pod *v1.Pod - claim *resourcev1alpha2.ResourceClaim + claim *resourceapi.ResourceClaim expectedError string }{ "owned": { diff --git a/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go b/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go new file mode 100644 index 0000000000000..01fd88be1ba64 --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go @@ -0,0 +1,428 @@ +/* +Copyright 2024 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. +*/ + +package resourceslice + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + "github.com/google/go-cmp/cmp" + + "k8s.io/api/core/v1" + resourceapi "k8s.io/api/resource/v1alpha3" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/types" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + resourceinformers "k8s.io/client-go/informers/resource/v1alpha3" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/util/workqueue" + "k8s.io/klog/v2" + "k8s.io/utils/ptr" +) + +const ( + // resyncPeriod for informer + // TODO (https://github.com/kubernetes/kubernetes/issues/123688): disable? + resyncPeriod = time.Duration(10 * time.Minute) +) + +// Controller synchronizes information about resources of one driver with +// ResourceSlice objects. It supports node-local and network-attached +// resources. A DRA driver for node-local resources typically runs this +// controller as part of its kubelet plugin. +type Controller struct { + cancel func(cause error) + driver string + owner Owner + kubeClient kubernetes.Interface + wg sync.WaitGroup + // The queue is keyed with the pool name that needs work. + queue workqueue.TypedRateLimitingInterface[string] + sliceStore cache.Store + + mutex sync.RWMutex + + // When receiving updates from the driver, the entire pointer replaced, + // so it is okay to not do a deep copy of it when reading it. Only reading + // the pointer itself must be protected by a read lock. + resources *DriverResources +} + +// DriverResources is a complete description of all resources synchronized by the controller. +type DriverResources struct { + // Each driver may manage different resource pools. + Pools map[string]Pool +} + +// Pool is the collection of devices belonging to the same pool. +type Pool struct { + // NodeSelector may be different for each pool. Must not get set together + // with Resources.NodeName. It nil and Resources.NodeName is not set, + // then devices are available on all nodes. + NodeSelector *v1.NodeSelector + + // Generation can be left at zero. It gets bumped up automatically + // by the controller. + Generation int64 + + // Device names must be unique inside the pool. + Devices []resourceapi.Device +} + +// Owner is the resource which is meant to be listed as owner of the resource slices. +// For a node the UID may be left blank. The controller will look it up automatically. +type Owner struct { + APIVersion string + Kind string + Name string + UID types.UID +} + +// StartController constructs a new controller and starts it. +// If the owner is a v1.Node, then the NodeName field in the +// ResourceSlice objects is set and used to identify objects +// managed by the controller. The UID is not needed in that +// case, the controller will determine it automatically. +// +// If a kubeClient is provided, then it synchronizes ResourceSlices +// with the resource information provided by plugins. Without it, +// the controller is inactive. This can happen when kubelet is run stand-alone +// without an apiserver. In that case we can't and don't need to publish +// ResourceSlices. +func StartController(ctx context.Context, kubeClient kubernetes.Interface, driver string, owner Owner, resources *DriverResources) *Controller { + if kubeClient == nil { + return nil + } + + logger := klog.FromContext(ctx) + ctx, cancel := context.WithCancelCause(ctx) + + c := &Controller{ + cancel: cancel, + kubeClient: kubeClient, + driver: driver, + owner: owner, + queue: workqueue.NewTypedRateLimitingQueueWithConfig( + workqueue.DefaultTypedControllerRateLimiter[string](), + workqueue.TypedRateLimitingQueueConfig[string]{Name: "node_resource_slices"}, + ), + resources: resources, + } + + logger.V(3).Info("Starting") + c.wg.Add(1) + go func() { + defer c.wg.Done() + defer logger.V(3).Info("Stopping") + c.run(ctx) + }() + + // Sync each pool once. + for poolName := range resources.Pools { + c.queue.Add(poolName) + } + + return c +} + +// Stop cancels all background activity and blocks until the controller has stopped. +func (c *Controller) Stop() { + if c == nil { + return + } + c.cancel(errors.New("ResourceSlice controller was asked to stop")) + c.wg.Wait() +} + +// Update sets the new desired state of the resource information. +// +// The controller takes over ownership, so these resources must +// not get modified after this method returns. +func (c *Controller) Update(resources *DriverResources) { + c.mutex.Lock() + defer c.mutex.Unlock() + + // Sync all old pools.. + for poolName := range c.resources.Pools { + c.queue.Add(poolName) + } + + c.resources = resources + + // ... and the new ones (might be the same). + for poolName := range c.resources.Pools { + c.queue.Add(poolName) + } +} + +// run is running in the background. It handles blocking initialization (like +// syncing the informer) and then syncs the actual with the desired state. +func (c *Controller) run(ctx context.Context) { + logger := klog.FromContext(ctx) + + // We always filter by driver name, by node name only for node-local resources. + selector := fields.Set{resourceapi.ResourceSliceSelectorDriver: c.driver} + if c.owner.APIVersion == "v1" && c.owner.Kind == "Node" { + selector[resourceapi.ResourceSliceSelectorNodeName] = c.owner.Name + } + informer := resourceinformers.NewFilteredResourceSliceInformer(c.kubeClient, resyncPeriod, nil, func(options *metav1.ListOptions) { + options.FieldSelector = selector.String() + }) + c.sliceStore = informer.GetStore() + handler, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj any) { + slice, ok := obj.(*resourceapi.ResourceSlice) + if !ok { + return + } + logger.V(5).Info("ResourceSlice add", "slice", klog.KObj(slice)) + c.queue.Add(slice.Spec.Pool.Name) + }, + UpdateFunc: func(old, new any) { + oldSlice, ok := old.(*resourceapi.ResourceSlice) + if !ok { + return + } + newSlice, ok := new.(*resourceapi.ResourceSlice) + if !ok { + return + } + if loggerV := logger.V(6); loggerV.Enabled() { + loggerV.Info("ResourceSlice update", "slice", klog.KObj(newSlice), "diff", cmp.Diff(oldSlice, newSlice)) + } else { + logger.V(5).Info("ResourceSlice update", "slice", klog.KObj(newSlice)) + } + c.queue.Add(oldSlice.Spec.Pool.Name) + c.queue.Add(newSlice.Spec.Pool.Name) + }, + DeleteFunc: func(obj any) { + if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { + obj = tombstone.Obj + } + slice, ok := obj.(*resourceapi.ResourceSlice) + if !ok { + return + } + logger.V(5).Info("ResourceSlice delete", "slice", klog.KObj(slice)) + c.queue.Add(slice.Spec.Pool.Name) + }, + }) + if err != nil { + logger.Error(err, "Registering event handler on the ResourceSlice informer failed, disabling resource monitoring") + return + } + + // Start informer and wait for our cache to be populated. + logger.V(3).Info("Starting ResourceSlice informer and waiting for it to sync") + c.wg.Add(1) + go func() { + defer c.wg.Done() + defer logger.V(3).Info("ResourceSlice informer has stopped") + defer c.queue.ShutDown() // Once we get here, we must have been asked to stop. + informer.Run(ctx.Done()) + }() + for !handler.HasSynced() { + select { + case <-time.After(time.Second): + case <-ctx.Done(): + return + } + } + logger.V(3).Info("ResourceSlice informer has synced") + + // Seed the + + for c.processNextWorkItem(ctx) { + } +} + +func (c *Controller) processNextWorkItem(ctx context.Context) bool { + poolName, shutdown := c.queue.Get() + if shutdown { + return false + } + defer c.queue.Done(poolName) + logger := klog.FromContext(ctx) + + // Panics are caught and treated like errors. + var err error + func() { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("internal error: %v", r) + } + }() + err = c.syncPool(klog.NewContext(ctx, klog.LoggerWithValues(logger, "poolName", poolName)), poolName) + }() + + if err != nil { + utilruntime.HandleErrorWithContext(ctx, err, "processing ResourceSlice objects") + c.queue.AddRateLimited(poolName) + + // Return without removing the work item from the queue. + // It will be retried. + return true + } + + c.queue.Forget(poolName) + return true +} + +// syncPool processes one pool. Only runs inside a single worker, so there +// is no need for locking except when accessing c.resources, which may +// be updated at any time by the user of the controller. +func (c *Controller) syncPool(ctx context.Context, poolName string) error { + logger := klog.FromContext(ctx) + + // Gather information about the actual and desired state. + // TODO: index by pool name. + var slices []*resourceapi.ResourceSlice + for _, obj := range c.sliceStore.List() { + if slice, ok := obj.(*resourceapi.ResourceSlice); ok && slice.Spec.Pool.Name == poolName { + slices = append(slices, slice) + } + } + var resources *DriverResources + c.mutex.RLock() + resources = c.resources + c.mutex.RUnlock() + + // Retrieve node object to get UID? + // The result gets cached and is expected to not change while + // the controller runs. + var nodeName string + if c.owner.APIVersion == "v1" && c.owner.Kind == "Node" { + nodeName = c.owner.Name + if c.owner.UID == "" { + node, err := c.kubeClient.CoreV1().Nodes().Get(ctx, c.owner.Name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("retrieve node %q: %w", c.owner.Name, err) + } + // There is only one worker, so no locking needed. + c.owner.UID = node.UID + } + } + + // Slices that don't match any driver resource can either be updated (if there + // are new driver resources that need to be stored) or they need to be deleted. + obsoleteSlices := make([]*resourceapi.ResourceSlice, 0, len(slices)) + + // Determine highest generation. + var generation int64 + for _, slice := range slices { + if slice.Spec.Pool.Generation > generation { + generation = slice.Spec.Pool.Generation + } + } + + // Everything older is obsolete. + currentSlices := make([]*resourceapi.ResourceSlice, 0, len(slices)) + for _, slice := range slices { + if slice.Spec.Pool.Generation < generation { + obsoleteSlices = append(obsoleteSlices, slice) + } else { + currentSlices = append(currentSlices, slice) + } + } + slices = currentSlices + + if pool, ok := resources.Pools[poolName]; ok { + if pool.Generation > generation { + generation = pool.Generation + } + + // Right now all devices get published in a single slice. + // We simply pick the first one, if there is one, and copy + // it in preparation for updating it. + // + // TODO: support splitting across slices, with unit tests. + if len(slices) > 0 { + obsoleteSlices = append(obsoleteSlices, slices[1:]...) + slices = []*resourceapi.ResourceSlice{slices[0].DeepCopy()} + } else { + slices = []*resourceapi.ResourceSlice{ + { + ObjectMeta: metav1.ObjectMeta{ + GenerateName: c.owner.Name + "-" + c.driver + "-", + }, + }, + } + } + + slice := slices[0] + slice.OwnerReferences = []metav1.OwnerReference{{ + APIVersion: c.owner.APIVersion, + Kind: c.owner.Kind, + Name: c.owner.Name, + UID: c.owner.UID, + Controller: ptr.To(true), + }} + slice.Spec.Driver = c.driver + slice.Spec.Pool.Name = poolName + slice.Spec.Pool.Generation = generation + slice.Spec.Pool.ResourceSliceCount = 1 + slice.Spec.NodeName = nodeName + slice.Spec.NodeSelector = pool.NodeSelector + slice.Spec.AllNodes = pool.NodeSelector == nil && nodeName == "" + slice.Spec.Devices = pool.Devices + + if loggerV := logger.V(6); loggerV.Enabled() { + // Dump entire resource information. + loggerV.Info("Syncing resource slices", "obsoleteSlices", klog.KObjSlice(obsoleteSlices), "slices", klog.KObjSlice(slices), "pool", pool) + } else { + logger.V(5).Info("Syncing resource slices", "obsoleteSlices", klog.KObjSlice(obsoleteSlices), "slices", klog.KObjSlice(slices), "numDevices", len(pool.Devices)) + } + } else if len(slices) > 0 { + // All are obsolete, pool does not exist anymore. + + logger.V(5).Info("Removing resource slices after pool removal", "obsoleteSlices", klog.KObjSlice(obsoleteSlices), "slices", klog.KObjSlice(slices), "numDevices", len(pool.Devices)) + obsoleteSlices = append(obsoleteSlices, slices...) + } + + // Remove stale slices. + for _, slice := range obsoleteSlices { + logger.V(5).Info("Deleting obsolete resource slice", "slice", klog.KObj(slice)) + if err := c.kubeClient.ResourceV1alpha3().ResourceSlices().Delete(ctx, slice.Name, metav1.DeleteOptions{}); err != nil && !apierrors.IsNotFound(err) { + return fmt.Errorf("delete resource slice: %w", err) + } + } + + // Create or update slices. + for _, slice := range slices { + if slice.UID == "" { + logger.V(5).Info("Creating new resource slice", "slice", klog.KObj(slice)) + if _, err := c.kubeClient.ResourceV1alpha3().ResourceSlices().Create(ctx, slice, metav1.CreateOptions{}); err != nil { + return fmt.Errorf("create resource slice: %w", err) + } + continue + } + + // TODO: switch to SSA once unit testing supports it. + logger.V(5).Info("Updating existing resource slice", "slice", klog.KObj(slice)) + if _, err := c.kubeClient.ResourceV1alpha3().ResourceSlices().Update(ctx, slice, metav1.UpdateOptions{}); err != nil { + return fmt.Errorf("delete resource slice: %w", err) + } + } + + return nil +} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator.go new file mode 100644 index 0000000000000..161b3be99fd8a --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator.go @@ -0,0 +1,745 @@ +/* +Copyright 2024 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. +*/ + +package structured + +import ( + "context" + "errors" + "fmt" + "math" + "strings" + + v1 "k8s.io/api/core/v1" + resourceapi "k8s.io/api/resource/v1alpha3" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apiserver/pkg/cel/environment" + resourcelisters "k8s.io/client-go/listers/resource/v1alpha3" + "k8s.io/dynamic-resource-allocation/cel" + "k8s.io/klog/v2" +) + +// ClaimLister returns a subset of the claims that a +// resourcelisters.ResourceClaimLister would return. +type ClaimLister interface { + // ListAllAllocated returns only claims which are allocated. + ListAllAllocated() ([]*resourceapi.ResourceClaim, error) +} + +// Allocator calculates how to allocate a set of unallocated claims which use +// structured parameters. +// +// It needs as input the node where the allocated claims are meant to be +// available and the current state of the cluster (claims, classes, resource +// slices). +type Allocator struct { + claimsToAllocate []*resourceapi.ResourceClaim + claimLister ClaimLister + classLister resourcelisters.DeviceClassLister + sliceLister resourcelisters.ResourceSliceLister +} + +// NewAllocator returns an allocator for a certain set of claims or an error if +// some problem was detected which makes it impossible to allocate claims. +func NewAllocator(ctx context.Context, + claimsToAllocate []*resourceapi.ResourceClaim, + claimLister ClaimLister, + classLister resourcelisters.DeviceClassLister, + sliceLister resourcelisters.ResourceSliceLister, +) (*Allocator, error) { + return &Allocator{ + claimsToAllocate: claimsToAllocate, + claimLister: claimLister, + classLister: classLister, + sliceLister: sliceLister, + }, nil +} + +// ClaimsToAllocate returns the claims that the allocated was created for. +func (a *Allocator) ClaimsToAllocate() []*resourceapi.ResourceClaim { + return a.claimsToAllocate +} + +// Allocate calculates the allocation(s) for one particular node. +// +// It returns an error only if some fatal problem occurred. These are errors +// caused by invalid input data, like for example errors in CEL selectors, so a +// scheduler should abort and report that problem instead of trying to find +// other nodes where the error doesn't occur. +// +// In the future, special errors will be defined which enable the caller to +// identify which object (like claim or class) caused the problem. This will +// enable reporting the problem as event for those objects. +// +// If the claims cannot be allocated, it returns nil. This includes the +// situation where the resource slices are incomplete at the moment. +// +// If the claims can be allocated, then it prepares one allocation result for +// each unallocated claim. It is the responsibility of the caller to persist +// those allocations, if desired. +// +// Allocate is thread-safe. If the caller wants to get the node name included +// in log output, it can use contextual logging and add the node as an +// additional value. A name can also be useful because log messages do not +// have a common prefix. V(4) is used for one-time log entries, V(5) for important +// progress reports, and V(6) for detailed debug output. +func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) ([]*resourceapi.AllocationResult, error) { + alloc := &allocator{ + Allocator: a, + ctx: ctx, // all methods share the same a and thus ctx + logger: klog.FromContext(ctx), + deviceMatchesRequest: make(map[matchKey]bool), + constraints: make([][]constraint, len(a.claimsToAllocate)), + requestData: make(map[requestIndices]requestData), + allocated: make(map[DeviceID]bool), + result: make([]*resourceapi.AllocationResult, len(a.claimsToAllocate)), + } + + // First determine all eligible pools. + pools, err := GatherPools(ctx, alloc.sliceLister, node) + if err != nil { + return nil, fmt.Errorf("gather pool information: %w", err) + } + alloc.pools = pools + if loggerV := alloc.logger.V(6); loggerV.Enabled() { + loggerV.Info("Gathered pool information", "numPools", len(pools), "pools", pools) + } else { + alloc.logger.V(4).Info("Gathered pool information", "numPools", len(pools)) + } + + // We allocate one claim after the other and for each claim, all of + // its requests. For each individual device we pick one possible + // candidate after the other, checking constraints as we go. + // Each chosen candidate is marked as "in use" and the process + // continues, recursively. This way, all requests get matched against + // all candidates in all possible orders. + // + // The first full solution is chosen. + // + // In other words, this is an exhaustive search. This is okay because + // it aborts early. Once scoring gets added, more intelligence may be + // needed to avoid trying "equivalent" solutions (two identical + // requests, two identical devices, two solutions that are the same in + // practice). + + // This is where we sanity check that we can actually handle the claims + // and their requests. For each claim we determine how many devices + // need to be allocated. If not all can be stored in the result, the + // claim cannot be allocated. + for claimIndex, claim := range alloc.claimsToAllocate { + numDevices := 0 + + // If we have any any request that wants "all" devices, we need to + // figure out how much "all" is. If some pool is incomplete, we stop + // here because allocation cannot succeed. Once we do scoring, we should + // stop in all cases, not just when "all" devices are needed, because + // pulling from an incomplete might not pick the best solution and it's + // better to wait. This does not matter yet as long the incomplete pool + // has some matching device. + for requestIndex := range claim.Spec.Devices.Requests { + request := &claim.Spec.Devices.Requests[requestIndex] + if request.DeviceClassName == "" { + // Unknown future request type! + return nil, fmt.Errorf("claim %s, request %s: unsupported request type", klog.KObj(claim), request.Name) + } + for i, selector := range request.Selectors { + if selector.CEL == nil { + // Unknown future selector type! + return nil, fmt.Errorf("claim %s, request %s, selector #%d: unsupported selector type", klog.KObj(claim), request.Name, i) + } + } + + // Should be set. If it isn't, something changed and we should refuse to proceed. + if request.DeviceClassName == "" { + return nil, fmt.Errorf("claim %s, request %s: missing device class name", klog.KObj(claim), request.Name) + } + class, err := alloc.classLister.Get(request.DeviceClassName) + if err != nil { + return nil, fmt.Errorf("claim %s, request %s: could not retrieve device class %s: %w", klog.KObj(claim), request.Name, request.DeviceClassName, err) + } + + requestData := requestData{ + class: class, + } + + switch request.CountMode { + case resourceapi.DeviceCountModeExact: + numDevices := request.Count + if numDevices > math.MaxInt { + // Allowed by API validation, but doesn't make sense. + return nil, fmt.Errorf("claim %s, request %s: exact count %d is too large", klog.KObj(claim), request.Name, numDevices) + } + requestData.numDevices = int(numDevices) + case resourceapi.DeviceCountModeAll: + requestData.allDevices = make([]deviceWithID, 0, resourceapi.AllocationResultsMaxSize) + for _, pool := range pools { + if pool.IsIncomplete { + return nil, fmt.Errorf("claim %s, request %s: asks for all devices, but resource pool %s is currently being updated", klog.KObj(claim), request.Name, pool.PoolID) + } + + for _, slice := range pool.Slices { + for deviceIndex := range slice.Spec.Devices { + selectable, err := alloc.isSelectable(requestIndices{claimIndex: claimIndex, requestIndex: requestIndex}, slice, deviceIndex) + if err != nil { + return nil, err + } + if selectable { + requestData.allDevices = append(requestData.allDevices, deviceWithID{device: slice.Spec.Devices[deviceIndex].Basic, DeviceID: DeviceID{Driver: slice.Spec.Driver, Pool: slice.Spec.Pool.Name, Device: slice.Spec.Devices[deviceIndex].Name}}) + } + } + } + } + requestData.numDevices = len(requestData.allDevices) + alloc.logger.V(5).Info("Request for 'all' devices", "claim", klog.KObj(claim), "request", request.Name, "numDevicesPerRequest", requestData.numDevices) + default: + return nil, fmt.Errorf("claim %s, request %s: unsupported count mode %s", klog.KObj(claim), request.Name, request.CountMode) + } + alloc.requestData[requestIndices{claimIndex: claimIndex, requestIndex: requestIndex}] = requestData + numDevices += requestData.numDevices + } + alloc.logger.Info("Checked claim", "claim", klog.KObj(claim), "numDevices", numDevices) + + // Check that we don't end up with too many results. + if numDevices > resourceapi.AllocationResultsMaxSize { + return nil, fmt.Errorf("claim %s: number of requested devices %d exceeds the claim limit of %d", klog.KObj(claim), numDevices, resourceapi.AllocationResultsMaxSize) + } + + // If we don't, then we can pre-allocate the result slices for + // appending the actual results later. + alloc.result[claimIndex] = &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: make([]resourceapi.DeviceRequestAllocationResult, 0, numDevices), + }, + } + + // Constraints are assumed to be monotonic: once a constraint returns + // false, adding more devices will not cause it to return true. This + // allows the search to stop early once a constraint returns false. + var constraints = make([]constraint, len(claim.Spec.Devices.Constraints)) + for i, constraint := range claim.Spec.Devices.Constraints { + switch { + case constraint.MatchAttribute != nil: + logger := alloc.logger + if loggerV := alloc.logger.V(5); loggerV.Enabled() { + logger = klog.LoggerWithName(logger, "matchAttributeConstraint") + logger = klog.LoggerWithValues(logger, "matchAttribute", *constraint.MatchAttribute) + } + m := &matchAttributeConstraint{ + logger: logger, + requestNames: sets.New(constraint.Requests...), + attributeName: *constraint.MatchAttribute, + } + constraints[i] = m + default: + // Unknown constraint type! + return nil, fmt.Errorf("claim %s, constraint #%d: unsupported constraint type", klog.KObj(claim), i) + } + } + alloc.constraints[claimIndex] = constraints + } + + // Selecting a device for a request is independent of what has been + // allocated already. Therefore the result of checking a request against + // a device instance in the pool can be cached. The pointer to both + // can serve as key because they are static for the duration of + // the Allocate call and can be compared in Go. + alloc.deviceMatchesRequest = make(map[matchKey]bool) + + // Some of the existing devices are probably already allocated by + // claims... + claims, err := alloc.claimLister.ListAllAllocated() + numAllocated := 0 + if err != nil { + return nil, fmt.Errorf("list allocated claims: %w", err) + } + for _, claim := range claims { + // Sanity check.. + if claim.Status.Allocation == nil { + continue + } + for _, result := range claim.Status.Allocation.Devices.Results { + deviceID := DeviceID{Driver: result.Driver, Pool: result.Pool, Device: result.Device} + alloc.allocated[deviceID] = true + numAllocated++ + } + } + alloc.logger.V(6).Info("Gathered information about allocated devices", "numAllocated", numAllocated) + + // In practice, there aren't going to be many different CEL + // expressions. Most likely, there is going to be handful of different + // device classes that get used repeatedly. Different requests may all + // use the same selector. Therefore compiling CEL expressions on demand + // could be a useful performance enhancement. It's not implemented yet + // because the key is more complex (just the string?) and the memory + // for both key and cached content is larger than for device matches. + // + // We may also want to cache this in the shared [Allocator] instance, + // which implies adding locking. + + // All errors get created such that they can be returned by Allocate + // without further wrapping. + done, err := alloc.allocateOne(deviceIndices{}) + if err != nil { + return nil, err + } + if errors.Is(err, errStop) || !done { + return nil, nil + } + + // Populate configs. + for claimIndex, allocationResult := range alloc.result { + claim := alloc.claimsToAllocate[claimIndex] + for requestIndex := range claim.Spec.Devices.Requests { + class := alloc.requestData[requestIndices{claimIndex: claimIndex, requestIndex: requestIndex}].class + if class != nil { + for _, config := range class.Spec.Config { + allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClass, + Requests: nil, // All of them... + DeviceConfiguration: config.DeviceConfiguration, + }) + } + } + } + for _, config := range claim.Spec.Devices.Config { + allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClaim, + Requests: config.Requests, + DeviceConfiguration: config.DeviceConfiguration, + }) + } + } + + return alloc.result, nil +} + +// errStop is a special error that gets returned by allocateOne if it detects +// that allocation cannot succeed. +var errStop = errors.New("stop allocation") + +// allocator is used while an [Allocator.Allocate] is running. Only a single +// goroutine works with it, so there is no need for locking. +type allocator struct { + *Allocator + ctx context.Context + logger klog.Logger + pools []*Pool + deviceMatchesRequest map[matchKey]bool + constraints [][]constraint // one list of constraints per claim + requestData map[requestIndices]requestData // one entry per request + allocated map[DeviceID]bool + skippedUnknownDevice bool + result []*resourceapi.AllocationResult +} + +// matchKey identifies a device/request pair. +type matchKey struct { + DeviceID + requestIndices +} + +// requestIndices identifies one specific request by its +// claim and request index. +type requestIndices struct { + claimIndex, requestIndex int +} + +// deviceIndices identifies one specific required device inside +// a request of a certain claim. +type deviceIndices struct { + claimIndex, requestIndex, deviceIndex int +} + +type requestData struct { + class *resourceapi.DeviceClass + numDevices int + + // pre-determined set of devices for allocating "all" devices + allDevices []deviceWithID +} + +type deviceWithID struct { + DeviceID + device *resourceapi.BasicDevice +} + +type constraint interface { + // add is called whenever a device is about to be allocated. It must + // check whether the device matches the constraint and if yes, + // track that it is allocated. + add(requestName string, device *resourceapi.BasicDevice, deviceID DeviceID) bool + + // For every successful add there is exactly one matching removed call + // with the exact same parameters. + remove(requestName string, device *resourceapi.BasicDevice, deviceID DeviceID) +} + +// matchAttributeConstraint compares an attribute value across devices. +// All devices must share the same value. When the set of devices is +// empty, any device that has the attribute can be added. After that, +// only matching devices can be added. +// +// We don't need to track *which* devices are part of the set, only +// how many. +type matchAttributeConstraint struct { + logger klog.Logger // Includes name and attribute name, so no need to repeat in log messages. + requestNames sets.Set[string] + attributeName resourceapi.FullyQualifiedName + + attribute *resourceapi.DeviceAttribute + numDevices int +} + +func (m *matchAttributeConstraint) add(requestName string, device *resourceapi.BasicDevice, deviceID DeviceID) bool { + if m.requestNames.Len() > 0 && !m.requestNames.Has(requestName) { + // Device not affected by constraint. + m.logger.V(6).Info("Constraint does not apply to request", "request", requestName) + return true + } + + attribute := lookupAttribute(device, deviceID, m.attributeName) + if attribute == nil { + // Doesn't have the attribute. + m.logger.V(6).Info("Constraint not satisfied, attribute not set") + return false + } + + if m.numDevices == 0 { + // The first device can always get picked. + m.attribute = attribute + m.numDevices = 1 + m.logger.V(6).Info("First in set") + return true + } + + switch { + case attribute.StringValue != nil: + if m.attribute.StringValue == nil || *attribute.StringValue != *m.attribute.StringValue { + m.logger.V(6).Info("String values different") + return false + } + case attribute.IntValue != nil: + if m.attribute.IntValue == nil || *attribute.IntValue != *m.attribute.IntValue { + m.logger.V(6).Info("Int values different") + return false + } + case attribute.BoolValue != nil: + if m.attribute.BoolValue == nil || *attribute.BoolValue != *m.attribute.BoolValue { + m.logger.V(6).Info("Bool values different") + return false + } + case attribute.VersionValue != nil: + // semver 2.0.0 requires that version strings are in their + // minimal form (in particular, no leading zeros). Therefore a + // strict "exact equal" check can do a string comparison. + if m.attribute.VersionValue == nil || *attribute.VersionValue != *m.attribute.VersionValue { + m.logger.V(6).Info("Version values different") + return false + } + default: + // Unknown value type, cannot match. + m.logger.V(6).Info("Match attribute type unknown") + return false + } + + m.numDevices++ + m.logger.V(6).Info("Constraint satisfied by device", "device", deviceID, "numDevices", m.numDevices) + return true +} + +func (m *matchAttributeConstraint) remove(requestName string, device *resourceapi.BasicDevice, deviceID DeviceID) { + if m.requestNames.Len() > 0 && !m.requestNames.Has(requestName) { + // Device not affected by constraint. + return + } + + m.numDevices-- + m.logger.V(6).Info("Device removed from constraint set", "device", deviceID, "numDevices", m.numDevices) +} + +func lookupAttribute(device *resourceapi.BasicDevice, deviceID DeviceID, attributeName resourceapi.FullyQualifiedName) *resourceapi.DeviceAttribute { + // Fully-qualified match? + if attr, ok := device.Attributes[resourceapi.QualifiedName(attributeName)]; ok { + return &attr + } + index := strings.Index(string(attributeName), "/") + if index < 0 { + // Should not happen for a valid fully qualified name. + return nil + } + + if string(attributeName[0:index]) != deviceID.Driver { + // Not an attribute of the driver and not found above, + // so it is not available. + return nil + } + + // Domain matches the driver, so let's check just the ID. + if attr, ok := device.Attributes[resourceapi.QualifiedName(attributeName[index+1:])]; ok { + return &attr + } + + return nil +} + +// allocateOne iterates over all eligible devices (not in use, match selector, +// satisfy constraints) for a specific required device. It returns true if +// everything got allocated, an error if allocation needs to stop. +func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { + if r.claimIndex >= len(alloc.claimsToAllocate) { + // Done! If we were doing scoring, we would compare the current allocation result + // against the previous one, keep the best, and continue. Without scoring, we stop + // and use the first solution. + alloc.logger.V(4).Info("Allocation result found") + return true, nil + } + + claim := alloc.claimsToAllocate[r.claimIndex] + if r.requestIndex >= len(claim.Spec.Devices.Requests) { + // Done with the claim, continue with the next one. + return alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex + 1}) + } + + // We already know how many devices per request are needed. + // Ready to move on to the next request? + requestData := alloc.requestData[requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex}] + if r.deviceIndex >= requestData.numDevices { + return alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex + 1}) + } + + request := &alloc.claimsToAllocate[r.claimIndex].Spec.Devices.Requests[r.requestIndex] + doAllDevices := request.CountMode == resourceapi.DeviceCountModeAll + alloc.logger.V(5).Info("Allocating one device", "currentClaim", r.claimIndex, "totalClaims", len(alloc.claimsToAllocate), "currentRequest", r.requestIndex, "totalRequestsPerClaim", len(claim.Spec.Devices.Requests), "currentDevice", r.deviceIndex, "devicesPerRequest", requestData.numDevices, "allDevices", doAllDevices, "adminAccess", request.AdminAccess) + + if doAllDevices { + // For "all" devices we already know which ones we need. We + // just need to check whether we can use them. + deviceWithID := requestData.allDevices[r.deviceIndex] + _, _, err := alloc.allocateDevice(r, deviceWithID.device, deviceWithID.DeviceID, true) + if err != nil { + return false, err + } + done, err := alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, deviceIndex: r.deviceIndex + 1}) + if err != nil { + return false, err + } + + // The order in which we allocate "all" devices doesn't matter, + // so we only try with the one which was up next. If we couldn't + // get all of them, then there is no solution and we have to stop. + if !done { + return false, errStop + } + return done, nil + } + + // We need to find suitable devices. + for _, pool := range alloc.pools { + for _, slice := range pool.Slices { + for deviceIndex := range slice.Spec.Devices { + deviceID := DeviceID{Driver: pool.Driver, Pool: pool.Pool, Device: slice.Spec.Devices[deviceIndex].Name} + + // Checking for "in use" is cheap and thus gets done first. + if !request.AdminAccess && alloc.allocated[deviceID] { + alloc.logger.V(6).Info("Device in use", "device", deviceID) + continue + } + + // Next check selectors. + selectable, err := alloc.isSelectable(requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex}, slice, deviceIndex) + if err != nil { + return false, err + } + if !selectable { + alloc.logger.V(6).Info("Device not selectable", "device", deviceID) + continue + } + + // Finally treat as allocated and move on to the next device. + allocated, deallocate, err := alloc.allocateDevice(r, slice.Spec.Devices[deviceIndex].Basic, deviceID, false) + if err != nil { + return false, err + } + if !allocated { + // In use or constraint violated... + alloc.logger.V(6).Info("Device not usable", "device", deviceID) + continue + } + done, err := alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, deviceIndex: r.deviceIndex + 1}) + if err != nil { + return false, err + } + + // If we found a solution, then we can stop. + if done { + return done, nil + } + + // Otherwise try some other device after rolling back. + deallocate() + } + } + } + + // If we get here without finding a solution, then there is none. + return false, nil +} + +// isSelectable checks whether a device satisfies the request and class selectors. +func (alloc *allocator) isSelectable(r requestIndices, slice *resourceapi.ResourceSlice, deviceIndex int) (bool, error) { + // This is the only supported device type at the moment. + device := slice.Spec.Devices[deviceIndex].Basic + if device == nil { + // Must be some future, unknown device type. We cannot select it. + // If we don't find anything else, then this will get reported + // in the final result, so remember that we skipped some device. + alloc.skippedUnknownDevice = true + return false, nil + } + + deviceID := DeviceID{Driver: slice.Spec.Driver, Pool: slice.Spec.Pool.Name, Device: slice.Spec.Devices[deviceIndex].Name} + matchKey := matchKey{DeviceID: deviceID, requestIndices: r} + if matches, ok := alloc.deviceMatchesRequest[matchKey]; ok { + // No need to check again. + return matches, nil + } + + requestData := alloc.requestData[r] + if requestData.class != nil { + match, err := alloc.selectorsMatch(r, device, deviceID, requestData.class, requestData.class.Spec.Selectors) + if err != nil { + return false, err + } + if !match { + alloc.deviceMatchesRequest[matchKey] = false + return false, nil + } + } + + request := &alloc.claimsToAllocate[r.claimIndex].Spec.Devices.Requests[r.requestIndex] + match, err := alloc.selectorsMatch(r, device, deviceID, nil, request.Selectors) + if err != nil { + return false, err + } + if !match { + alloc.deviceMatchesRequest[matchKey] = false + return false, nil + } + + alloc.deviceMatchesRequest[matchKey] = true + return true, nil + +} + +func (alloc *allocator) selectorsMatch(r requestIndices, device *resourceapi.BasicDevice, deviceID DeviceID, class *resourceapi.DeviceClass, selectors []resourceapi.DeviceSelector) (bool, error) { + for i, selector := range selectors { + expr := cel.Compiler.CompileCELExpression(selector.CEL.Expression, environment.StoredExpressions) + if expr.Error != nil { + // Could happen if some future apiserver accepted some + // future expression and then got downgraded. Normally + // the "stored expression" mechanism prevents that, but + // this code here might be more than one release older + // than the cluster it runs in. + if class != nil { + return false, fmt.Errorf("class %s: selector #%d: CEL compile error: %w", class.Name, i, expr.Error) + } + return false, fmt.Errorf("claim %s: selector #%d: CEL compile error: %w", klog.KObj(alloc.claimsToAllocate[r.claimIndex]), i, expr.Error) + } + + matches, err := expr.DeviceMatches(alloc.ctx, cel.Device{Driver: deviceID.Driver, Attributes: device.Attributes, Capacity: device.Capacity}) + if class != nil { + alloc.logger.V(6).Info("CEL result", "device", deviceID, "class", klog.KObj(class), "selector", i, "expression", selector.CEL.Expression, "matches", matches, "err", err) + } else { + alloc.logger.V(6).Info("CEL result", "device", deviceID, "claim", klog.KObj(alloc.claimsToAllocate[r.claimIndex]), "selector", i, "expression", selector.CEL.Expression, "matches", matches, "err", err) + } + + if err != nil { + // TODO (future): more detailed errors which reference class resp. claim. + if class != nil { + return false, fmt.Errorf("class %s: selector #%d: CEL runtime error: %w", class.Name, i, err) + } + return false, fmt.Errorf("claim %s: selector #%d: CEL runtime error: %w", klog.KObj(alloc.claimsToAllocate[r.claimIndex]), i, err) + } + if !matches { + return false, nil + } + } + + // All of them match. + return true, nil +} + +// allocateDevice checks device availability and constraints for one +// candidate. The device must be selectable. +// +// If that candidate works out okay, the shared state gets updated +// as if that candidate had been allocated. If allocation cannot continue later +// and must try something else, then the rollback function can be invoked to +// restore the previous state. +func (alloc *allocator) allocateDevice(r deviceIndices, device *resourceapi.BasicDevice, deviceID DeviceID, must bool) (bool, func(), error) { + claim := alloc.claimsToAllocate[r.claimIndex] + request := &claim.Spec.Devices.Requests[r.requestIndex] + adminAccess := request.AdminAccess + if !adminAccess && alloc.allocated[deviceID] { + alloc.logger.V(6).Info("Device in use", "device", deviceID) + return false, nil, nil + } + + // It's available. Now check constraints. + for i, constraint := range alloc.constraints[r.claimIndex] { + added := constraint.add(request.Name, device, deviceID) + if !added { + if must { + // It does not make sense to declare a claim where a constraint prevents getting + // all devices. Treat this as an error. + return false, nil, fmt.Errorf("claim %s, request %s: cannot add device %s because a claim constraint would not be satisfied", klog.KObj(claim), request.Name, deviceID) + } + + // Roll back for all previous constraints before we return. + for e := 0; e < i; e++ { + alloc.constraints[r.claimIndex][e].remove(request.Name, device, deviceID) + } + return false, nil, nil + } + } + + // All constraints satisfied. Mark as in use (unless we do admin access) + // and record the result. + alloc.logger.V(6).Info("Device allocated", "device", deviceID) + if !adminAccess { + alloc.allocated[deviceID] = true + } + result := resourceapi.DeviceRequestAllocationResult{ + Request: request.Name, + Driver: deviceID.Driver, + Pool: deviceID.Pool, + Device: deviceID.Device, + } + previousNumResults := len(alloc.result[r.claimIndex].Devices.Results) + alloc.result[r.claimIndex].Devices.Results = append(alloc.result[r.claimIndex].Devices.Results, result) + + return true, func() { + for _, constraint := range alloc.constraints[r.claimIndex] { + constraint.remove(request.Name, device, deviceID) + } + if !adminAccess { + alloc.allocated[deviceID] = false + } + // Truncate, but keep the underlying slice. + alloc.result[r.claimIndex].Devices.Results = alloc.result[r.claimIndex].Devices.Results[:previousNumResults] + alloc.logger.V(6).Info("Device deallocated", "device", deviceID) + }, nil +} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go new file mode 100644 index 0000000000000..4e90d8ff52b32 --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/structured/allocator_test.go @@ -0,0 +1,802 @@ +/* +Copyright 2024 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. +*/ + +package structured + +import ( + "errors" + "flag" + "fmt" + "testing" + + "github.com/onsi/gomega" + "github.com/onsi/gomega/types" + + v1 "k8s.io/api/core/v1" + resourceapi "k8s.io/api/resource/v1alpha3" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog/v2/ktesting" + "k8s.io/utils/ptr" +) + +const ( + region1 = "west" + region2 = "east" + node1 = "node-1" + node2 = "node-2" + classA = "class-a" + classB = "class-b" + driverA = "driver-a" + driverB = "driver-b" + pool1 = "pool-1" + pool2 = "pool-2" + req0 = "req-0" + req1 = "req-1" + claim0 = "claim-0" + slice1 = "slice-1" + slice2 = "slice-2" + device1 = "device-1" + device2 = "device-2" +) + +func init() { + ktesting.DefaultConfig.AddFlags(flag.CommandLine) +} + +// Test objects generators + +// generate a node object given a name and a region +func node(name, region string) *v1.Node { + return &v1.Node{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Labels: map[string]string{ + "region": region, + }, + }, + } +} + +// generate a DeviceClass object with the given name and a driver CEL selector. +// driver name is assumed to be the same as the class name. +func class(name, driver string) *resourceapi.DeviceClass { + return &resourceapi.DeviceClass{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + Spec: resourceapi.DeviceClassSpec{ + Selectors: []resourceapi.DeviceSelector{ + { + CEL: &resourceapi.CELDeviceSelector{ + Expression: fmt.Sprintf(`device.driver == "%s"`, driver), + }, + }, + }, + }, + } +} + +// generate a DeviceConfiguration object with the given driver and attribute. +func deviceConfiguration(driver, attribute string) resourceapi.DeviceConfiguration { + return resourceapi.DeviceConfiguration{ + Opaque: &resourceapi.OpaqueDeviceConfiguration{ + Driver: driver, + Parameters: runtime.RawExtension{ + Raw: []byte(fmt.Sprintf("{\"%s\":\"%s\"}", attribute, attribute+"Value")), + }, + }, + } +} + +// generate a DeviceClass object with the given name and attribute. +// attribute is used to generate device configuration parameters in a form of JSON {atribute: attributeValue}. +func classWithConfig(name, driver, attribute string) *resourceapi.DeviceClass { + class := class(name, driver) + class.Spec.Config = []resourceapi.DeviceClassConfiguration{ + { + DeviceConfiguration: deviceConfiguration(driver, attribute), + }, + } + return class +} + +// generate a DeviceClass object with the given name and the node selector +// that selects nodes with the region label set to either "west" or "east". +func classWithSuitableNodes(name, driver string) *resourceapi.DeviceClass { + class := class(name, driver) + class.Spec.SuitableNodes = &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + { + MatchExpressions: []v1.NodeSelectorRequirement{ + { + Key: "region", + Operator: v1.NodeSelectorOpIn, + Values: []string{region1, region2}, + }, + }, + }, + }, + } + return class +} + +// generate a ResourceClaim object with the given name and device requests. +func claimWithRequests(name string, constraints []resourceapi.DeviceConstraint, requests ...resourceapi.DeviceRequest) *resourceapi.ResourceClaim { + return &resourceapi.ResourceClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + Spec: resourceapi.ResourceClaimSpec{ + Devices: resourceapi.DeviceClaim{ + Requests: requests, + Constraints: constraints, + }, + }, + } +} + +// generate a DeviceRequest object with the given name, class and selectors. +func request(name, class string, count int64, selectors ...resourceapi.DeviceSelector) resourceapi.DeviceRequest { + return resourceapi.DeviceRequest{ + Name: name, + Count: count, + CountMode: resourceapi.DeviceCountModeExact, + DeviceClassName: class, + Selectors: selectors, + } +} + +// generate a ResourceClaim object with the given name, request and class. +func claim(name, req, class string, constraints ...resourceapi.DeviceConstraint) *resourceapi.ResourceClaim { + claim := claimWithRequests(name, constraints, request(req, class, 1)) + return claim +} + +// generate a ResourceClaim object with the given name, request, class, and attribute. +// attribute is used to generate parameters in a form of JSON {atribute: attributeValue}. +func claimWithDeviceConfig(name, request, class, driver, attribute string) *resourceapi.ResourceClaim { + claim := claim(name, request, class) + claim.Spec.Devices.Config = []resourceapi.DeviceClaimConfiguration{ + { + DeviceConfiguration: deviceConfiguration(driver, attribute), + }, + } + return claim +} + +// generate allocated ResourceClaim object +func allocatedClaim(name, request, class string, results ...resourceapi.DeviceRequestAllocationResult) *resourceapi.ResourceClaim { + claim := claim(name, request, class) + claim.Status.Allocation = &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: results, + }, + } + return claim +} + +// generate a Device object with the given name, capacity and attributes. +func device(name string, capacity map[resourceapi.QualifiedName]resource.Quantity, attributes map[resourceapi.QualifiedName]resourceapi.DeviceAttribute) resourceapi.Device { + return resourceapi.Device{ + Name: name, + Basic: &resourceapi.BasicDevice{ + Attributes: attributes, + Capacity: capacity, + }, + } +} + +// generate a ResourceSlice object with the given name, node, +// driver and pool names, generation and a list of devices +func slice(name, node, pool, driver string, generation, count int64, selector *v1.NodeSelector, devices []resourceapi.Device) *resourceapi.ResourceSlice { + return &resourceapi.ResourceSlice{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + Spec: resourceapi.ResourceSliceSpec{ + NodeName: node, + Driver: driver, + Pool: resourceapi.ResourcePool{ + Name: pool, + ResourceSliceCount: count, + Generation: generation, + }, + Devices: devices, + NodeSelector: selector, + }, + } +} + +func deviceAllocationResult(request, driver, pool, device string) resourceapi.DeviceRequestAllocationResult { + return resourceapi.DeviceRequestAllocationResult{ + Request: request, + Driver: driver, + Pool: pool, + Device: device, + } +} + +func allocationResults(results ...resourceapi.DeviceRequestAllocationResult) *resourceapi.AllocationResult { + return &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: results, + }, + } +} + +func allocationResultsWithConfig(driver string, source resourceapi.AllocationConfigSource, attribute string, results ...resourceapi.DeviceRequestAllocationResult) *resourceapi.AllocationResult { + return &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: results, + Config: []resourceapi.DeviceAllocationConfiguration{ + { + Source: source, + DeviceConfiguration: deviceConfiguration(driver, attribute), + }, + }, + }, + } +} + +// Helpers + +// convert a list of objects to a slice +func objects[T any](objs ...T) []T { + return objs +} + +// generate a ResourceSlice object with the given parameters and one device "device-1" +func sliceWithOneDevice(name, node, pool, driver string, generation, count int64) *resourceapi.ResourceSlice { + return slice(name, node, pool, driver, generation, count, nil, []resourceapi.Device{ + device(device1, nil, nil), + }) +} + +func TestAllocator(t *testing.T) { + nonExistentAttribute := resourceapi.FullyQualifiedName("NonExistentAttribute") + boolAttribute := resourceapi.FullyQualifiedName("boolAttribute") + stringAttribute := resourceapi.FullyQualifiedName("stringAttribute") + versionAttribute := resourceapi.FullyQualifiedName("driverVersion") + intAttribute := resourceapi.FullyQualifiedName("numa") + + testcases := map[string]struct { + claimsToAllocate []*resourceapi.ResourceClaim + allocatedClaims []*resourceapi.ResourceClaim + classes []*resourceapi.DeviceClass + slices []*resourceapi.ResourceSlice + node *v1.Node + + expectResults []any + expectError types.GomegaMatcher // can be used to check for no error or match specific error types + }{ + + "empty": {}, + "simple": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + )}, + }, + "other-node": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(class(classA, driverA)), + slices: objects( + sliceWithOneDevice(slice1, node1, pool1, driverB, 1, 1), + sliceWithOneDevice(slice2, node2, pool2, driverA, 1, 1), + ), + node: node(node2, region2), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool2, device1), + )}, + }, + "small-and-large": { + claimsToAllocate: objects(claimWithRequests( + claim0, + nil, + request(req0, classA, 1, resourceapi.DeviceSelector{ + CEL: &resourceapi.CELDeviceSelector{ + Expression: fmt.Sprintf(`device.capacity["%s"].memory.compareTo(quantity("1Gi")) >= 0`, driverA), + }}), + request(req1, classA, 1, resourceapi.DeviceSelector{ + CEL: &resourceapi.CELDeviceSelector{ + Expression: fmt.Sprintf(`device.capacity["%s"].memory.compareTo(quantity("2Gi")) >= 0`, driverA), + }}), + )), + classes: objects(class(classA, driverA)), + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, map[resourceapi.QualifiedName]resource.Quantity{ + "memory": resource.MustParse("1Gi"), + }, nil), + device(device2, map[resourceapi.QualifiedName]resource.Quantity{ + "memory": resource.MustParse("2Gi"), + }, nil), + })), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + deviceAllocationResult(req1, driverA, pool1, device2), + )}, + }, + "small-and-large-backtrack": { + claimsToAllocate: objects(claimWithRequests( + claim0, + nil, + request(req0, classA, 1, resourceapi.DeviceSelector{ + CEL: &resourceapi.CELDeviceSelector{ + Expression: fmt.Sprintf(`device.capacity["%s"].memory.compareTo(quantity("1Gi")) >= 0`, driverA), + }}), + request(req1, classA, 1, resourceapi.DeviceSelector{ + CEL: &resourceapi.CELDeviceSelector{ + Expression: fmt.Sprintf(`device.capacity["%s"].memory.compareTo(quantity("2Gi")) >= 0`, driverA), + }}), + )), + classes: objects(class(classA, driverA)), + // Reversing the order in which the devices are listed causes the "large" device to + // be allocated for the "small" request, leaving the "large" request unsatisfied. + // The initial decision needs to be undone before a solution is found. + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device2, map[resourceapi.QualifiedName]resource.Quantity{ + "memory": resource.MustParse("2Gi"), + }, nil), + device(device1, map[resourceapi.QualifiedName]resource.Quantity{ + "memory": resource.MustParse("1Gi"), + }, nil), + })), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + deviceAllocationResult(req1, driverA, pool1, device2), + )}, + }, + "devices-split-across-different-slices": { + claimsToAllocate: objects(claimWithRequests(claim0, nil, resourceapi.DeviceRequest{ + Name: req0, + Count: 2, + CountMode: resourceapi.DeviceCountModeExact, + DeviceClassName: classA, + })), + classes: objects(class(classA, driverA)), + slices: objects( + sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1), + sliceWithOneDevice(slice2, node1, pool2, driverA, 1, 1), + ), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + deviceAllocationResult(req0, driverA, pool2, device1), + )}, + }, + "obsolete-slice": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(class(classA, driverA)), + slices: objects( + sliceWithOneDevice("slice-1-obsolete", node1, pool1, driverA, 1, 1), + sliceWithOneDevice(slice1, node1, pool1, driverA, 2, 1)), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + )}, + }, + "no-slices": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(class(classA, driverA)), + slices: nil, + node: node(node1, region1), + + expectResults: nil, + }, + "not-enough-suitable-devices": { + claimsToAllocate: objects(claim(claim0, req0, classA), claim(claim0, req1, classA)), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + + node: node(node1, region1), + + expectResults: nil, + }, + "no-classes": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: nil, + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + expectError: gomega.MatchError(gomega.ContainSubstring("could not retrieve device class class-a")), + }, + "unknown-class": { + claimsToAllocate: objects(claim(claim0, req0, "unknown-class")), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + expectError: gomega.MatchError(gomega.ContainSubstring("could not retrieve device class unknown-class")), + }, + "empty-class": { + claimsToAllocate: objects(claim(claim0, req0, "")), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + expectError: gomega.MatchError(gomega.ContainSubstring("claim claim-0, request req-0: unsupported request type")), + }, + "no-claims-to-allocate": { + claimsToAllocate: nil, + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + }, + "all-devices": { + claimsToAllocate: objects(claimWithRequests(claim0, nil, resourceapi.DeviceRequest{ + Name: req0, + CountMode: resourceapi.DeviceCountModeAll, + Count: 1, + DeviceClassName: classA, + })), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + )}, + }, + "all-devices-of-the-incomplete-pool": { + claimsToAllocate: objects(claimWithRequests(claim0, nil, resourceapi.DeviceRequest{ + Name: req0, + CountMode: resourceapi.DeviceCountModeAll, + Count: 1, + DeviceClassName: classA, + })), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 2)), //node1IncompletePoolSlice), + node: node(node1, region1), + + expectResults: nil, + expectError: gomega.MatchError(gomega.ContainSubstring("claim claim-0, request req-0: asks for all devices, but resource pool driver-a/pool-1 is currently being updated")), + }, + "network-attached-device-with-class.SuitableNodes": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(classWithSuitableNodes(classA, driverA)), + slices: objects(slice(slice1, "", pool1, driverA, 1, 1, + &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + { + MatchExpressions: []v1.NodeSelectorRequirement{ + { + Key: "region", + Operator: v1.NodeSelectorOpIn, + Values: []string{region1}, + }, + }, + }, + }, + }, + []resourceapi.Device{ + device(device1, nil, nil), + device(device2, nil, nil), + })), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + )}, + }, + "network-attached-device-without-class.SuitableNodes": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + )}, + }, + "unsuccessful-allocation-network-attached-device-with-class.SuitableNodes": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(classWithSuitableNodes(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + }, + "unsuccessful-allocation-network-attached-device-without-class.SuitableNodes": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node2, region2), + + expectResults: nil, + }, + "several-different-drivers": { + claimsToAllocate: objects(claim(claim0, req0, classA), claim(claim0, req0, classB)), + classes: objects(class(classA, driverA), class(classB, driverB)), + slices: objects( + slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, nil, nil), + device(device2, nil, nil), + }), + sliceWithOneDevice(slice1, node1, pool1, driverB, 1, 1), + ), + node: node(node1, region1), + + expectResults: []any{ + allocationResults(deviceAllocationResult(req0, driverA, pool1, device1)), + allocationResults(deviceAllocationResult(req0, driverB, pool1, device1)), + }, + }, + "already-allocated-devices": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + allocatedClaims: objects( + allocatedClaim(claim0, req0, classA, + deviceAllocationResult(req0, driverA, pool1, device1), + deviceAllocationResult(req1, driverA, pool1, device2), + ), + ), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + }, + "with-constraint": { + claimsToAllocate: objects(claimWithRequests( + claim0, + []resourceapi.DeviceConstraint{ + {MatchAttribute: &intAttribute}, + {MatchAttribute: &versionAttribute}, + {MatchAttribute: &stringAttribute}, + {MatchAttribute: &boolAttribute}, + }, + request(req0, classA, 1), + request(req1, classA, 1), + ), + ), + classes: objects(class(classA, driverA)), + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "driverVersion": {VersionValue: ptr.To("1.0.0")}, + "numa": {IntValue: ptr.To(int64(1))}, + "stringAttribute": {StringValue: ptr.To("stringAttributeValue")}, + "boolAttribute": {BoolValue: ptr.To(true)}, + }), + device(device2, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "driverVersion": {VersionValue: ptr.To("1.0.0")}, + "numa": {IntValue: ptr.To(int64(1))}, + "stringAttribute": {StringValue: ptr.To("stringAttributeValue")}, + "boolAttribute": {BoolValue: ptr.To(true)}, + }), + })), + node: node(node1, region1), + + expectResults: []any{allocationResults( + deviceAllocationResult(req0, driverA, pool1, device1), + deviceAllocationResult(req1, driverA, pool1, device2), + )}, + }, + "with-constraint-non-existent-attribute": { + claimsToAllocate: objects(claim(claim0, req0, classA, resourceapi.DeviceConstraint{ + MatchAttribute: &nonExistentAttribute, + })), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: nil, + }, + "with-constraint-not-matching-int-attribute": { + claimsToAllocate: objects(claimWithRequests( + claim0, + []resourceapi.DeviceConstraint{{MatchAttribute: &intAttribute}}, + request(req0, classA, 3)), + ), + classes: objects(class(classA, driverA), class(classB, driverB)), + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "numa": {IntValue: ptr.To(int64(1))}, + }), + device(device2, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "numa": {IntValue: ptr.To(int64(2))}, + }), + })), + node: node(node1, region1), + + expectResults: nil, + }, + "with-constraint-not-matching-version-attribute": { + claimsToAllocate: objects(claimWithRequests( + claim0, + []resourceapi.DeviceConstraint{{MatchAttribute: &versionAttribute}}, + request(req0, classA, 3)), + ), + classes: objects(class(classA, driverA), class(classB, driverB)), + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "driverVersion": {VersionValue: ptr.To("1.0.0")}, + }), + device(device2, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "driverVersion": {VersionValue: ptr.To("2.0.0")}, + }), + })), + node: node(node1, region1), + + expectResults: nil, + }, + "with-constraint-not-matching-string-attribute": { + claimsToAllocate: objects(claimWithRequests( + claim0, + []resourceapi.DeviceConstraint{{MatchAttribute: &stringAttribute}}, + request(req0, classA, 3)), + ), + classes: objects(class(classA, driverA), class(classB, driverB)), + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "stringAttribute": {StringValue: ptr.To("stringAttributeValue")}, + }), + device(device2, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "stringAttribute": {StringValue: ptr.To("stringAttributeValue2")}, + }), + })), + node: node(node1, region1), + + expectResults: nil, + }, + "with-constraint-not-matching-bool-attribute": { + claimsToAllocate: objects(claimWithRequests( + claim0, + []resourceapi.DeviceConstraint{{MatchAttribute: &boolAttribute}}, + request(req0, classA, 3)), + ), + classes: objects(class(classA, driverA), class(classB, driverB)), + slices: objects(slice(slice1, node1, pool1, driverA, 1, 1, nil, []resourceapi.Device{ + device(device1, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "boolAttribute": {BoolValue: ptr.To(true)}, + }), + device(device2, nil, map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + "boolAttribute": {BoolValue: ptr.To(false)}, + }), + })), + node: node(node1, region1), + + expectResults: nil, + }, + "with-class-device-config": { + claimsToAllocate: objects(claim(claim0, req0, classA)), + classes: objects(classWithConfig(classA, driverA, "classAttribute")), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: []any{ + allocationResultsWithConfig( + driverA, + resourceapi.AllocationConfigSourceClass, + "classAttribute", + deviceAllocationResult(req0, driverA, pool1, device1), + ), + }, + }, + "claim-with-device-config": { + claimsToAllocate: objects(claimWithDeviceConfig(claim0, req0, classA, driverA, "deviceAttribute")), + classes: objects(class(classA, driverA)), + slices: objects(sliceWithOneDevice(slice1, node1, pool1, driverA, 1, 1)), + node: node(node1, region1), + + expectResults: []any{ + allocationResultsWithConfig( + driverA, + resourceapi.AllocationConfigSourceClaim, + "deviceAttribute", + deviceAllocationResult(req0, driverA, pool1, device1), + ), + }, + }, + } + + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + _, ctx := ktesting.NewTestContext(t) + g := gomega.NewWithT(t) + + // Listing objects is deterministic and returns them in the same + // order as in the test case. That makes the allocation result + // also deterministic. + var allocated, toAllocate claimLister + var classLister informerLister[resourceapi.DeviceClass] + var sliceLister informerLister[resourceapi.ResourceSlice] + for _, claim := range tc.claimsToAllocate { + toAllocate.claims = append(toAllocate.claims, claim.DeepCopy()) + } + for _, claim := range tc.allocatedClaims { + allocated.claims = append(allocated.claims, claim.DeepCopy()) + } + for _, slice := range tc.slices { + sliceLister.objs = append(sliceLister.objs, slice.DeepCopy()) + } + for _, class := range tc.classes { + classLister.objs = append(classLister.objs, class.DeepCopy()) + } + + allocator, err := NewAllocator(ctx, toAllocate.claims, allocated, classLister, sliceLister) + g.Expect(err).ToNot(gomega.HaveOccurred()) + + results, err := allocator.Allocate(ctx, tc.node) + matchError := tc.expectError + if matchError == nil { + matchError = gomega.Not(gomega.HaveOccurred()) + } + g.Expect(err).To(matchError) + g.Expect(results).To(gomega.HaveExactElements(tc.expectResults...)) + + // Objects that the allocator had access to should not have been modified. + g.Expect(toAllocate.claims).To(gomega.HaveExactElements(tc.claimsToAllocate)) + g.Expect(allocated.claims).To(gomega.HaveExactElements(tc.allocatedClaims)) + g.Expect(sliceLister.objs).To(gomega.ConsistOf(tc.slices)) + g.Expect(classLister.objs).To(gomega.ConsistOf(tc.classes)) + }) + } +} + +type claimLister struct { + claims []*resourceapi.ResourceClaim + err error +} + +func (l claimLister) ListAllAllocated() ([]*resourceapi.ResourceClaim, error) { + return l.claims, l.err +} + +type informerLister[T any] struct { + objs []*T + err error +} + +func (l informerLister[T]) List(selector labels.Selector) (ret []*T, err error) { + if selector.String() != labels.Everything().String() { + return nil, errors.New("labels selector not implemented") + } + return l.objs, l.err +} + +func (l informerLister[T]) Get(name string) (*T, error) { + for _, obj := range l.objs { + accessor, err := meta.Accessor(obj) + if err != nil { + return nil, err + } + if accessor.GetName() == name { + return obj, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "not found") +} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/doc.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/doc.go new file mode 100644 index 0000000000000..ed9a2ae7e0d2f --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/structured/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2024 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. +*/ + +// Package structured contains code for working with structured parameters. +package structured diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/compile.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/compile.go deleted file mode 100644 index d4beb0ce69890..0000000000000 --- a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/compile.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package cel - -import ( - "context" - "fmt" - "reflect" - - "github.com/blang/semver/v4" - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/traits" - - resourceapi "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/util/version" - celconfig "k8s.io/apiserver/pkg/apis/cel" - apiservercel "k8s.io/apiserver/pkg/cel" - "k8s.io/apiserver/pkg/cel/environment" -) - -const ( - attributesVarPrefix = "attributes." -) - -var ( - Compiler = newCompiler() -) - -// CompilationResult represents a compiled expression. -type CompilationResult struct { - Program cel.Program - Error *apiservercel.Error - Expression string - OutputType *cel.Type - Environment *cel.Env -} - -type compiler struct { - envset *environment.EnvSet -} - -func newCompiler() *compiler { - return &compiler{envset: mustBuildEnv()} -} - -// CompileCELExpression returns a compiled CEL expression. It evaluates to bool. -func (c compiler) CompileCELExpression(expression string, envType environment.Type) CompilationResult { - resultError := func(errorString string, errType apiservercel.ErrorType) CompilationResult { - return CompilationResult{ - Error: &apiservercel.Error{ - Type: errType, - Detail: errorString, - }, - Expression: expression, - } - } - - env, err := c.envset.Env(envType) - if err != nil { - return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal) - } - - ast, issues := env.Compile(expression) - if issues != nil { - return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid) - } - expectedReturnType := cel.BoolType - if ast.OutputType() != expectedReturnType { - return resultError(fmt.Sprintf("must evaluate to %v", expectedReturnType.String()), apiservercel.ErrorTypeInvalid) - } - _, err = cel.AstToCheckedExpr(ast) - if err != nil { - // should be impossible since env.Compile returned no issues - return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal) - } - prog, err := env.Program(ast, - cel.InterruptCheckFrequency(celconfig.CheckFrequency), - ) - if err != nil { - return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal) - } - return CompilationResult{ - Program: prog, - Expression: expression, - OutputType: ast.OutputType(), - Environment: env, - } -} - -var valueTypes = map[string]struct { - celType *cel.Type - // get returns nil if the attribute doesn't have the type, otherwise - // the value of that type. - get func(attr resourceapi.NamedResourcesAttribute) (any, error) -}{ - "quantity": {apiservercel.QuantityType, func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.QuantityValue == nil { - return nil, nil - } - return apiservercel.Quantity{Quantity: attr.QuantityValue}, nil - }}, - "bool": {cel.BoolType, func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.BoolValue == nil { - return nil, nil - } - return *attr.BoolValue, nil - }}, - "int": {cel.IntType, func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.IntValue == nil { - return nil, nil - } - return *attr.IntValue, nil - }}, - "intslice": {types.NewListType(cel.IntType), func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.IntSliceValue == nil { - return nil, nil - } - return attr.IntSliceValue.Ints, nil - }}, - "string": {cel.StringType, func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.StringValue == nil { - return nil, nil - } - return *attr.StringValue, nil - }}, - "stringslice": {types.NewListType(cel.StringType), func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.StringSliceValue == nil { - return nil, nil - } - return attr.StringSliceValue.Strings, nil - }}, - "version": {SemverType, func(attr resourceapi.NamedResourcesAttribute) (any, error) { - if attr.VersionValue == nil { - return nil, nil - } - v, err := semver.Parse(*attr.VersionValue) - if err != nil { - return nil, fmt.Errorf("parse semantic version: %v", err) - } - - return Semver{Version: v}, nil - }}, -} - -var boolType = reflect.TypeOf(true) - -func (c CompilationResult) Evaluate(ctx context.Context, attributes []resourceapi.NamedResourcesAttribute) (bool, error) { - variables := make(map[string]any, len(valueTypes)) - for name, valueType := range valueTypes { - m, err := buildValueMapper(c.Environment.CELTypeAdapter(), attributes, valueType.get) - if err != nil { - return false, fmt.Errorf("extract attributes with type %s: %v", name, err) - } - variables[attributesVarPrefix+name] = m - } - result, _, err := c.Program.ContextEval(ctx, variables) - if err != nil { - return false, err - } - resultAny, err := result.ConvertToNative(boolType) - if err != nil { - return false, fmt.Errorf("CEL result of type %s could not be converted to bool: %w", result.Type().TypeName(), err) - } - resultBool, ok := resultAny.(bool) - if !ok { - return false, fmt.Errorf("CEL native result value should have been a bool, got instead: %T", resultAny) - } - return resultBool, nil -} - -func mustBuildEnv() *environment.EnvSet { - // strictCost is always true to enforce cost limits. - envset := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true) - versioned := []environment.VersionedOptions{ - { - // Feature epoch was actually 1.30, but we artificially set it to 1.0 because these - // options should always be present. - // - // TODO (https://github.com/kubernetes/kubernetes/issues/123687): set this - // version properly before going to beta. - IntroducedVersion: version.MajorMinor(1, 0), - EnvOptions: append(buildVersionedAttributes(), - SemverLib(), - ), - }, - } - envset, err := envset.Extend(versioned...) - if err != nil { - panic(fmt.Errorf("internal error building CEL environment: %w", err)) - } - return envset -} - -func buildVersionedAttributes() []cel.EnvOption { - options := make([]cel.EnvOption, 0, len(valueTypes)) - for name, valueType := range valueTypes { - options = append(options, cel.Variable(attributesVarPrefix+name, types.NewMapType(cel.StringType, valueType.celType))) - } - return options -} - -func buildValueMapper(adapter types.Adapter, attributes []resourceapi.NamedResourcesAttribute, get func(resourceapi.NamedResourcesAttribute) (any, error)) (traits.Mapper, error) { - // This implementation constructs a map and then let's cel handle the - // lookup and iteration. This is done for the sake of simplicity. - // Whether it's faster than writing a custom mapper depends on - // real-world attribute sets and CEL expressions and would have to be - // benchmarked. - valueMap := make(map[string]any) - for name, attribute := range attributes { - value, err := get(attribute) - if err != nil { - return nil, fmt.Errorf("attribute %q: %v", name, err) - } - if value != nil { - valueMap[attribute.Name] = value - } - } - return types.NewStringInterfaceMap(adapter, valueMap), nil -} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/compile_test.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/compile_test.go deleted file mode 100644 index bea913c81fc52..0000000000000 --- a/staging/src/k8s.io/dynamic-resource-allocation/structured/namedresources/cel/compile_test.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2022 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. -*/ - -package cel - -import ( - "strings" - "testing" - - resourceapi "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apiserver/pkg/cel/environment" - "k8s.io/klog/v2/ktesting" - "k8s.io/utils/ptr" -) - -func TestCompile(t *testing.T) { - for name, scenario := range map[string]struct { - expression string - attributes []resourceapi.NamedResourcesAttribute - expectCompileError string - expectMatchError string - expectMatch bool - }{ - "true": { - expression: "true", - expectMatch: true, - }, - "false": { - expression: "false", - expectMatch: false, - }, - "syntax-error": { - expression: "?!", - expectCompileError: "Syntax error", - }, - "type-error": { - expression: `attributes.quantity["no-such-attr"]`, - expectCompileError: "must evaluate to bool", - }, - "runtime-error": { - expression: `attributes.quantity["no-such-attr"].isGreaterThan(quantity("0"))`, - expectMatchError: "no such key: no-such-attr", - }, - "quantity": { - expression: `attributes.quantity["name"].isGreaterThan(quantity("0"))`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{QuantityValue: ptr.To(resource.MustParse("1"))}}}, - expectMatch: true, - }, - "bool": { - expression: `attributes.bool["name"]`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true)}}}, - expectMatch: true, - }, - "int": { - expression: `attributes.int["name"] > 0`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntValue: ptr.To(int64(1))}}}, - expectMatch: true, - }, - "intslice": { - expression: `attributes.intslice["name"].isSorted() && attributes.intslice["name"].indexOf(3) == 2`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntSliceValue: &resourceapi.NamedResourcesIntSlice{Ints: []int64{1, 2, 3}}}}}, - expectMatch: true, - }, - "empty-intslice": { - expression: `size(attributes.intslice["name"]) == 0`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntSliceValue: &resourceapi.NamedResourcesIntSlice{}}}}, - expectMatch: true, - }, - "string": { - expression: `attributes.string["name"] == "fish"`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringValue: ptr.To("fish")}}}, - expectMatch: true, - }, - "stringslice": { - expression: `attributes.stringslice["name"].isSorted() && attributes.stringslice["name"].indexOf("a") == 0`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringSliceValue: &resourceapi.NamedResourcesStringSlice{Strings: []string{"a", "b", "c"}}}}}, - expectMatch: true, - }, - "empty-stringslice": { - expression: `size(attributes.stringslice["name"]) == 0`, - attributes: []resourceapi.NamedResourcesAttribute{{Name: "name", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringSliceValue: &resourceapi.NamedResourcesStringSlice{}}}}, - expectMatch: true, - }, - "all": { - expression: `attributes.quantity["quantity"].isGreaterThan(quantity("0")) && -attributes.bool["bool"] && -attributes.int["int"] > 0 && -attributes.intslice["intslice"].isSorted() && -attributes.string["string"] == "fish" && -attributes.stringslice["stringslice"].isSorted()`, - attributes: []resourceapi.NamedResourcesAttribute{ - {Name: "quantity", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{QuantityValue: ptr.To(resource.MustParse("1"))}}, - {Name: "bool", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true)}}, - {Name: "int", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntValue: ptr.To(int64(1))}}, - {Name: "intslice", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{IntSliceValue: &resourceapi.NamedResourcesIntSlice{Ints: []int64{1, 2, 3}}}}, - {Name: "string", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringValue: ptr.To("fish")}}, - {Name: "stringslice", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{StringSliceValue: &resourceapi.NamedResourcesStringSlice{Strings: []string{"a", "b", "c"}}}}, - }, - expectMatch: true, - }, - "many": { - expression: `attributes.bool["a"] && attributes.bool["b"] && attributes.bool["c"]`, - attributes: []resourceapi.NamedResourcesAttribute{ - {Name: "a", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true)}}, - {Name: "b", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true)}}, - {Name: "c", NamedResourcesAttributeValue: resourceapi.NamedResourcesAttributeValue{BoolValue: ptr.To(true)}}, - }, - expectMatch: true, - }, - } { - t.Run(name, func(t *testing.T) { - _, ctx := ktesting.NewTestContext(t) - result := Compiler.CompileCELExpression(scenario.expression, environment.StoredExpressions) - if scenario.expectCompileError != "" && result.Error == nil { - t.Fatalf("expected compile error %q, got none", scenario.expectCompileError) - } - if result.Error != nil { - if scenario.expectCompileError == "" { - t.Fatalf("unexpected compile error: %v", result.Error) - } - if !strings.Contains(result.Error.Error(), scenario.expectCompileError) { - t.Fatalf("expected compile error to contain %q, but got instead: %v", scenario.expectCompileError, result.Error) - } - return - } - match, err := result.Evaluate(ctx, scenario.attributes) - if err != nil { - if scenario.expectMatchError == "" { - t.Fatalf("unexpected evaluation error: %v", err) - } - if !strings.Contains(err.Error(), scenario.expectMatchError) { - t.Fatalf("expected evaluation error to contain %q, but got instead: %v", scenario.expectMatchError, err) - } - return - } - if match != scenario.expectMatch { - t.Fatalf("expected result %v, got %v", scenario.expectMatch, match) - } - }) - } -} diff --git a/staging/src/k8s.io/dynamic-resource-allocation/structured/pools.go b/staging/src/k8s.io/dynamic-resource-allocation/structured/pools.go new file mode 100644 index 0000000000000..4c1f8e68bbb9f --- /dev/null +++ b/staging/src/k8s.io/dynamic-resource-allocation/structured/pools.go @@ -0,0 +1,131 @@ +/* +Copyright 2024 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. +*/ + +package structured + +import ( + "context" + "fmt" + + v1 "k8s.io/api/core/v1" + resourceapi "k8s.io/api/resource/v1alpha3" + "k8s.io/apimachinery/pkg/labels" + resourcelisters "k8s.io/client-go/listers/resource/v1alpha3" + "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" +) + +// GatherPools collects information about all resource pools which provide +// devices that are accessible from the given node. +// +// Out-dated slices are silently ignored. Pools may be incomplete, which is +// recorded in the result. +func GatherPools(ctx context.Context, sliceLister resourcelisters.ResourceSliceLister, node *v1.Node) ([]*Pool, error) { + pools := make(map[PoolID]*Pool) + + // TODO (future): use a custom lister interface and implement it with + // and indexer on the node name field. Then here we can ask for only + // slices with the right node name and those with no node name. + slices, err := sliceLister.List(labels.Everything()) + if err != nil { + return nil, fmt.Errorf("list resource slices: %w", err) + } + for _, slice := range slices { + switch { + case slice.Spec.NodeName != "": + if slice.Spec.NodeName == node.Name { + addSlice(pools, slice) + } + case slice.Spec.AllNodes: + addSlice(pools, slice) + case slice.Spec.NodeSelector != nil: + selector, err := nodeaffinity.NewNodeSelector(slice.Spec.NodeSelector) + if err != nil { + return nil, fmt.Errorf("node selector in resource slice %s: %w", slice.Name, err) + } + if selector.Match(node) { + addSlice(pools, slice) + } + default: + // Nothing known was set. This must be some future, unknown extension, + // so we don't know how to handle it. We may still be able to allocated from + // other pools, so we continue. + // + // TODO (eventually): let caller decide how to report this to the user. Warning + // about it for every slice on each scheduling attempt would be too noisy, but + // perhaps once per run would be useful? + continue + } + + } + + // Find incomplete pools and flatten into a single slice. + result := make([]*Pool, 0, len(pools)) + for _, pool := range pools { + pool.IsIncomplete = int64(len(pool.Slices)) != pool.Slices[0].Spec.Pool.ResourceSliceCount + result = append(result, pool) + } + + return result, nil +} + +func addSlice(pools map[PoolID]*Pool, slice *resourceapi.ResourceSlice) { + id := PoolID{Driver: slice.Spec.Driver, Pool: slice.Spec.Pool.Name} + pool := pools[id] + if pool == nil { + // New pool. + pool = &Pool{ + PoolID: id, + Slices: []*resourceapi.ResourceSlice{slice}, + } + pools[id] = pool + return + } + + if slice.Spec.Pool.Generation < pool.Slices[0].Spec.Pool.Generation { + // Out-dated. + return + } + + if slice.Spec.Pool.Generation > pool.Slices[0].Spec.Pool.Generation { + // Newer, replaces all old slices. + pool.Slices = []*resourceapi.ResourceSlice{slice} + } + + // Add to pool. + pool.Slices = append(pool.Slices, slice) +} + +type Pool struct { + PoolID + IsIncomplete bool + Slices []*resourceapi.ResourceSlice +} + +type PoolID struct { + Driver, Pool string +} + +func (p PoolID) String() string { + return p.Driver + "/" + p.Pool +} + +type DeviceID struct { + Driver, Pool, Device string +} + +func (d DeviceID) String() string { + return d.Driver + "/" + d.Pool + "/" + d.Device +} diff --git a/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.pb.go b/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.pb.go similarity index 77% rename from staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.pb.go rename to staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.pb.go index c0972a59bcdc2..04d0562c0e407 100644 --- a/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.pb.go +++ b/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.pb.go @@ -17,7 +17,7 @@ limitations under the License. // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: api.proto -package v1alpha3 +package v1alpha4 import ( context "context" @@ -29,7 +29,6 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" - v1alpha2 "k8s.io/api/resource/v1alpha2" math "math" math_bits "math/bits" reflect "reflect" @@ -146,9 +145,10 @@ func (m *NodePrepareResourcesResponse) GetClaims() map[string]*NodePrepareResour type NodePrepareResourceResponse struct { // These are the additional devices that kubelet must - // make available via the container runtime. A resource + // make available via the container runtime. A claim + // may have zero or more requests and each request // may have zero or more devices. - CDIDevices []string `protobuf:"bytes,1,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` + Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` // If non-empty, preparing the ResourceClaim failed. // cdi_devices is ignored in that case. Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` @@ -188,9 +188,9 @@ func (m *NodePrepareResourceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_NodePrepareResourceResponse proto.InternalMessageInfo -func (m *NodePrepareResourceResponse) GetCDIDevices() []string { +func (m *NodePrepareResourceResponse) GetDevices() []*Device { if m != nil { - return m.CDIDevices + return m.Devices } return nil } @@ -202,6 +202,81 @@ func (m *NodePrepareResourceResponse) GetError() string { return "" } +type Device struct { + // The requests in the claim that this device is associated with. + // Optional. If empty, the device is associated with all requests. + RequestNames []string `protobuf:"bytes,1,rep,name=request_names,json=requestNames,proto3" json:"request_names,omitempty"` + // The pool which contains the device. Required. + PoolName string `protobuf:"bytes,2,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` + // The device itself. Required. + DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` + // A single device instance may map to several CDI device IDs. + // None is also valid. + CDIDeviceIDs []string `protobuf:"bytes,4,rep,name=cdi_device_ids,json=cdiDeviceIds,proto3" json:"cdi_device_ids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Device) Reset() { *m = Device{} } +func (*Device) ProtoMessage() {} +func (*Device) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} +func (m *Device) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Device.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Device) XXX_Merge(src proto.Message) { + xxx_messageInfo_Device.Merge(m, src) +} +func (m *Device) XXX_Size() int { + return m.Size() +} +func (m *Device) XXX_DiscardUnknown() { + xxx_messageInfo_Device.DiscardUnknown(m) +} + +var xxx_messageInfo_Device proto.InternalMessageInfo + +func (m *Device) GetRequestNames() []string { + if m != nil { + return m.RequestNames + } + return nil +} + +func (m *Device) GetPoolName() string { + if m != nil { + return m.PoolName + } + return "" +} + +func (m *Device) GetDeviceName() string { + if m != nil { + return m.DeviceName + } + return "" +} + +func (m *Device) GetCDIDeviceIDs() []string { + if m != nil { + return m.CDIDeviceIDs + } + return nil +} + type NodeUnprepareResourcesRequest struct { // The list of ResourceClaims that are to be unprepared. Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` @@ -212,7 +287,7 @@ type NodeUnprepareResourcesRequest struct { func (m *NodeUnprepareResourcesRequest) Reset() { *m = NodeUnprepareResourcesRequest{} } func (*NodeUnprepareResourcesRequest) ProtoMessage() {} func (*NodeUnprepareResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} + return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *NodeUnprepareResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -260,7 +335,7 @@ type NodeUnprepareResourcesResponse struct { func (m *NodeUnprepareResourcesResponse) Reset() { *m = NodeUnprepareResourcesResponse{} } func (*NodeUnprepareResourcesResponse) ProtoMessage() {} func (*NodeUnprepareResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} + return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *NodeUnprepareResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -306,7 +381,7 @@ type NodeUnprepareResourceResponse struct { func (m *NodeUnprepareResourceResponse) Reset() { *m = NodeUnprepareResourceResponse{} } func (*NodeUnprepareResourceResponse) ProtoMessage() {} func (*NodeUnprepareResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} + return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *NodeUnprepareResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -342,88 +417,6 @@ func (m *NodeUnprepareResourceResponse) GetError() string { return "" } -type NodeListAndWatchResourcesRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeListAndWatchResourcesRequest) Reset() { *m = NodeListAndWatchResourcesRequest{} } -func (*NodeListAndWatchResourcesRequest) ProtoMessage() {} -func (*NodeListAndWatchResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{6} -} -func (m *NodeListAndWatchResourcesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeListAndWatchResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeListAndWatchResourcesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeListAndWatchResourcesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeListAndWatchResourcesRequest.Merge(m, src) -} -func (m *NodeListAndWatchResourcesRequest) XXX_Size() int { - return m.Size() -} -func (m *NodeListAndWatchResourcesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodeListAndWatchResourcesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeListAndWatchResourcesRequest proto.InternalMessageInfo - -type NodeListAndWatchResourcesResponse struct { - Resources []*v1alpha2.ResourceModel `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeListAndWatchResourcesResponse) Reset() { *m = NodeListAndWatchResourcesResponse{} } -func (*NodeListAndWatchResourcesResponse) ProtoMessage() {} -func (*NodeListAndWatchResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{7} -} -func (m *NodeListAndWatchResourcesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeListAndWatchResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeListAndWatchResourcesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeListAndWatchResourcesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeListAndWatchResourcesResponse.Merge(m, src) -} -func (m *NodeListAndWatchResourcesResponse) XXX_Size() int { - return m.Size() -} -func (m *NodeListAndWatchResourcesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NodeListAndWatchResourcesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeListAndWatchResourcesResponse proto.InternalMessageInfo - -func (m *NodeListAndWatchResourcesResponse) GetResources() []*v1alpha2.ResourceModel { - if m != nil { - return m.Resources - } - return nil -} - type Claim struct { // The ResourceClaim namespace (ResourceClaim.meta.Namespace). // This field is REQUIRED. @@ -433,24 +426,15 @@ type Claim struct { Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Resource handle (AllocationResult.ResourceHandles[*].Data) - // This field is REQUIRED. - ResourceHandle string `protobuf:"bytes,4,opt,name=resource_handle,json=resourceHandle,proto3" json:"resource_handle,omitempty"` - // Structured parameter resource handle (AllocationResult.ResourceHandles[*].StructuredData). - // This field is OPTIONAL. If present, it needs to be used - // instead of resource_handle. It will only have a single entry. - // - // Using "repeated" instead of "optional" is a workaround for https://github.com/gogo/protobuf/issues/713. - StructuredResourceHandle []*v1alpha2.StructuredResourceHandle `protobuf:"bytes,5,rep,name=structured_resource_handle,json=structuredResourceHandle,proto3" json:"structured_resource_handle,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Claim) Reset() { *m = Claim{} } func (*Claim) ProtoMessage() {} func (*Claim) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{8} + return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *Claim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -500,78 +484,58 @@ func (m *Claim) GetName() string { return "" } -func (m *Claim) GetResourceHandle() string { - if m != nil { - return m.ResourceHandle - } - return "" -} - -func (m *Claim) GetStructuredResourceHandle() []*v1alpha2.StructuredResourceHandle { - if m != nil { - return m.StructuredResourceHandle - } - return nil -} - func init() { proto.RegisterType((*NodePrepareResourcesRequest)(nil), "v1alpha3.NodePrepareResourcesRequest") proto.RegisterType((*NodePrepareResourcesResponse)(nil), "v1alpha3.NodePrepareResourcesResponse") proto.RegisterMapType((map[string]*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourcesResponse.ClaimsEntry") proto.RegisterType((*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourceResponse") + proto.RegisterType((*Device)(nil), "v1alpha3.Device") proto.RegisterType((*NodeUnprepareResourcesRequest)(nil), "v1alpha3.NodeUnprepareResourcesRequest") proto.RegisterType((*NodeUnprepareResourcesResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse") proto.RegisterMapType((map[string]*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse.ClaimsEntry") proto.RegisterType((*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourceResponse") - proto.RegisterType((*NodeListAndWatchResourcesRequest)(nil), "v1alpha3.NodeListAndWatchResourcesRequest") - proto.RegisterType((*NodeListAndWatchResourcesResponse)(nil), "v1alpha3.NodeListAndWatchResourcesResponse") proto.RegisterType((*Claim)(nil), "v1alpha3.Claim") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 631 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x6e, 0xd3, 0x4c, - 0x10, 0xcf, 0xb6, 0x4d, 0xf5, 0x65, 0x22, 0xb5, 0x9f, 0x56, 0x15, 0x0a, 0xa6, 0x98, 0x60, 0x51, - 0x12, 0x51, 0xb0, 0xc1, 0x05, 0x54, 0x81, 0x38, 0xd0, 0x16, 0xd4, 0xa2, 0x82, 0x90, 0x11, 0x42, - 0xe2, 0x52, 0x36, 0xde, 0xc5, 0xb1, 0xe2, 0xd8, 0x66, 0xd7, 0xae, 0xe8, 0x8d, 0x47, 0xe0, 0xb1, - 0x7a, 0xe0, 0x80, 0x38, 0xf5, 0x84, 0x68, 0xb8, 0xf1, 0x14, 0xc8, 0x6b, 0x6f, 0xda, 0x44, 0x4e, - 0x52, 0x89, 0xdb, 0xec, 0xfc, 0xf9, 0xcd, 0xce, 0x6f, 0x66, 0x76, 0xa1, 0x46, 0x62, 0xdf, 0x8c, - 0x79, 0x94, 0x44, 0xf8, 0xbf, 0xc3, 0x7b, 0x24, 0x88, 0xbb, 0x64, 0x43, 0xbb, 0xe3, 0xf9, 0x49, - 0x37, 0xed, 0x98, 0x6e, 0xd4, 0xb7, 0xbc, 0xc8, 0x8b, 0x2c, 0xe9, 0xd0, 0x49, 0x3f,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49, 0x6f, 0x86, 0xf1, 0xce, - 0x08, 0xb6, 0xd3, 0x10, 0x13, 0x2c, 0xf6, 0xc9, 0x1c, 0x2c, 0x64, 0xec, 0x62, 0x0f, 0x56, 0xca, - 0x76, 0x1b, 0xaf, 0xcd, 0xda, 0x7d, 0xd9, 0x24, 0xed, 0xe6, 0xc5, 0x9e, 0x08, 0xa3, 0x82, 0xfb, - 0x70, 0xa9, 0x7c, 0x86, 0x71, 0x6b, 0xf6, 0x94, 0xe7, 0xc9, 0xda, 0x17, 0x5d, 0x07, 0xa3, 0x82, - 0x3f, 0xc3, 0xe5, 0x89, 0xd3, 0x83, 0x6f, 0x8d, 0x02, 0x4d, 0x1b, 0x43, 0x6d, 0xfd, 0x42, 0xbe, - 0x2a, 0xef, 0x5d, 0xb4, 0xb5, 0x75, 0x7c, 0xaa, 0xa3, 0x93, 0x53, 0xbd, 0xf2, 0x65, 0xa0, 0xa3, - 0xe3, 0x81, 0x8e, 0xbe, 0x0f, 0x74, 0xf4, 0x6b, 0xa0, 0xa3, 0xaf, 0xbf, 0xf5, 0xca, 0xfb, 0x1b, - 0xc5, 0xd3, 0xdf, 0x4b, 0x3b, 0x2c, 0x60, 0x89, 0x15, 0xf7, 0xbc, 0xec, 0x1b, 0x10, 0x16, 0xe5, - 0x44, 0x7d, 0x01, 0x1b, 0x9d, 0x45, 0xf9, 0xf2, 0x6f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xb2, - 0x0b, 0x57, 0x0c, 0x6d, 0x06, 0x00, 0x00, + // 552 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xcd, 0x34, 0x0f, 0xea, 0x9b, 0x00, 0xd1, 0xa8, 0x42, 0x51, 0x5a, 0xdc, 0xc8, 0x50, 0x12, + 0x21, 0x11, 0x8b, 0xb4, 0xa0, 0x0a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 0x92, 0xf5, 0xcc, 0x3e, 0x69, 0xa6, 0x3d, 0x5a, 0xd4, 0xfe, 0x2d, 0x64, 0xd5, 0x68, + 0x78, 0x0b, 0x2c, 0xa5, 0x38, 0xf3, 0x03, 0x62, 0x4a, 0xe6, 0x01, 0x39, 0x72, 0x1c, 0x85, 0x46, + 0x6c, 0x69, 0x62, 0x0c, 0x99, 0x05, 0x81, 0x95, 0xdd, 0x38, 0x43, 0x90, 0x91, 0x43, 0xe0, 0x2e, + 0x6c, 0x24, 0x3d, 0x24, 0xbc, 0xb3, 0xea, 0xa1, 0x29, 0x25, 0xcb, 0x0f, 0xae, 0xf7, 0x1e, 0x9d, + 0x14, 0x1e, 0xc0, 0x9d, 0x64, 0x3d, 0x70, 0x75, 0xb5, 0x62, 0x9a, 0xac, 0x76, 0x5d, 0x69, 0x9d, + 0x54, 0xb3, 0x79, 0x7a, 0x6e, 0xa3, 0xdf, 0xe7, 0x76, 0xea, 0xeb, 0xc4, 0x46, 0xa7, 0x13, 0x1b, + 0xfd, 0x9c, 0xd8, 0xe8, 0xcf, 0xc4, 0x46, 0xdf, 0xfe, 0xda, 0xa9, 0x8f, 0xf7, 0x7b, 0xfb, 0xa2, + 0x1e, 0x51, 0xb7, 0x17, 0x77, 0x48, 0x9f, 0x8c, 0x5c, 0xd6, 0xeb, 0xba, 0x3e, 0x8b, 0x84, 0x1b, + 0x72, 0xdf, 0x35, 0x24, 0x7b, 0x9d, 0x9c, 0xfa, 0xd9, 0xed, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, + 0xa8, 0x76, 0xf5, 0x4f, 0x32, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -594,10 +558,6 @@ type NodeClient interface { // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) - // NodeListAndWatchResources returns a stream of NodeResourcesResponse objects. - // At the start and whenever resource availability changes, the - // plugin must send one such object with all information to the Kubelet. - NodeListAndWatchResources(ctx context.Context, in *NodeListAndWatchResourcesRequest, opts ...grpc.CallOption) (Node_NodeListAndWatchResourcesClient, error) } type nodeClient struct { @@ -626,38 +586,6 @@ func (c *nodeClient) NodeUnprepareResources(ctx context.Context, in *NodeUnprepa return out, nil } -func (c *nodeClient) NodeListAndWatchResources(ctx context.Context, in *NodeListAndWatchResourcesRequest, opts ...grpc.CallOption) (Node_NodeListAndWatchResourcesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Node_serviceDesc.Streams[0], "/v1alpha3.Node/NodeListAndWatchResources", opts...) - if err != nil { - return nil, err - } - x := &nodeNodeListAndWatchResourcesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Node_NodeListAndWatchResourcesClient interface { - Recv() (*NodeListAndWatchResourcesResponse, error) - grpc.ClientStream -} - -type nodeNodeListAndWatchResourcesClient struct { - grpc.ClientStream -} - -func (x *nodeNodeListAndWatchResourcesClient) Recv() (*NodeListAndWatchResourcesResponse, error) { - m := new(NodeListAndWatchResourcesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - // NodeServer is the server API for Node service. type NodeServer interface { // NodePrepareResources prepares several ResourceClaims @@ -668,10 +596,6 @@ type NodeServer interface { // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, NodeUnprepareResources(context.Context, *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) - // NodeListAndWatchResources returns a stream of NodeResourcesResponse objects. - // At the start and whenever resource availability changes, the - // plugin must send one such object with all information to the Kubelet. - NodeListAndWatchResources(*NodeListAndWatchResourcesRequest, Node_NodeListAndWatchResourcesServer) error } // UnimplementedNodeServer can be embedded to have forward compatible implementations. @@ -684,9 +608,6 @@ func (*UnimplementedNodeServer) NodePrepareResources(ctx context.Context, req *N func (*UnimplementedNodeServer) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeUnprepareResources not implemented") } -func (*UnimplementedNodeServer) NodeListAndWatchResources(req *NodeListAndWatchResourcesRequest, srv Node_NodeListAndWatchResourcesServer) error { - return status.Errorf(codes.Unimplemented, "method NodeListAndWatchResources not implemented") -} func RegisterNodeServer(s *grpc.Server, srv NodeServer) { s.RegisterService(&_Node_serviceDesc, srv) @@ -728,27 +649,6 @@ func _Node_NodeUnprepareResources_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } -func _Node_NodeListAndWatchResources_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(NodeListAndWatchResourcesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(NodeServer).NodeListAndWatchResources(m, &nodeNodeListAndWatchResourcesServer{stream}) -} - -type Node_NodeListAndWatchResourcesServer interface { - Send(*NodeListAndWatchResourcesResponse) error - grpc.ServerStream -} - -type nodeNodeListAndWatchResourcesServer struct { - grpc.ServerStream -} - -func (x *nodeNodeListAndWatchResourcesServer) Send(m *NodeListAndWatchResourcesResponse) error { - return x.ServerStream.SendMsg(m) -} - var _Node_serviceDesc = grpc.ServiceDesc{ ServiceName: "v1alpha3.Node", HandlerType: (*NodeServer)(nil), @@ -762,13 +662,7 @@ var _Node_serviceDesc = grpc.ServiceDesc{ Handler: _Node_NodeUnprepareResources_Handler, }, }, - Streams: []grpc.StreamDesc{ - { - StreamName: "NodeListAndWatchResources", - Handler: _Node_NodeListAndWatchResources_Handler, - ServerStreams: true, - }, - }, + Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } @@ -885,11 +779,71 @@ func (m *NodePrepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 } - if len(m.CDIDevices) > 0 { - for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CDIDevices[iNdEx]) - copy(dAtA[i:], m.CDIDevices[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDevices[iNdEx]))) + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Device) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Device) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CDIDeviceIDs) > 0 { + for iNdEx := len(m.CDIDeviceIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CDIDeviceIDs[iNdEx]) + copy(dAtA[i:], m.CDIDeviceIDs[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDeviceIDs[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.DeviceName) > 0 { + i -= len(m.DeviceName) + copy(dAtA[i:], m.DeviceName) + i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) + i-- + dAtA[i] = 0x1a + } + if len(m.PoolName) > 0 { + i -= len(m.PoolName) + copy(dAtA[i:], m.PoolName) + i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) + i-- + dAtA[i] = 0x12 + } + if len(m.RequestNames) > 0 { + for iNdEx := len(m.RequestNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequestNames[iNdEx]) + copy(dAtA[i:], m.RequestNames[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.RequestNames[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1013,66 +967,6 @@ func (m *NodeUnprepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *NodeListAndWatchResourcesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeListAndWatchResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeListAndWatchResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *NodeListAndWatchResourcesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeListAndWatchResourcesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeListAndWatchResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Resources) > 0 { - for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *Claim) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1093,27 +987,6 @@ func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.StructuredResourceHandle) > 0 { - for iNdEx := len(m.StructuredResourceHandle) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StructuredResourceHandle[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.ResourceHandle) > 0 { - i -= len(m.ResourceHandle) - copy(dAtA[i:], m.ResourceHandle) - i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceHandle))) - i-- - dAtA[i] = 0x22 - } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) @@ -1192,9 +1065,9 @@ func (m *NodePrepareResourceResponse) Size() (n int) { } var l int _ = l - if len(m.CDIDevices) > 0 { - for _, s := range m.CDIDevices { - l = len(s) + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.Size() n += 1 + l + sovApi(uint64(l)) } } @@ -1205,15 +1078,44 @@ func (m *NodePrepareResourceResponse) Size() (n int) { return n } -func (m *NodeUnprepareResourcesRequest) Size() (n int) { +func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Claims) > 0 { - for _, e := range m.Claims { - l = e.Size() + if len(m.RequestNames) > 0 { + for _, s := range m.RequestNames { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + l = len(m.PoolName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.DeviceName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if len(m.CDIDeviceIDs) > 0 { + for _, s := range m.CDIDeviceIDs { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + return n +} + +func (m *NodeUnprepareResourcesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Claims) > 0 { + for _, e := range m.Claims { + l = e.Size() n += 1 + l + sovApi(uint64(l)) } } @@ -1255,30 +1157,6 @@ func (m *NodeUnprepareResourceResponse) Size() (n int) { return n } -func (m *NodeListAndWatchResourcesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *NodeListAndWatchResourcesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - return n -} - func (m *Claim) Size() (n int) { if m == nil { return 0 @@ -1297,16 +1175,6 @@ func (m *Claim) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.ResourceHandle) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if len(m.StructuredResourceHandle) > 0 { - for _, e := range m.StructuredResourceHandle { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } return n } @@ -1355,13 +1223,31 @@ func (this *NodePrepareResourceResponse) String() string { if this == nil { return "nil" } + repeatedStringForDevices := "[]*Device{" + for _, f := range this.Devices { + repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," + } + repeatedStringForDevices += "}" s := strings.Join([]string{`&NodePrepareResourceResponse{`, - `CDIDevices:` + fmt.Sprintf("%v", this.CDIDevices) + `,`, + `Devices:` + repeatedStringForDevices + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } +func (this *Device) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Device{`, + `RequestNames:` + fmt.Sprintf("%v", this.RequestNames) + `,`, + `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, + `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, + `CDIDeviceIDs:` + fmt.Sprintf("%v", this.CDIDeviceIDs) + `,`, + `}`, + }, "") + return s +} func (this *NodeUnprepareResourcesRequest) String() string { if this == nil { return "nil" @@ -1407,45 +1293,14 @@ func (this *NodeUnprepareResourceResponse) String() string { }, "") return s } -func (this *NodeListAndWatchResourcesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeListAndWatchResourcesRequest{`, - `}`, - }, "") - return s -} -func (this *NodeListAndWatchResourcesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForResources := "[]*ResourceModel{" - for _, f := range this.Resources { - repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "ResourceModel", "v1alpha2.ResourceModel", 1) + "," - } - repeatedStringForResources += "}" - s := strings.Join([]string{`&NodeListAndWatchResourcesResponse{`, - `Resources:` + repeatedStringForResources + `,`, - `}`, - }, "") - return s -} func (this *Claim) String() string { if this == nil { return "nil" } - repeatedStringForStructuredResourceHandle := "[]*StructuredResourceHandle{" - for _, f := range this.StructuredResourceHandle { - repeatedStringForStructuredResourceHandle += strings.Replace(fmt.Sprintf("%v", f), "StructuredResourceHandle", "v1alpha2.StructuredResourceHandle", 1) + "," - } - repeatedStringForStructuredResourceHandle += "}" s := strings.Join([]string{`&Claim{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `ResourceHandle:` + fmt.Sprintf("%v", this.ResourceHandle) + `,`, - `StructuredResourceHandle:` + repeatedStringForStructuredResourceHandle + `,`, `}`, }, "") return s @@ -1752,7 +1607,41 @@ func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &Device{}) + if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1780,11 +1669,93 @@ func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CDIDevices = append(m.CDIDevices, string(dAtA[iNdEx:postIndex])) + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Device) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Device: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestNames = append(m.RequestNames, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1812,7 +1783,71 @@ func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Error = string(dAtA[iNdEx:postIndex]) + m.PoolName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CDIDeviceIDs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CDIDeviceIDs = append(m.CDIDeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -2180,140 +2215,6 @@ func (m *NodeUnprepareResourceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *NodeListAndWatchResourcesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NodeListAndWatchResourcesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeListAndWatchResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeListAndWatchResourcesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NodeListAndWatchResourcesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeListAndWatchResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &v1alpha2.ResourceModel{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Claim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2439,72 +2340,6 @@ func (m *Claim) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceHandle", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceHandle = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StructuredResourceHandle", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StructuredResourceHandle = append(m.StructuredResourceHandle, &v1alpha2.StructuredResourceHandle{}) - if err := m.StructuredResourceHandle[len(m.StructuredResourceHandle)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.proto b/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.proto similarity index 71% rename from staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.proto rename to staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.proto index 3e83ba807dec1..5a7404795743f 100644 --- a/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.proto +++ b/staging/src/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.proto @@ -19,10 +19,9 @@ limitations under the License. syntax = "proto3"; package v1alpha3; -option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha3"; +option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha4"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; -import "k8s.io/api/resource/v1alpha2/generated.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; @@ -44,12 +43,6 @@ service Node { // The same error handling rules apply, rpc NodeUnprepareResources (NodeUnprepareResourcesRequest) returns (NodeUnprepareResourcesResponse) {} - - // NodeListAndWatchResources returns a stream of NodeResourcesResponse objects. - // At the start and whenever resource availability changes, the - // plugin must send one such object with all information to the Kubelet. - rpc NodeListAndWatchResources(NodeListAndWatchResourcesRequest) - returns (stream NodeListAndWatchResourcesResponse) {} } message NodePrepareResourcesRequest { @@ -69,14 +62,31 @@ message NodePrepareResourcesResponse { message NodePrepareResourceResponse { // These are the additional devices that kubelet must - // make available via the container runtime. A resource + // make available via the container runtime. A claim + // may have zero or more requests and each request // may have zero or more devices. - repeated string cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"]; + repeated Device devices = 1; // If non-empty, preparing the ResourceClaim failed. // cdi_devices is ignored in that case. string error = 2; } +message Device { + // The requests in the claim that this device is associated with. + // Optional. If empty, the device is associated with all requests. + repeated string request_names = 1; + + // The pool which contains the device. Required. + string pool_name = 2; + + // The device itself. Required. + string device_name = 3; + + // A single device instance may map to several CDI device IDs. + // None is also valid. + repeated string cdi_device_ids = 4 [(gogoproto.customname) = "CDIDeviceIDs"]; +} + message NodeUnprepareResourcesRequest { // The list of ResourceClaims that are to be unprepared. repeated Claim claims = 1; @@ -94,13 +104,6 @@ message NodeUnprepareResourceResponse { string error = 1; } -message NodeListAndWatchResourcesRequest { -} - -message NodeListAndWatchResourcesResponse { - repeated k8s.io.api.resource.v1alpha2.ResourceModel resources = 1; -} - message Claim { // The ResourceClaim namespace (ResourceClaim.meta.Namespace). // This field is REQUIRED. @@ -111,13 +114,4 @@ message Claim { // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. string name = 3; - // Resource handle (AllocationResult.ResourceHandles[*].Data) - // This field is REQUIRED. - string resource_handle = 4; - // Structured parameter resource handle (AllocationResult.ResourceHandles[*].StructuredData). - // This field is OPTIONAL. If present, it needs to be used - // instead of resource_handle. It will only have a single entry. - // - // Using "repeated" instead of "optional" is a workaround for https://github.com/gogo/protobuf/issues/713. - repeated k8s.io.api.resource.v1alpha2.StructuredResourceHandle structured_resource_handle = 5; } diff --git a/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go b/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go index 5ca454588ce87..a67c289a50a66 100644 --- a/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go +++ b/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go @@ -586,7 +586,8 @@ func (m *NUMANode) GetID() int64 { // DynamicResource contains information about the devices assigned to a container by DRA type DynamicResource struct { - ClassName string `protobuf:"bytes,1,opt,name=class_name,json=className,proto3" json:"class_name,omitempty"` + // tombstone: removed in 1.31 because claims are no longer associated with one class + // string class_name = 1; ClaimName string `protobuf:"bytes,2,opt,name=claim_name,json=claimName,proto3" json:"claim_name,omitempty"` ClaimNamespace string `protobuf:"bytes,3,opt,name=claim_namespace,json=claimNamespace,proto3" json:"claim_namespace,omitempty"` ClaimResources []*ClaimResource `protobuf:"bytes,4,rep,name=claim_resources,json=claimResources,proto3" json:"claim_resources,omitempty"` @@ -626,13 +627,6 @@ func (m *DynamicResource) XXX_DiscardUnknown() { var xxx_messageInfo_DynamicResource proto.InternalMessageInfo -func (m *DynamicResource) GetClassName() string { - if m != nil { - return m.ClassName - } - return "" -} - func (m *DynamicResource) GetClaimName() string { if m != nil { return m.ClaimName @@ -654,9 +648,15 @@ func (m *DynamicResource) GetClaimResources() []*ClaimResource { return nil } -// ClaimResource contains per plugin resource information +// ClaimResource contains resource information. The driver name/pool name/device name +// triplet uniquely identifies the device. Should DRA get extended to other kinds +// of resources, then device_name will be empty and other fields will get added. +// Each device at the DRA API level may map to zero or more CDI devices. type ClaimResource struct { CDIDevices []*CDIDevice `protobuf:"bytes,1,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` + DriverName string `protobuf:"bytes,2,opt,name=driver_name,json=driverName,proto3" json:"driver_name,omitempty"` + PoolName string `protobuf:"bytes,3,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` + DeviceName string `protobuf:"bytes,4,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -700,6 +700,27 @@ func (m *ClaimResource) GetCDIDevices() []*CDIDevice { return nil } +func (m *ClaimResource) GetDriverName() string { + if m != nil { + return m.DriverName + } + return "" +} + +func (m *ClaimResource) GetPoolName() string { + if m != nil { + return m.PoolName + } + return "" +} + +func (m *ClaimResource) GetDeviceName() string { + if m != nil { + return m.DeviceName + } + return "" +} + // CDIDevice specifies a CDI device information type CDIDevice struct { // Fully qualified CDI device name @@ -871,55 +892,57 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 760 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x5d, 0x6f, 0x12, 0x4d, - 0x14, 0xee, 0xb0, 0xf4, 0x83, 0x53, 0xe8, 0xc7, 0xbc, 0x6f, 0x5a, 0x4a, 0x5b, 0x20, 0xdb, 0x8b, - 0x36, 0x51, 0x21, 0xad, 0xd1, 0x18, 0x2f, 0x4c, 0x3f, 0x30, 0x0d, 0x89, 0xad, 0x75, 0x53, 0x13, - 0xe3, 0x85, 0x64, 0xd9, 0x9d, 0xe2, 0xa4, 0xc0, 0x8c, 0xcc, 0x42, 0xc4, 0x2b, 0x2f, 0xfc, 0x01, - 0x5e, 0xf8, 0x53, 0xfc, 0x11, 0xbd, 0xf4, 0xd2, 0x2b, 0xd3, 0xe2, 0xcf, 0xf0, 0xc6, 0xcc, 0x0c, - 0xbb, 0x2c, 0xb0, 0xd8, 0xf4, 0x8a, 0x99, 0xf3, 0x3c, 0xe7, 0x70, 0xce, 0x73, 0xce, 0x9c, 0x85, - 0x84, 0xcd, 0x69, 0x81, 0xb7, 0x98, 0xc7, 0x70, 0xac, 0xb3, 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77, 0x2a, 0xdb, 0xa8, - 0x0d, 0x8f, 0x73, 0xd2, 0xf5, 0x1f, 0xdf, 0x86, 0x4c, 0x7e, 0x32, 0x21, 0x88, 0xbf, 0x0f, 0xc6, - 0x31, 0xf1, 0x70, 0x46, 0x52, 0xa3, 0x05, 0xcf, 0xac, 0x47, 0x62, 0x7e, 0x84, 0xc3, 0xe7, 0x57, - 0x37, 0x59, 0xf4, 0xf3, 0x26, 0x3b, 0xf5, 0xb9, 0x97, 0x45, 0x57, 0xbd, 0x2c, 0xfa, 0xd1, 0xcb, - 0xa2, 0xeb, 0x5e, 0x16, 0x7d, 0xfd, 0x9d, 0x9d, 0x7a, 0xbb, 0x7d, 0xf9, 0x44, 0x14, 0x28, 0x2b, - 0x5e, 0xb6, 0xab, 0xa4, 0x4e, 0xbc, 0x22, 0xbf, 0xac, 0x15, 0x6d, 0x4e, 0x45, 0x91, 0x33, 0x37, - 0xd0, 0xb9, 0xd8, 0xd9, 0xad, 0xce, 0xa8, 0xcf, 0xdd, 0xc3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x49, 0xac, 0x87, 0x00, 0x2e, 0x07, 0x00, 0x00, + // 789 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6f, 0xda, 0x48, + 0x18, 0xce, 0x60, 0x92, 0xc0, 0x0b, 0xe4, 0x63, 0x76, 0x95, 0x10, 0x48, 0x00, 0x39, 0x87, 0x44, + 0xda, 0x5d, 0x50, 0xb2, 0xda, 0xd5, 0x6a, 0x0f, 0xab, 0x7c, 0xb0, 0x8a, 0x90, 0x36, 0x51, 0xd6, + 0x4a, 0xa5, 0xaa, 0x87, 0x22, 0x63, 0x4f, 0xa8, 0x15, 0x60, 0xa6, 0x1e, 0x83, 0x4a, 0x4f, 0x3d, + 0xf4, 0x07, 0xf4, 0xd0, 0xfe, 0x8d, 0xfe, 0x8e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, 0xc1, 0xfe, 0x01, + 0x39, 0x46, 0xed, 0xa6, 0x1b, 0x10, 0x7e, 0xc8, 0x6b, 0xe2, 0xa9, 0x09, 0x83, 0x2c, 0x8b, 0xdc, + 0xf4, 0x57, 0x90, 0x8d, 0xb2, 0x18, 0x43, 0xb2, 0x67, 0x76, 0x49, 0x1e, 0x55, 0xd0, 0x7e, 0xda, + 0x90, 0x67, 0xbc, 0x0d, 0x69, 0xf1, 0xcb, 0x99, 0x69, 0x91, 0x7c, 0x42, 0x12, 0x63, 0x00, 0xff, + 0x09, 0x60, 0x05, 0xa9, 0x70, 0x3f, 0xc1, 0x8d, 0x89, 0x04, 0xc7, 0x6f, 0x47, 0x94, 0xfa, 0x1d, + 0x02, 0x3c, 0x2b, 0x89, 0x0d, 0x20, 0xd2, 0x88, 0xc4, 0x23, 0x1b, 0xa1, 0xcd, 0x69, 0x44, 0xf2, + 0xc1, 0x46, 0xe0, 0x23, 0x58, 0xb7, 0x87, 0x3d, 0xb3, 0xeb, 0x58, 0x91, 0xaa, 0x2e, 0x8e, 0xed, + 0xea, 0x8a, 0x0c, 0x42, 0x37, 0xd6, 0xec, 0x49, 0x80, 0xeb, 0x1e, 0xac, 0x4e, 0x39, 0xc7, 0x65, + 0xc8, 0x28, 0xf7, 0x4d, 0x6f, 0xc8, 0x82, 0x2c, 0x41, 0x41, 0x57, 0x43, 0x46, 0x44, 0xfe, 0xdc, + 0x79, 0xad, 0xea, 0x9c, 0x34, 0xe4, 0x19, 0xff, 0x0a, 0x29, 0x8f, 0x32, 0xda, 0xa1, 0x6d, 0x31, + 0x41, 0x28, 0x68, 0xeb, 0x95, 0x8f, 0x35, 0x7a, 0xd7, 0xd4, 0x08, 0x15, 0xfa, 0x5b, 0x04, 0x6b, + 0xd3, 0xb5, 0xc1, 0xbb, 0x90, 0x0b, 0x92, 0x68, 0x46, 0xea, 0x9b, 0x0d, 0xc0, 0x0b, 0x51, 0xe7, + 0x1d, 0x00, 0x55, 0xc2, 0x70,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f, 0x41, 0x4a, 0x2c, + 0x99, 0x88, 0xc5, 0x32, 0xa3, 0xb6, 0x7c, 0x76, 0x57, 0xed, 0x9f, 0xe9, 0x45, 0x91, 0xf5, 0x79, + 0x89, 0xe9, 0x97, 0xb0, 0x39, 0xe3, 0x79, 0xfe, 0xfe, 0x42, 0x0f, 0xef, 0xaf, 0xc3, 0x6f, 0x08, + 0x70, 0x94, 0x16, 0xfb, 0x91, 0xb8, 0xf8, 0x14, 0x92, 0xe2, 0x84, 0x8b, 0xc2, 0x7c, 0xce, 0x3a, + 0x2d, 0x6c, 0xc7, 0x93, 0x2a, 0x20, 0x7d, 0x01, 0x3f, 0x97, 0xd1, 0xc6, 0x7d, 0x22, 0x70, 0x59, + 0x98, 0xfe, 0xe0, 0xe3, 0x52, 0xa8, 0xcc, 0x17, 0x84, 0xfe, 0x8f, 0x40, 0x3b, 0x23, 0x1e, 0x2e, + 0x08, 0x69, 0x7c, 0xc1, 0x0b, 0xc5, 0x58, 0x2e, 0xf0, 0x70, 0xf2, 0xef, 0xed, 0x7d, 0x09, 0x7d, + 0xbe, 0x2f, 0x2d, 0xbc, 0x19, 0x95, 0xd0, 0xed, 0xa8, 0x84, 0x3e, 0x8d, 0x4a, 0xe8, 0x6e, 0x54, + 0x42, 0xef, 0xbe, 0x96, 0x16, 0x9e, 0xed, 0xdd, 0xfc, 0xc5, 0xab, 0x0e, 0xad, 0xdd, 0xf4, 0x5b, + 0xa4, 0x43, 0xbc, 0x1a, 0xbb, 0x69, 0xd7, 0x4c, 0xe6, 0xf0, 0x1a, 0xa3, 0x76, 0x58, 0xe7, 0xda, + 0xe0, 0xa0, 0xb5, 0x24, 0xbf, 0x97, 0xbf, 0x7f, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x1b, 0x18, + 0xf9, 0x6f, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1580,13 +1603,6 @@ func (m *DynamicResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ClassName) > 0 { - i -= len(m.ClassName) - copy(dAtA[i:], m.ClassName) - i = encodeVarintApi(dAtA, i, uint64(len(m.ClassName))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -1610,6 +1626,27 @@ func (m *ClaimResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DeviceName) > 0 { + i -= len(m.DeviceName) + copy(dAtA[i:], m.DeviceName) + i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) + i-- + dAtA[i] = 0x22 + } + if len(m.PoolName) > 0 { + i -= len(m.PoolName) + copy(dAtA[i:], m.PoolName) + i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) + i-- + dAtA[i] = 0x1a + } + if len(m.DriverName) > 0 { + i -= len(m.DriverName) + copy(dAtA[i:], m.DriverName) + i = encodeVarintApi(dAtA, i, uint64(len(m.DriverName))) + i-- + dAtA[i] = 0x12 + } if len(m.CDIDevices) > 0 { for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { { @@ -1938,10 +1975,6 @@ func (m *DynamicResource) Size() (n int) { } var l int _ = l - l = len(m.ClassName) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } l = len(m.ClaimName) if l > 0 { n += 1 + l + sovApi(uint64(l)) @@ -1971,6 +2004,18 @@ func (m *ClaimResource) Size() (n int) { n += 1 + l + sovApi(uint64(l)) } } + l = len(m.DriverName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.PoolName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.DeviceName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -2183,7 +2228,6 @@ func (this *DynamicResource) String() string { } repeatedStringForClaimResources += "}" s := strings.Join([]string{`&DynamicResource{`, - `ClassName:` + fmt.Sprintf("%v", this.ClassName) + `,`, `ClaimName:` + fmt.Sprintf("%v", this.ClaimName) + `,`, `ClaimNamespace:` + fmt.Sprintf("%v", this.ClaimNamespace) + `,`, `ClaimResources:` + repeatedStringForClaimResources + `,`, @@ -2202,6 +2246,9 @@ func (this *ClaimResource) String() string { repeatedStringForCDIDevices += "}" s := strings.Join([]string{`&ClaimResource{`, `CDIDevices:` + repeatedStringForCDIDevices + `,`, + `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, + `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, + `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, `}`, }, "") return s @@ -3500,38 +3547,6 @@ func (m *DynamicResource) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: DynamicResource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClassName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClassName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClaimName", wireType) @@ -3714,6 +3729,102 @@ func (m *ClaimResource) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DriverName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto b/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto index 9e6022ac32c38..93ab0185d5866 100644 --- a/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto +++ b/staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto @@ -82,15 +82,22 @@ message NUMANode { // DynamicResource contains information about the devices assigned to a container by DRA message DynamicResource { - string class_name = 1; + // tombstone: removed in 1.31 because claims are no longer associated with one class + // string class_name = 1; string claim_name = 2; string claim_namespace = 3; repeated ClaimResource claim_resources = 4; } -// ClaimResource contains per plugin resource information +// ClaimResource contains resource information. The driver name/pool name/device name +// triplet uniquely identifies the device. Should DRA get extended to other kinds +// of resources, then device_name will be empty and other fields will get added. +// Each device at the DRA API level may map to zero or more CDI devices. message ClaimResource { repeated CDIDevice cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"]; + string driver_name = 2; + string pool_name = 3; + string device_name = 4; } // CDIDevice specifies a CDI device information diff --git a/test/e2e/dra/deploy.go b/test/e2e/dra/deploy.go index b07d3d00f13d1..074d46a16e424 100644 --- a/test/e2e/dra/deploy.go +++ b/test/e2e/dra/deploy.go @@ -19,6 +19,7 @@ package dra import ( "bytes" "context" + _ "embed" "errors" "fmt" "net" @@ -36,12 +37,20 @@ import ( appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + resourceapi "k8s.io/api/resource/v1alpha3" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/selection" - resourceapiinformer "k8s.io/client-go/informers/resource/v1alpha2" + "k8s.io/apiserver/pkg/authentication/serviceaccount" + "k8s.io/client-go/discovery/cached/memory" + resourceapiinformer "k8s.io/client-go/informers/resource/v1alpha3" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/restmapper" "k8s.io/client-go/tools/cache" "k8s.io/dynamic-resource-allocation/kubeletplugin" "k8s.io/klog/v2" @@ -52,22 +61,26 @@ import ( e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper" "k8s.io/kubernetes/test/e2e/storage/drivers/proxy" "k8s.io/kubernetes/test/e2e/storage/utils" + "sigs.k8s.io/yaml" ) const ( - NodePrepareResourcesMethod = "/v1alpha3.Node/NodePrepareResources" - NodeUnprepareResourcesMethod = "/v1alpha3.Node/NodeUnprepareResources" - NodeListAndWatchResourcesMethod = "/v1alpha3.Node/NodeListAndWatchResources" + NodePrepareResourcesMethod = "/v1alpha3.Node/NodePrepareResources" + NodeUnprepareResourcesMethod = "/v1alpha3.Node/NodeUnprepareResources" ) type Nodes struct { NodeNames []string } +//go:embed test-driver/deploy/example/plugin-rbac.yaml +var pluginRBAC string + // NewNodes selects nodes to run the test on. func NewNodes(f *framework.Framework, minNodes, maxNodes int) *Nodes { nodes := &Nodes{} ginkgo.BeforeEach(func(ctx context.Context) { + ginkgo.By("selecting nodes") // The kubelet plugin is harder. We deploy the builtin manifest // after patching in the driver name and all nodes on which we @@ -85,6 +98,7 @@ func NewNodes(f *framework.Framework, minNodes, maxNodes int) *Nodes { for _, node := range nodeList.Items { nodes.NodeNames = append(nodes.NodeNames, node.Name) } + sort.Strings(nodes.NodeNames) framework.Logf("testing on nodes %v", nodes.NodeNames) // Watch claims in the namespace. This is useful for monitoring a test @@ -99,20 +113,20 @@ func NewNodes(f *framework.Framework, minNodes, maxNodes int) *Nodes { _, err = claimInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj any) { defer ginkgo.GinkgoRecover() - claim := obj.(*resourcev1alpha2.ResourceClaim) + claim := obj.(*resourceapi.ResourceClaim) framework.Logf("New claim:\n%s", format.Object(claim, 1)) validateClaim(claim) }, UpdateFunc: func(oldObj, newObj any) { defer ginkgo.GinkgoRecover() - oldClaim := oldObj.(*resourcev1alpha2.ResourceClaim) - newClaim := newObj.(*resourcev1alpha2.ResourceClaim) + oldClaim := oldObj.(*resourceapi.ResourceClaim) + newClaim := newObj.(*resourceapi.ResourceClaim) framework.Logf("Updated claim:\n%s\nDiff:\n%s", format.Object(newClaim, 1), cmp.Diff(oldClaim, newClaim)) validateClaim(newClaim) }, DeleteFunc: func(obj any) { defer ginkgo.GinkgoRecover() - claim := obj.(*resourcev1alpha2.ResourceClaim) + claim := obj.(*resourceapi.ResourceClaim) framework.Logf("Deleted claim:\n%s", format.Object(claim, 1)) }, }) @@ -126,7 +140,7 @@ func NewNodes(f *framework.Framework, minNodes, maxNodes int) *Nodes { return nodes } -func validateClaim(claim *resourcev1alpha2.ResourceClaim) { +func validateClaim(claim *resourceapi.ResourceClaim) { // The apiserver doesn't enforce that a claim always has a finalizer // while being allocated. This is a convention that whoever allocates a // claim has to follow to prevent using a claim that is at risk of @@ -139,7 +153,7 @@ func validateClaim(claim *resourcev1alpha2.ResourceClaim) { // NewDriver sets up controller (as client of the cluster) and // kubelet plugin (via proxy) before the test runs. It cleans // up after the test. -func NewDriver(f *framework.Framework, nodes *Nodes, configureResources func() app.Resources) *Driver { +func NewDriver(f *framework.Framework, nodes *Nodes, configureResources func() app.Resources, devicesPerNode ...map[string]map[resourceapi.QualifiedName]resourceapi.DeviceAttribute) *Driver { d := &Driver{ f: f, fail: map[MethodInstance]bool{}, @@ -155,7 +169,7 @@ func NewDriver(f *framework.Framework, nodes *Nodes, configureResources func() a resources.Nodes = nodes.NodeNames } ginkgo.DeferCleanup(d.IsGone) // Register first so it gets called last. - d.SetUp(nodes, resources) + d.SetUp(nodes, resources, devicesPerNode...) ginkgo.DeferCleanup(d.TearDown) }) return d @@ -177,13 +191,8 @@ type Driver struct { Name string Nodes map[string]*app.ExamplePlugin - parameterMode parameterMode - parameterAPIGroup string - parameterAPIVersion string - claimParameterAPIKind string - classParameterAPIKind string - - NodeV1alpha3 bool + parameterMode parameterMode // empty == parameterModeStructured + NodeV1alpha3 bool mutex sync.Mutex fail map[MethodInstance]bool @@ -193,12 +202,11 @@ type Driver struct { type parameterMode string const ( - parameterModeConfigMap parameterMode = "configmap" // ConfigMap parameters, control plane controller. - parameterModeStructured parameterMode = "structured" // No ConfigMaps, directly create and reference in-tree parameter objects. - parameterModeTranslated parameterMode = "translated" // Reference ConfigMaps in claim and class, generate in-tree parameter objects. + parameterModeClassicDRA parameterMode = "classic" // control plane controller + parameterModeStructured parameterMode = "structured" // allocation through scheduler ) -func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { +func (d *Driver) SetUp(nodes *Nodes, resources app.Resources, devicesPerNode ...map[string]map[resourceapi.QualifiedName]resourceapi.DeviceAttribute) { ginkgo.By(fmt.Sprintf("deploying driver on nodes %v", nodes.NodeNames)) d.Nodes = map[string]*app.ExamplePlugin{} d.Name = d.f.UniqueName + d.NameSuffix + ".k8s.io" @@ -213,8 +221,12 @@ func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { d.ctx = ctx d.cleanup = append(d.cleanup, cancel) + if d.parameterMode == "" { + d.parameterMode = parameterModeStructured + } + switch d.parameterMode { - case "", parameterModeConfigMap: + case parameterModeClassicDRA: // The controller is easy: we simply connect to the API server. d.Controller = app.NewController(d.f.ClientSet, resources) d.wg.Add(1) @@ -222,6 +234,41 @@ func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { defer d.wg.Done() d.Controller.Run(d.ctx, 5 /* workers */) }() + case parameterModeStructured: + if !resources.NodeLocal { + // Publish one resource pool with "network-attached" devices. + slice := &resourceapi.ResourceSlice{ + ObjectMeta: metav1.ObjectMeta{ + Name: d.Name, // globally unique + }, + Spec: resourceapi.ResourceSliceSpec{ + Driver: d.Name, + Pool: resourceapi.ResourcePool{ + Name: "network", + Generation: 1, + ResourceSliceCount: 1, + }, + AllNodes: true, + }, + } + maxAllocations := resources.MaxAllocations + if maxAllocations <= 0 { + // Cannot be empty, otherwise nothing runs. + maxAllocations = 10 + } + for i := 0; i < maxAllocations; i++ { + slice.Spec.Devices = append(slice.Spec.Devices, resourceapi.Device{ + Name: fmt.Sprintf("device-%d", i), + Basic: &resourceapi.BasicDevice{}, + }) + } + + _, err := d.f.ClientSet.ResourceV1alpha3().ResourceSlices().Create(ctx, slice, metav1.CreateOptions{}) + framework.ExpectNoError(err) + ginkgo.DeferCleanup(func(ctx context.Context) { + framework.ExpectNoError(d.f.ClientSet.ResourceV1alpha3().ResourceSlices().Delete(ctx, slice.Name, metav1.DeleteOptions{})) + }) + } } manifests := []string{ @@ -229,28 +276,22 @@ func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { // container names, etc.). "test/e2e/testing-manifests/dra/dra-test-driver-proxy.yaml", } - if d.parameterMode == "" { - d.parameterMode = parameterModeConfigMap - } - var numResourceInstances = -1 // disabled - if d.parameterMode != parameterModeConfigMap { - numResourceInstances = resources.MaxAllocations + var numDevices = -1 // disabled + if d.parameterMode != parameterModeClassicDRA && resources.NodeLocal { + numDevices = resources.MaxAllocations } switch d.parameterMode { - case parameterModeConfigMap, parameterModeTranslated: - d.parameterAPIGroup = "" - d.parameterAPIVersion = "v1" - d.claimParameterAPIKind = "ConfigMap" - d.classParameterAPIKind = "ConfigMap" - case parameterModeStructured: - d.parameterAPIGroup = "resource.k8s.io" - d.parameterAPIVersion = "v1alpha2" - d.claimParameterAPIKind = "ResourceClaimParameters" - d.classParameterAPIKind = "ResourceClassParameters" + case parameterModeClassicDRA, parameterModeStructured: default: framework.Failf("unknown test driver parameter mode: %s", d.parameterMode) } + // Create service account and corresponding RBAC rules. + serviceAccountName := "dra-kubelet-plugin-" + d.Name + "-service-account" + content := strings.ReplaceAll(pluginRBAC, "dra-kubelet-plugin", "dra-kubelet-plugin-"+d.Name) + content = strings.ReplaceAll(content, "namespace: default", "namespace: "+d.f.Namespace.Name) + d.createFromYAML(ctx, []byte(content), d.f.Namespace.Name) + instanceKey := "app.kubernetes.io/instance" rsName := "" draAddr := path.Join(framework.TestContext.KubeletRootDir, "plugins", d.Name+".sock") @@ -263,6 +304,7 @@ func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { item.Spec.Replicas = &numNodes item.Spec.Selector.MatchLabels[instanceKey] = d.Name item.Spec.Template.Labels[instanceKey] = d.Name + item.Spec.Template.Spec.ServiceAccountName = serviceAccountName item.Spec.Template.Spec.Affinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution[0].LabelSelector.MatchLabels[instanceKey] = d.Name item.Spec.Template.Spec.Affinity.NodeAffinity = &v1.NodeAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ @@ -283,10 +325,6 @@ func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { item.Spec.Template.Spec.Volumes[2].HostPath.Path = path.Join(framework.TestContext.KubeletRootDir, "plugins_registry") item.Spec.Template.Spec.Containers[0].Args = append(item.Spec.Template.Spec.Containers[0].Args, "--endpoint=/plugins_registry/"+d.Name+"-reg.sock") item.Spec.Template.Spec.Containers[1].Args = append(item.Spec.Template.Spec.Containers[1].Args, "--endpoint=/dra/"+d.Name+".sock") - case *apiextensionsv1.CustomResourceDefinition: - item.Name = strings.ReplaceAll(item.Name, "dra.e2e.example.com", d.parameterAPIGroup) - item.Spec.Group = d.parameterAPIGroup - } return nil }, manifests...) @@ -305,27 +343,53 @@ func (d *Driver) SetUp(nodes *Nodes, resources app.Resources) { pods, err := d.f.ClientSet.CoreV1().Pods(d.f.Namespace.Name).List(ctx, metav1.ListOptions{LabelSelector: selector.String()}) framework.ExpectNoError(err, "list proxy pods") gomega.Expect(numNodes).To(gomega.Equal(int32(len(pods.Items))), "number of proxy pods") + sort.Slice(pods.Items, func(i, j int) bool { + return pods.Items[i].Spec.NodeName < pods.Items[j].Spec.NodeName + }) - // Run registar and plugin for each of the pods. - for _, pod := range pods.Items { + // Run registrar and plugin for each of the pods. + for i, pod := range pods.Items { // Need a local variable, not the loop variable, for the anonymous // callback functions below. pod := pod nodename := pod.Spec.NodeName + + // Authenticate the plugin so that it only has minimal permissions. + driverUserInfo := (&serviceaccount.ServiceAccountInfo{ + Name: serviceAccountName, + Namespace: d.f.Namespace.Name, + NodeName: nodename, + PodName: pod.Name, + PodUID: string(pod.UID), + }).UserInfo() + driverClientConfig := d.f.ClientConfig() + driverClientConfig.Impersonate = rest.ImpersonationConfig{ + UserName: driverUserInfo.GetName(), + Groups: driverUserInfo.GetGroups(), + Extra: driverUserInfo.GetExtra(), + } + driverClient, err := kubernetes.NewForConfig(driverClientConfig) + + framework.ExpectNoError(err, "create client for driver") logger := klog.LoggerWithValues(klog.LoggerWithName(klog.Background(), "kubelet plugin"), "node", pod.Spec.NodeName, "pod", klog.KObj(&pod)) loggerCtx := klog.NewContext(ctx, logger) - plugin, err := app.StartPlugin(loggerCtx, "/cdi", d.Name, nodename, - app.FileOperations{ - Create: func(name string, content []byte) error { - klog.Background().Info("creating CDI file", "node", nodename, "filename", name, "content", string(content)) - return d.createFile(&pod, name, content) - }, - Remove: func(name string) error { - klog.Background().Info("deleting CDI file", "node", nodename, "filename", name) - return d.removeFile(&pod, name) - }, - NumResourceInstances: numResourceInstances, + fileOps := app.FileOperations{ + Create: func(name string, content []byte) error { + klog.Background().Info("creating CDI file", "node", nodename, "filename", name, "content", string(content)) + return d.createFile(&pod, name, content) + }, + Remove: func(name string) error { + klog.Background().Info("deleting CDI file", "node", nodename, "filename", name) + return d.removeFile(&pod, name) }, + } + if i < len(devicesPerNode) { + fileOps.Devices = devicesPerNode[i] + fileOps.NumDevices = -1 + } else { + fileOps.NumDevices = numDevices + } + plugin, err := app.StartPlugin(loggerCtx, "/cdi", d.Name, driverClient, nodename, fileOps, kubeletplugin.GRPCVerbosity(0), kubeletplugin.GRPCInterceptor(func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { return d.interceptor(nodename, ctx, req, info, handler) @@ -376,6 +440,57 @@ func (d *Driver) removeFile(pod *v1.Pod, name string) error { return d.podIO(pod).RemoveAll(name) } +func (d *Driver) createFromYAML(ctx context.Context, content []byte, namespace string) { + // Not caching the discovery result isn't very efficient, but good enough. + discoveryCache := memory.NewMemCacheClient(d.f.ClientSet.Discovery()) + restMapper := restmapper.NewDeferredDiscoveryRESTMapper(discoveryCache) + + for _, content := range bytes.Split(content, []byte("---\n")) { + if len(content) == 0 { + continue + } + + var obj *unstructured.Unstructured + framework.ExpectNoError(yaml.UnmarshalStrict(content, &obj)) + + gv, err := schema.ParseGroupVersion(obj.GetAPIVersion()) + framework.ExpectNoError(err, fmt.Sprintf("extract group+version from object %q", klog.KObj(obj))) + gk := schema.GroupKind{Group: gv.Group, Kind: obj.GetKind()} + + mapping, err := restMapper.RESTMapping(gk, gv.Version) + framework.ExpectNoError(err, fmt.Sprintf("map %q to resource", gk)) + + resourceClient := d.f.DynamicClient.Resource(mapping.Resource) + options := metav1.CreateOptions{ + // If the YAML input is invalid, then we want the + // apiserver to tell us via an error. This can + // happen because decoding into an unstructured object + // doesn't validate. + FieldValidation: "Strict", + } + switch mapping.Scope.Name() { + case meta.RESTScopeNameRoot: + _, err = resourceClient.Create(ctx, obj, options) + case meta.RESTScopeNameNamespace: + if namespace == "" { + framework.Failf("need namespace for object type %s", gk) + } + _, err = resourceClient.Namespace(namespace).Create(ctx, obj, options) + } + framework.ExpectNoError(err, "create object") + ginkgo.DeferCleanup(func(ctx context.Context) { + del := resourceClient.Delete + if mapping.Scope.Name() == meta.RESTScopeNameNamespace { + del = resourceClient.Namespace(namespace).Delete + } + err := del(ctx, obj.GetName(), metav1.DeleteOptions{}) + if !apierrors.IsNotFound(err) { + framework.ExpectNoError(err, fmt.Sprintf("deleting %s.%s %s", obj.GetKind(), obj.GetAPIVersion(), klog.KObj(obj))) + } + }) + } +} + func (d *Driver) podIO(pod *v1.Pod) proxy.PodDirIO { logger := klog.Background() return proxy.PodDirIO{ @@ -408,8 +523,8 @@ func (d *Driver) TearDown() { } func (d *Driver) IsGone(ctx context.Context) { - gomega.Eventually(ctx, func(ctx context.Context) ([]resourcev1alpha2.ResourceSlice, error) { - slices, err := d.f.ClientSet.ResourceV1alpha2().ResourceSlices().List(ctx, metav1.ListOptions{FieldSelector: "driverName=" + d.Name}) + gomega.Eventually(ctx, func(ctx context.Context) ([]resourceapi.ResourceSlice, error) { + slices, err := d.f.ClientSet.ResourceV1alpha3().ResourceSlices().List(ctx, metav1.ListOptions{FieldSelector: resourceapi.ResourceSliceSelectorDriver + "=" + d.Name}) if err != nil { return nil, err } diff --git a/test/e2e/dra/dra.go b/test/e2e/dra/dra.go index 15c7f9652634f..540ee9bf64e2a 100644 --- a/test/e2e/dra/dra.go +++ b/test/e2e/dra/dra.go @@ -18,7 +18,7 @@ package dra import ( "context" - "encoding/json" + _ "embed" "errors" "fmt" "strings" @@ -27,15 +27,17 @@ import ( "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" - "github.com/onsi/gomega/gcustom" "github.com/onsi/gomega/gstruct" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" + applyv1 "k8s.io/client-go/applyconfigurations/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/dynamic-resource-allocation/controller" "k8s.io/klog/v2" @@ -53,11 +55,12 @@ const ( podStartTimeout = 5 * time.Minute ) +//go:embed test-driver/deploy/example/admin-access-policy.yaml +var adminAccessPolicyYAML string + // networkResources can be passed to NewDriver directly. func networkResources() app.Resources { - return app.Resources{ - Shareable: true, - } + return app.Resources{} } // perNode returns a function which can be passed to NewDriver. The nodes @@ -82,240 +85,182 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, ginkgo.Context("kubelet", func() { nodes := NewNodes(f, 1, 1) + driver := NewDriver(f, nodes, networkResources) + b := newBuilder(f, driver) - ginkgo.Context("with ConfigMap parameters", func() { - driver := NewDriver(f, nodes, networkResources) - b := newBuilder(f, driver) - - ginkgo.It("registers plugin", func() { - ginkgo.By("the driver is running") - }) + ginkgo.It("registers plugin", func() { + ginkgo.By("the driver is running") + }) - ginkgo.It("must retry NodePrepareResources", func(ctx context.Context) { - // We have exactly one host. - m := MethodInstance{driver.Nodenames()[0], NodePrepareResourcesMethod} + ginkgo.It("must retry NodePrepareResources", func(ctx context.Context) { + // We have exactly one host. + m := MethodInstance{driver.Nodenames()[0], NodePrepareResourcesMethod} - driver.Fail(m, true) + driver.Fail(m, true) - ginkgo.By("waiting for container startup to fail") - parameters := b.parameters() - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + ginkgo.By("waiting for container startup to fail") + pod, template := b.podInline() - b.create(ctx, parameters, pod, template) + b.create(ctx, pod, template) - ginkgo.By("wait for NodePrepareResources call") - gomega.Eventually(ctx, func(ctx context.Context) error { - if driver.CallCount(m) == 0 { - return errors.New("NodePrepareResources not called yet") - } - return nil - }).WithTimeout(podStartTimeout).Should(gomega.Succeed()) - - ginkgo.By("allowing container startup to succeed") - callCount := driver.CallCount(m) - driver.Fail(m, false) - err := e2epod.WaitForPodNameRunningInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace) - framework.ExpectNoError(err, "start pod with inline resource claim") - if driver.CallCount(m) == callCount { - framework.Fail("NodePrepareResources should have been called again") + ginkgo.By("wait for NodePrepareResources call") + gomega.Eventually(ctx, func(ctx context.Context) error { + if driver.CallCount(m) == 0 { + return errors.New("NodePrepareResources not called yet") } - }) - - ginkgo.It("must not run a pod if a claim is not reserved for it", func(ctx context.Context) { - // Pretend that the resource is allocated and reserved for some other entity. - // Until the resourceclaim controller learns to remove reservations for - // arbitrary types we can simply fake somthing here. - claim := b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - b.create(ctx, claim) - - claim, err := f.ClientSet.ResourceV1alpha2().ResourceClaims(f.Namespace.Name).Get(ctx, claim.Name, metav1.GetOptions{}) - framework.ExpectNoError(err, "get claim") - - claim.Finalizers = append(claim.Finalizers, "e2e.test/delete-protection") - claim, err = f.ClientSet.ResourceV1alpha2().ResourceClaims(f.Namespace.Name).Update(ctx, claim, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "add claim finalizer") - - ginkgo.DeferCleanup(func(ctx context.Context) { - claim.Status.Allocation = nil - claim.Status.ReservedFor = nil - claim, err = f.ClientSet.ResourceV1alpha2().ResourceClaims(f.Namespace.Name).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "update claim") - - claim.Finalizers = nil - _, err = f.ClientSet.ResourceV1alpha2().ResourceClaims(f.Namespace.Name).Update(ctx, claim, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "remove claim finalizer") - }) - - claim.Status.Allocation = &resourcev1alpha2.AllocationResult{} - claim.Status.DriverName = driver.Name - claim.Status.ReservedFor = append(claim.Status.ReservedFor, resourcev1alpha2.ResourceClaimConsumerReference{ - APIGroup: "example.com", - Resource: "some", - Name: "thing", - UID: "12345", - }) - claim, err = f.ClientSet.ResourceV1alpha2().ResourceClaims(f.Namespace.Name).UpdateStatus(ctx, claim, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "update claim") - - pod := b.podExternal() + return nil + }).WithTimeout(podStartTimeout).Should(gomega.Succeed()) + + ginkgo.By("allowing container startup to succeed") + callCount := driver.CallCount(m) + driver.Fail(m, false) + err := e2epod.WaitForPodNameRunningInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace) + framework.ExpectNoError(err, "start pod with inline resource claim") + if driver.CallCount(m) == callCount { + framework.Fail("NodePrepareResources should have been called again") + } + }) - // This bypasses scheduling and therefore the pod gets - // to run on the node although it never gets added to - // the `ReservedFor` field of the claim. - pod.Spec.NodeName = nodes.NodeNames[0] - b.create(ctx, pod) + ginkgo.It("must not run a pod if a claim is not ready", func(ctx context.Context) { + claim := b.externalClaim() + b.create(ctx, claim) + pod := b.podExternal() - gomega.Consistently(ctx, func(ctx context.Context) error { - testPod, err := b.f.ClientSet.CoreV1().Pods(pod.Namespace).Get(ctx, pod.Name, metav1.GetOptions{}) - if err != nil { - return fmt.Errorf("expected the test pod %s to exist: %w", pod.Name, err) - } - if testPod.Status.Phase != v1.PodPending { - return fmt.Errorf("pod %s: unexpected status %s, expected status: %s", pod.Name, testPod.Status.Phase, v1.PodPending) - } - return nil - }, 20*time.Second, 200*time.Millisecond).Should(gomega.BeNil()) - }) + // This bypasses scheduling and therefore the pod gets + // to run on the node although the claim is not ready. + // Because the parameters are missing, the claim + // also cannot be allocated later. + pod.Spec.NodeName = nodes.NodeNames[0] + b.create(ctx, pod) - ginkgo.It("must unprepare resources for force-deleted pod", func(ctx context.Context) { - parameters := b.parameters() - claim := b.externalClaim(resourcev1alpha2.AllocationModeImmediate) - pod := b.podExternal() - zero := int64(0) - pod.Spec.TerminationGracePeriodSeconds = &zero + gomega.Consistently(ctx, func(ctx context.Context) error { + testPod, err := b.f.ClientSet.CoreV1().Pods(pod.Namespace).Get(ctx, pod.Name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("expected the test pod %s to exist: %w", pod.Name, err) + } + if testPod.Status.Phase != v1.PodPending { + return fmt.Errorf("pod %s: unexpected status %s, expected status: %s", pod.Name, testPod.Status.Phase, v1.PodPending) + } + return nil + }, 20*time.Second, 200*time.Millisecond).Should(gomega.BeNil()) + }) - b.create(ctx, parameters, claim, pod) + ginkgo.It("must unprepare resources for force-deleted pod", func(ctx context.Context) { + claim := b.externalClaim() + pod := b.podExternal() + zero := int64(0) + pod.Spec.TerminationGracePeriodSeconds = &zero - b.testPod(ctx, f.ClientSet, pod) + b.create(ctx, claim, pod) - ginkgo.By(fmt.Sprintf("force delete test pod %s", pod.Name)) - err := b.f.ClientSet.CoreV1().Pods(b.f.Namespace.Name).Delete(ctx, pod.Name, metav1.DeleteOptions{GracePeriodSeconds: &zero}) - if !apierrors.IsNotFound(err) { - framework.ExpectNoError(err, "force delete test pod") - } + b.testPod(ctx, f.ClientSet, pod) - for host, plugin := range b.driver.Nodes { - ginkgo.By(fmt.Sprintf("waiting for resources on %s to be unprepared", host)) - gomega.Eventually(plugin.GetPreparedResources).WithTimeout(time.Minute).Should(gomega.BeEmpty(), "prepared claims on host %s", host) - } - }) + ginkgo.By(fmt.Sprintf("force delete test pod %s", pod.Name)) + err := b.f.ClientSet.CoreV1().Pods(b.f.Namespace.Name).Delete(ctx, pod.Name, metav1.DeleteOptions{GracePeriodSeconds: &zero}) + if !apierrors.IsNotFound(err) { + framework.ExpectNoError(err, "force delete test pod") + } - ginkgo.It("must skip NodePrepareResource if not used by any container", func(ctx context.Context) { - parameters := b.parameters() - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - for i := range pod.Spec.Containers { - pod.Spec.Containers[i].Resources.Claims = nil - } - b.create(ctx, parameters, pod, template) - framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod), "start pod") - for host, plugin := range b.driver.Nodes { - gomega.Expect(plugin.GetPreparedResources()).Should(gomega.BeEmpty(), "not claims should be prepared on host %s while pod is running", host) - } - }) + for host, plugin := range b.driver.Nodes { + ginkgo.By(fmt.Sprintf("waiting for resources on %s to be unprepared", host)) + gomega.Eventually(plugin.GetPreparedResources).WithTimeout(time.Minute).Should(gomega.BeEmpty(), "prepared claims on host %s", host) + } + }) + ginkgo.It("must call NodePrepareResources even if not used by any container", func(ctx context.Context) { + pod, template := b.podInline() + for i := range pod.Spec.Containers { + pod.Spec.Containers[i].Resources.Claims = nil + } + b.create(ctx, pod, template) + framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod), "start pod") + for host, plugin := range b.driver.Nodes { + gomega.Expect(plugin.GetPreparedResources()).ShouldNot(gomega.BeEmpty(), "claims should be prepared on host %s while pod is running", host) + } }) }) // claimTests tries out several different combinations of pods with // claims, both inline and external. - claimTests := func(b *builder, driver *Driver, allocationMode resourcev1alpha2.AllocationMode) { + claimTests := func(b *builder, driver *Driver) { ginkgo.It("supports simple pod referencing inline resource claim", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - pod, template := b.podInline(allocationMode) - objects = append(objects, pod, template) - b.create(ctx, objects...) - - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + pod, template := b.podInline() + b.create(ctx, pod, template) + b.testPod(ctx, f.ClientSet, pod) }) ginkgo.It("supports inline claim referenced by multiple containers", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - pod, template := b.podInlineMultiple(allocationMode) - objects = append(objects, pod, template) - b.create(ctx, objects...) - - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + pod, template := b.podInlineMultiple() + b.create(ctx, pod, template) + b.testPod(ctx, f.ClientSet, pod) }) ginkgo.It("supports simple pod referencing external resource claim", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() pod := b.podExternal() - claim := b.externalClaim(allocationMode) - objects = append(objects, claim, pod) - b.create(ctx, objects...) - - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + claim := b.externalClaim() + b.create(ctx, claim, pod) + b.testPod(ctx, f.ClientSet, pod) }) ginkgo.It("supports external claim referenced by multiple pods", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() pod1 := b.podExternal() pod2 := b.podExternal() pod3 := b.podExternal() - claim := b.externalClaim(allocationMode) - objects = append(objects, claim, pod1, pod2, pod3) - b.create(ctx, objects...) + claim := b.externalClaim() + b.create(ctx, claim, pod1, pod2, pod3) for _, pod := range []*v1.Pod{pod1, pod2, pod3} { - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + b.testPod(ctx, f.ClientSet, pod) } }) ginkgo.It("supports external claim referenced by multiple containers of multiple pods", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() pod1 := b.podExternalMultiple() pod2 := b.podExternalMultiple() pod3 := b.podExternalMultiple() - claim := b.externalClaim(allocationMode) - objects = append(objects, claim, pod1, pod2, pod3) - b.create(ctx, objects...) + claim := b.externalClaim() + b.create(ctx, claim, pod1, pod2, pod3) for _, pod := range []*v1.Pod{pod1, pod2, pod3} { - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + b.testPod(ctx, f.ClientSet, pod) } }) ginkgo.It("supports init containers", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - pod, template := b.podInline(allocationMode) + pod, template := b.podInline() pod.Spec.InitContainers = []v1.Container{pod.Spec.Containers[0]} pod.Spec.InitContainers[0].Name += "-init" // This must succeed for the pod to start. pod.Spec.InitContainers[0].Command = []string{"sh", "-c", "env | grep user_a=b"} - objects = append(objects, pod, template) - b.create(ctx, objects...) + b.create(ctx, pod, template) - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + b.testPod(ctx, f.ClientSet, pod) }) ginkgo.It("removes reservation from claim when pod is done", func(ctx context.Context) { - objects, _ := b.flexibleParameters() pod := b.podExternal() - claim := b.externalClaim(allocationMode) + claim := b.externalClaim() pod.Spec.Containers[0].Command = []string{"true"} - objects = append(objects, claim, pod) - b.create(ctx, objects...) + b.create(ctx, claim, pod) ginkgo.By("waiting for pod to finish") framework.ExpectNoError(e2epod.WaitForPodNoLongerRunningInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace), "wait for pod to finish") ginkgo.By("waiting for claim to be unreserved") - gomega.Eventually(ctx, func(ctx context.Context) (*resourcev1alpha2.ResourceClaim, error) { - return f.ClientSet.ResourceV1alpha2().ResourceClaims(pod.Namespace).Get(ctx, claim.Name, metav1.GetOptions{}) + gomega.Eventually(ctx, func(ctx context.Context) (*resourceapi.ResourceClaim, error) { + return f.ClientSet.ResourceV1alpha3().ResourceClaims(pod.Namespace).Get(ctx, claim.Name, metav1.GetOptions{}) }).WithTimeout(f.Timeouts.PodDelete).Should(gomega.HaveField("Status.ReservedFor", gomega.BeEmpty()), "reservation should have been removed") }) ginkgo.It("deletes generated claims when pod is done", func(ctx context.Context) { - objects, _ := b.flexibleParameters() - pod, template := b.podInline(allocationMode) + pod, template := b.podInline() pod.Spec.Containers[0].Command = []string{"true"} - objects = append(objects, template, pod) - b.create(ctx, objects...) + b.create(ctx, template, pod) ginkgo.By("waiting for pod to finish") framework.ExpectNoError(e2epod.WaitForPodNoLongerRunningInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace), "wait for pod to finish") ginkgo.By("waiting for claim to be deleted") - gomega.Eventually(ctx, func(ctx context.Context) ([]resourcev1alpha2.ResourceClaim, error) { - claims, err := f.ClientSet.ResourceV1alpha2().ResourceClaims(pod.Namespace).List(ctx, metav1.ListOptions{}) + gomega.Eventually(ctx, func(ctx context.Context) ([]resourceapi.ResourceClaim, error) { + claims, err := f.ClientSet.ResourceV1alpha3().ResourceClaims(pod.Namespace).List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } @@ -324,12 +269,10 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("does not delete generated claims when pod is restarting", func(ctx context.Context) { - objects, _ := b.flexibleParameters() - pod, template := b.podInline(allocationMode) + pod, template := b.podInline() pod.Spec.Containers[0].Command = []string{"sh", "-c", "sleep 1; exit 1"} pod.Spec.RestartPolicy = v1.RestartPolicyAlways - objects = append(objects, template, pod) - b.create(ctx, objects...) + b.create(ctx, template, pod) ginkgo.By("waiting for pod to restart twice") gomega.Eventually(ctx, func(ctx context.Context) (*v1.Pod, error) { @@ -340,26 +283,24 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, } }) - ginkgo.It("must deallocate after use when using delayed allocation", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() + ginkgo.It("must deallocate after use", func(ctx context.Context) { pod := b.podExternal() - claim := b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - objects = append(objects, claim, pod) - b.create(ctx, objects...) + claim := b.externalClaim() + b.create(ctx, claim, pod) - gomega.Eventually(ctx, func(ctx context.Context) (*resourcev1alpha2.ResourceClaim, error) { - return b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).Get(ctx, claim.Name, metav1.GetOptions{}) - }).WithTimeout(f.Timeouts.PodDelete).ShouldNot(gomega.HaveField("Status.Allocation", (*resourcev1alpha2.AllocationResult)(nil))) + gomega.Eventually(ctx, func(ctx context.Context) (*resourceapi.ResourceClaim, error) { + return b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Get(ctx, claim.Name, metav1.GetOptions{}) + }).WithTimeout(f.Timeouts.PodDelete).ShouldNot(gomega.HaveField("Status.Allocation", (*resourceapi.AllocationResult)(nil))) - b.testPod(ctx, f.ClientSet, pod, expectedEnv...) + b.testPod(ctx, f.ClientSet, pod) ginkgo.By(fmt.Sprintf("deleting pod %s", klog.KObj(pod))) framework.ExpectNoError(b.f.ClientSet.CoreV1().Pods(b.f.Namespace.Name).Delete(ctx, pod.Name, metav1.DeleteOptions{})) ginkgo.By("waiting for claim to get deallocated") - gomega.Eventually(ctx, func(ctx context.Context) (*resourcev1alpha2.ResourceClaim, error) { - return b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).Get(ctx, claim.Name, metav1.GetOptions{}) - }).WithTimeout(f.Timeouts.PodDelete).Should(gomega.HaveField("Status.Allocation", (*resourcev1alpha2.AllocationResult)(nil))) + gomega.Eventually(ctx, func(ctx context.Context) (*resourceapi.ResourceClaim, error) { + return b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Get(ctx, claim.Name, metav1.GetOptions{}) + }).WithTimeout(f.Timeouts.PodDelete).Should(gomega.HaveField("Status.Allocation", (*resourceapi.AllocationResult)(nil))) }) } @@ -369,32 +310,28 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, numPods := 10 generateResources := func() app.Resources { resources := perNode(maxAllocations, nodes)() - resources.Shareable = true return resources } driver := NewDriver(f, nodes, generateResources) // All tests get their own driver instance. driver.parameterMode = parameterMode b := newBuilder(f, driver) - // We need the parameters name *before* creating it. - b.parametersCounter = 1 - b.classParametersName = b.parametersName() + // We have to set the parameters *before* creating the class. + b.classParameters = `{"x":"y"}` + expectedEnv := []string{"admin_x", "y"} + _, expected := b.parametersEnv() + expectedEnv = append(expectedEnv, expected...) ginkgo.It("supports claim and class parameters", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - objects = append(objects, pod, template) - - b.create(ctx, objects...) - + pod, template := b.podInline() + b.create(ctx, pod, template) b.testPod(ctx, f.ClientSet, pod, expectedEnv...) }) ginkgo.It("supports reusing resources", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() + var objects []klog.KMetadata pods := make([]*v1.Pod, numPods) for i := 0; i < numPods; i++ { - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + pod, template := b.podInline() pods[i] = pod objects = append(objects, pod, template) } @@ -412,16 +349,15 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, b.testPod(ctx, f.ClientSet, pod, expectedEnv...) err := f.ClientSet.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "delete pod") - framework.ExpectNoError(e2epod.WaitForPodNotFoundInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace, f.Timeouts.PodStartSlow)) + framework.ExpectNoError(e2epod.WaitForPodNotFoundInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace, time.Duration(numPods)*f.Timeouts.PodStartSlow)) }() } wg.Wait() }) ginkgo.It("supports sharing a claim concurrently", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - objects = append(objects, b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer)) - + var objects []klog.KMetadata + objects = append(objects, b.externalClaim()) pods := make([]*v1.Pod, numPods) for i := 0; i < numPods; i++ { pod := b.podExternal() @@ -447,19 +383,14 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) f.It("supports sharing a claim sequentially", f.WithSlow(), func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - numPods := numPods / 2 - - // Change from "shareable" to "not shareable", if possible. - switch parameterMode { - case parameterModeConfigMap: - ginkgo.Skip("cannot change the driver's controller behavior on-the-fly") - case parameterModeTranslated, parameterModeStructured: - objects[len(objects)-1].(*resourcev1alpha2.ResourceClaimParameters).Shareable = false - } - - objects = append(objects, b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer)) - + var objects []klog.KMetadata + objects = append(objects, b.externalClaim()) + + // This test used to test usage of the claim by one pod + // at a time. After removing the "not sharable" + // feature, we have to create more pods than supported + // at the same time to get the same effect. + numPods := resourceapi.ResourceClaimReservedForMaxSize + 10 pods := make([]*v1.Pod, numPods) for i := 0; i < numPods; i++ { pod := b.podExternal() @@ -488,12 +419,14 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, wg.Wait() }) - ginkgo.It("retries pod scheduling after creating resource class", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - class, err := f.ClientSet.ResourceV1alpha2().ResourceClasses().Get(ctx, template.Spec.Spec.ResourceClassName, metav1.GetOptions{}) + ginkgo.It("retries pod scheduling after creating device class", func(ctx context.Context) { + var objects []klog.KMetadata + pod, template := b.podInline() + deviceClassName := template.Spec.Spec.Devices.Requests[0].DeviceClassName + class, err := f.ClientSet.ResourceV1alpha3().DeviceClasses().Get(ctx, deviceClassName, metav1.GetOptions{}) framework.ExpectNoError(err) - template.Spec.Spec.ResourceClassName += "-b" + deviceClassName += "-b" + template.Spec.Spec.Devices.Requests[0].DeviceClassName = deviceClassName objects = append(objects, template, pod) b.create(ctx, objects...) @@ -501,33 +434,46 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, class.UID = "" class.ResourceVersion = "" - class.Name = template.Spec.Spec.ResourceClassName + class.Name = deviceClassName b.create(ctx, class) b.testPod(ctx, f.ClientSet, pod, expectedEnv...) }) - ginkgo.It("retries pod scheduling after updating resource class", func(ctx context.Context) { - objects, expectedEnv := b.flexibleParameters() - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + ginkgo.It("retries pod scheduling after updating device class", func(ctx context.Context) { + var objects []klog.KMetadata + pod, template := b.podInline() - // First modify the class so that it matches no nodes. - class, err := f.ClientSet.ResourceV1alpha2().ResourceClasses().Get(ctx, template.Spec.Spec.ResourceClassName, metav1.GetOptions{}) + // First modify the class so that it matches no nodes (for classic DRA) and no devices (structured parameters). + deviceClassName := template.Spec.Spec.Devices.Requests[0].DeviceClassName + class, err := f.ClientSet.ResourceV1alpha3().DeviceClasses().Get(ctx, deviceClassName, metav1.GetOptions{}) framework.ExpectNoError(err) - class.SuitableNodes = &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{ - { - MatchExpressions: []v1.NodeSelectorRequirement{ - { - Key: "no-such-label", - Operator: v1.NodeSelectorOpIn, - Values: []string{"no-such-value"}, + originalClass := class.DeepCopy() + switch driver.parameterMode { + case parameterModeClassicDRA: + class.Spec.SuitableNodes = &v1.NodeSelector{ + NodeSelectorTerms: []v1.NodeSelectorTerm{ + { + MatchExpressions: []v1.NodeSelectorRequirement{ + { + Key: "no-such-label", + Operator: v1.NodeSelectorOpIn, + Values: []string{"no-such-value"}, + }, }, }, }, - }, + } + case parameterModeStructured: + class.Spec.Selectors = []resourceapi.DeviceSelector{{ + CEL: &resourceapi.CELDeviceSelector{ + Expression: "false", + }, + }} + default: + framework.Failf("unexpected mode: %s", driver.parameterMode) } - class, err = f.ClientSet.ResourceV1alpha2().ResourceClasses().Update(ctx, class, metav1.UpdateOptions{}) + class, err = f.ClientSet.ResourceV1alpha3().DeviceClasses().Update(ctx, class, metav1.UpdateOptions{}) framework.ExpectNoError(err) // Now create the pod. @@ -537,15 +483,16 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, framework.ExpectNoError(e2epod.WaitForPodNameUnschedulableInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace)) // Unblock the pod. - class.SuitableNodes = nil - _, err = f.ClientSet.ResourceV1alpha2().ResourceClasses().Update(ctx, class, metav1.UpdateOptions{}) + class.Spec.SuitableNodes = originalClass.Spec.SuitableNodes + class.Spec.Selectors = originalClass.Spec.Selectors + _, err = f.ClientSet.ResourceV1alpha3().DeviceClasses().Update(ctx, class, metav1.UpdateOptions{}) framework.ExpectNoError(err) b.testPod(ctx, f.ClientSet, pod, expectedEnv...) }) ginkgo.It("runs a pod without a generated resource claim", func(ctx context.Context) { - pod, _ /* template */ := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + pod, _ /* template */ := b.podInline() created := b.create(ctx, pod) pod = created[0].(*v1.Pod) @@ -562,13 +509,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod)) }) - ginkgo.Context("with delayed allocation", func() { - claimTests(b, driver, resourcev1alpha2.AllocationModeWaitForFirstConsumer) - }) - - ginkgo.Context("with immediate allocation", func() { - claimTests(b, driver, resourcev1alpha2.AllocationModeImmediate) - }) + claimTests(b, driver) } // These tests depend on having more than one node and a DRA driver controller. @@ -577,7 +518,6 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, b := newBuilder(f, driver) ginkgo.It("schedules onto different nodes", func(ctx context.Context) { - parameters := b.parameters() label := "app.kubernetes.io/instance" instance := f.UniqueName + "-test-app" antiAffinity := &v1.Affinity{ @@ -602,8 +542,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, } pod1 := createPod() pod2 := createPod() - claim := b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - b.create(ctx, parameters, claim, pod1, pod2) + claim := b.externalClaim() + b.create(ctx, claim, pod1, pod2) for _, pod := range []*v1.Pod{pod1, pod2} { err := e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod) @@ -618,13 +558,12 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, // nodes by running `docker stop `, which is very kind-specific. f.It(f.WithSerial(), f.WithDisruptive(), f.WithSlow(), "must deallocate on non graceful node shutdown", func(ctx context.Context) { ginkgo.By("create test pod") - parameters := b.parameters() label := "app.kubernetes.io/instance" instance := f.UniqueName + "-test-app" pod := b.podExternal() pod.Labels[label] = instance - claim := b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - b.create(ctx, parameters, claim, pod) + claim := b.externalClaim() + b.create(ctx, claim, pod) ginkgo.By("wait for test pod " + pod.Name + " to run") labelSelector := labels.SelectorFromSet(labels.Set(pod.Labels)) @@ -654,7 +593,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, ginkgo.DeferCleanup(e2enode.RemoveTaintOffNode, f.ClientSet, nodeName, taint) ginkgo.By("waiting for claim to get deallocated") - gomega.Eventually(ctx, framework.GetObject(b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).Get, claim.Name, metav1.GetOptions{})).WithTimeout(f.Timeouts.PodDelete).Should(gomega.HaveField("Status.Allocation", gomega.BeNil())) + gomega.Eventually(ctx, framework.GetObject(b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Get, claim.Name, metav1.GetOptions{})).WithTimeout(f.Timeouts.PodDelete).Should(gomega.HaveField("Status.Allocation", gomega.BeNil())) }) } @@ -663,7 +602,75 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, multiNodeTests := func(parameterMode parameterMode) { nodes := NewNodes(f, 2, 8) - if parameterMode == parameterModeConfigMap { + switch parameterMode { + case parameterModeStructured: + ginkgo.Context("with different ResourceSlices", func() { + firstDevice := "pre-defined-device-01" + secondDevice := "pre-defined-device-02" + devicesPerNode := []map[string]map[resourceapi.QualifiedName]resourceapi.DeviceAttribute{ + // First node: + { + firstDevice: { + "healthy": {BoolValue: ptr.To(true)}, + "exists": {BoolValue: ptr.To(true)}, + }, + }, + // Second node: + { + secondDevice: { + "healthy": {BoolValue: ptr.To(false)}, + // Has no "exists" attribute! + }, + }, + } + driver := NewDriver(f, nodes, perNode(-1, nodes), devicesPerNode...) + b := newBuilder(f, driver) + + ginkgo.It("keeps pod pending because of CEL runtime errors", func(ctx context.Context) { + // When pod scheduling encounters CEL runtime errors for some nodes, but not all, + // it should still not schedule the pod because there is something wrong with it. + // Scheduling it would make it harder to detect that there is a problem. + // + // This matches the "CEL-runtime-error-for-subset-of-nodes" unit test, except that + // here we try it in combination with the actual scheduler and can extend it with + // other checks, like event handling (future extension). + + gomega.Eventually(ctx, framework.ListObjects(f.ClientSet.ResourceV1alpha3().ResourceSlices().List, + metav1.ListOptions{ + FieldSelector: resourceapi.ResourceSliceSelectorDriver + "=" + driver.Name, + }, + )).Should(gomega.HaveField("Items", gomega.ConsistOf( + gomega.HaveField("Spec.Devices", gomega.ConsistOf( + gomega.Equal(resourceapi.Device{ + Name: firstDevice, + Basic: &resourceapi.BasicDevice{ + Attributes: devicesPerNode[0][firstDevice], + }, + }))), + gomega.HaveField("Spec.Devices", gomega.ConsistOf( + gomega.Equal(resourceapi.Device{ + Name: firstDevice, + Basic: &resourceapi.BasicDevice{ + Attributes: devicesPerNode[0][firstDevice], + }, + }))), + ))) + + pod, template := b.podInline() + template.Spec.Spec.Devices.Requests[0].Selectors = append(template.Spec.Spec.Devices.Requests[0].Selectors, + resourceapi.DeviceSelector{ + CEL: &resourceapi.CELDeviceSelector{ + // Runtime error on one node, but not all. + Expression: fmt.Sprintf(`device.attributes["%s"].exists`, driver.Name), + }, + }, + ) + b.create(ctx, pod, template) + + framework.ExpectNoError(e2epod.WaitForPodNameUnschedulableInNamespace(ctx, f.ClientSet, pod.Name, pod.Namespace), "pod must not get scheduled because of a CEL runtime error") + }) + }) + case parameterModeClassicDRA: ginkgo.Context("with network-attached resources", func() { multiNodeDRAControllerTests(nodes) }) @@ -710,16 +717,14 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, ctx, cancel := context.WithCancel(ctx) defer cancel() - parameters1 := b.parameters() - parameters2 := b2.parameters() // Order is relevant here: each pod must be matched with its own claim. - pod1claim1 := b.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + pod1claim1 := b.externalClaim() pod1 := b.podExternal() - pod2claim1 := b2.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + pod2claim1 := b2.externalClaim() pod2 := b2.podExternal() // Add another claim to pod1. - pod1claim2 := b2.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + pod1claim2 := b2.externalClaim() pod1.Spec.ResourceClaims = append(pod1.Spec.ResourceClaims, v1.PodResourceClaim{ Name: "claim-other", @@ -744,12 +749,12 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, handler(ctx, claimAllocations, selectedNode) } - b.create(ctx, parameters1, parameters2, pod1claim1, pod1claim2, pod1) + b.create(ctx, pod1claim1, pod1claim2, pod1) ginkgo.By("waiting for one claim from driver1 to be allocated") var nodeSelector *v1.NodeSelector gomega.Eventually(ctx, func(ctx context.Context) (int, error) { - claims, err := f.ClientSet.ResourceV1alpha2().ResourceClaims(f.Namespace.Name).List(ctx, metav1.ListOptions{}) + claims, err := f.ClientSet.ResourceV1alpha3().ResourceClaims(f.Namespace.Name).List(ctx, metav1.ListOptions{}) if err != nil { return 0, err } @@ -757,7 +762,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, for _, claim := range claims.Items { if claim.Status.Allocation != nil { allocated++ - nodeSelector = claim.Status.Allocation.AvailableOnNodes + nodeSelector = claim.Status.Allocation.NodeSelector } } return allocated, nil @@ -800,51 +805,41 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, driver.parameterMode = parameterMode b := newBuilder(f, driver) - tests := func(allocationMode resourcev1alpha2.AllocationMode) { - ginkgo.It("uses all resources", func(ctx context.Context) { - objs, _ := b.flexibleParameters() - var pods []*v1.Pod - for i := 0; i < len(nodes.NodeNames); i++ { - pod, template := b.podInline(allocationMode) - pods = append(pods, pod) - objs = append(objs, pod, template) - } - b.create(ctx, objs...) + ginkgo.It("uses all resources", func(ctx context.Context) { + var objs []klog.KMetadata + var pods []*v1.Pod + for i := 0; i < len(nodes.NodeNames); i++ { + pod, template := b.podInline() + pods = append(pods, pod) + objs = append(objs, pod, template) + } + b.create(ctx, objs...) - for _, pod := range pods { - err := e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod) - framework.ExpectNoError(err, "start pod") - } + for _, pod := range pods { + err := e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod) + framework.ExpectNoError(err, "start pod") + } - // The pods all should run on different - // nodes because the maximum number of - // claims per node was limited to 1 for - // this test. - // - // We cannot know for sure why the pods - // ran on two different nodes (could - // also be a coincidence) but if they - // don't cover all nodes, then we have - // a problem. - used := make(map[string]*v1.Pod) - for _, pod := range pods { - pod, err := f.ClientSet.CoreV1().Pods(pod.Namespace).Get(ctx, pod.Name, metav1.GetOptions{}) - framework.ExpectNoError(err, "get pod") - nodeName := pod.Spec.NodeName - if other, ok := used[nodeName]; ok { - framework.Failf("Pod %s got started on the same node %s as pod %s although claim allocation should have been limited to one claim per node.", pod.Name, nodeName, other.Name) - } - used[nodeName] = pod + // The pods all should run on different + // nodes because the maximum number of + // claims per node was limited to 1 for + // this test. + // + // We cannot know for sure why the pods + // ran on two different nodes (could + // also be a coincidence) but if they + // don't cover all nodes, then we have + // a problem. + used := make(map[string]*v1.Pod) + for _, pod := range pods { + pod, err := f.ClientSet.CoreV1().Pods(pod.Namespace).Get(ctx, pod.Name, metav1.GetOptions{}) + framework.ExpectNoError(err, "get pod") + nodeName := pod.Spec.NodeName + if other, ok := used[nodeName]; ok { + framework.Failf("Pod %s got started on the same node %s as pod %s although claim allocation should have been limited to one claim per node.", pod.Name, nodeName, other.Name) } - }) - } - - ginkgo.Context("with delayed allocation", func() { - tests(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - }) - - ginkgo.Context("with immediate allocation", func() { - tests(resourcev1alpha2.AllocationModeImmediate) + used[nodeName] = pod + } }) }) } @@ -858,8 +853,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) } - ginkgo.Context("with ConfigMap parameters", func() { tests(parameterModeConfigMap) }) - ginkgo.Context("with translated parameters", func() { tests(parameterModeTranslated) }) + ginkgo.Context("with classic DRA", func() { tests(parameterModeClassicDRA) }) ginkgo.Context("with structured parameters", func() { tests(parameterModeStructured) }) // TODO (https://github.com/kubernetes/kubernetes/issues/123699): move most of the test below into `testDriver` so that they get @@ -870,16 +864,118 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, driver := NewDriver(f, nodes, networkResources) b := newBuilder(f, driver) + ginkgo.It("support validating admission policy for admin access", func(ctx context.Context) { + // Create VAP, after making it unique to the current test. + adminAccessPolicyYAML := strings.ReplaceAll(adminAccessPolicyYAML, "dra.example.com", b.f.UniqueName) + driver.createFromYAML(ctx, []byte(adminAccessPolicyYAML), "") + + // Wait for both VAPs to be processed. This ensures that there are no check errors in the status. + matchStatus := gomega.Equal(admissionregistrationv1.ValidatingAdmissionPolicyStatus{ObservedGeneration: 1, TypeChecking: &admissionregistrationv1.TypeChecking{}}) + gomega.Eventually(ctx, framework.ListObjects(b.f.ClientSet.AdmissionregistrationV1().ValidatingAdmissionPolicies().List, metav1.ListOptions{})).Should(gomega.HaveField("Items", gomega.ContainElements( + gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{ + "ObjectMeta": gomega.HaveField("Name", "resourceclaim-policy."+b.f.UniqueName), + "Status": matchStatus, + }), + gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{ + "ObjectMeta": gomega.HaveField("Name", "resourceclaimtemplate-policy."+b.f.UniqueName), + "Status": matchStatus, + }), + ))) + + // Attempt to create claim and claim template with admin access. Must fail eventually. + claim := b.externalClaim() + claim.Spec.Devices.Requests[0].AdminAccess = true + _, claimTemplate := b.podInline() + claimTemplate.Spec.Spec.Devices.Requests[0].AdminAccess = true + matchVAPError := gomega.MatchError(gomega.ContainSubstring("admin access to devices not enabled" /* in namespace " + b.f.Namespace.Name */)) + gomega.Eventually(ctx, func(ctx context.Context) error { + // First delete, in case that it succeeded earlier. + if err := b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Delete(ctx, claim.Name, metav1.DeleteOptions{}); err != nil && !apierrors.IsNotFound(err) { + return err + } + _, err := b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Create(ctx, claim, metav1.CreateOptions{}) + return err + }).Should(matchVAPError) + + gomega.Eventually(ctx, func(ctx context.Context) error { + // First delete, in case that it succeeded earlier. + if err := b.f.ClientSet.ResourceV1alpha3().ResourceClaimTemplates(b.f.Namespace.Name).Delete(ctx, claimTemplate.Name, metav1.DeleteOptions{}); err != nil && !apierrors.IsNotFound(err) { + return err + } + _, err := b.f.ClientSet.ResourceV1alpha3().ResourceClaimTemplates(b.f.Namespace.Name).Create(ctx, claimTemplate, metav1.CreateOptions{}) + return err + }).Should(matchVAPError) + + // After labeling the namespace, creation must (eventually...) succeed. + _, err := b.f.ClientSet.CoreV1().Namespaces().Apply(ctx, + applyv1.Namespace(b.f.Namespace.Name).WithLabels(map[string]string{"admin-access." + b.f.UniqueName: "on"}), + metav1.ApplyOptions{FieldManager: b.f.UniqueName}) + framework.ExpectNoError(err) + gomega.Eventually(ctx, func(ctx context.Context) error { + _, err := b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Create(ctx, claim, metav1.CreateOptions{}) + return err + }).Should(gomega.Succeed()) + gomega.Eventually(ctx, func(ctx context.Context) error { + _, err := b.f.ClientSet.ResourceV1alpha3().ResourceClaimTemplates(b.f.Namespace.Name).Create(ctx, claimTemplate, metav1.CreateOptions{}) + return err + }).Should(gomega.Succeed()) + }) + ginkgo.It("truncates the name of a generated resource claim", func(ctx context.Context) { - parameters := b.parameters() - pod, template := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + pod, template := b.podInline() pod.Name = strings.Repeat("p", 63) pod.Spec.ResourceClaims[0].Name = strings.Repeat("c", 63) pod.Spec.Containers[0].Resources.Claims[0].Name = pod.Spec.ResourceClaims[0].Name - b.create(ctx, parameters, template, pod) + b.create(ctx, template, pod) b.testPod(ctx, f.ClientSet, pod) }) + + ginkgo.It("supports count/resourceclaim.resource ResourceQuota", func(ctx context.Context) { + claim := &resourceapi.ResourceClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: "claim-0", + Namespace: f.Namespace.Name, + }, + Spec: resourceapi.ResourceClaimSpec{ + Devices: resourceapi.DeviceClaim{ + Requests: []resourceapi.DeviceRequest{{ + Name: "req-0", + DeviceClassName: "my-class", + }}, + }, + }, + } + _, err := f.ClientSet.ResourceV1alpha3().ResourceClaims(f.Namespace.Name).Create(ctx, claim, metav1.CreateOptions{}) + framework.ExpectNoError(err, "create first claim") + + resourceName := "count/resourceclaims.resource.k8s.io" + quota := &v1.ResourceQuota{ + ObjectMeta: metav1.ObjectMeta{ + Name: "object-count", + Namespace: f.Namespace.Name, + }, + Spec: v1.ResourceQuotaSpec{ + Hard: v1.ResourceList{v1.ResourceName(resourceName): resource.MustParse("1")}, + }, + } + quota, err = f.ClientSet.CoreV1().ResourceQuotas(f.Namespace.Name).Create(ctx, quota, metav1.CreateOptions{}) + framework.ExpectNoError(err, "create resource quota") + + // Eventually the quota status should consider the existing claim. + gomega.Eventually(ctx, framework.GetObject(f.ClientSet.CoreV1().ResourceQuotas(quota.Namespace).Get, quota.Name, metav1.GetOptions{})). + Should(gstruct.PointTo(gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{ + "Status": gomega.Equal(v1.ResourceQuotaStatus{ + Hard: v1.ResourceList{v1.ResourceName(resourceName): resource.MustParse("1")}, + Used: v1.ResourceList{v1.ResourceName(resourceName): resource.MustParse("1")}, + })}))) + + // Now creating another claim should fail. + claim2 := claim.DeepCopy() + claim2.Name = "claim-1" + _, err = f.ClientSet.ResourceV1alpha3().ResourceClaims(f.Namespace.Name).Create(ctx, claim2, metav1.CreateOptions{}) + gomega.Expect(err).Should(gomega.MatchError(gomega.ContainSubstring("exceeded quota: object-count, requested: count/resourceclaims.resource.k8s.io=1, used: count/resourceclaims.resource.k8s.io=1, limited: count/resourceclaims.resource.k8s.io=1")), "creating second claim not allowed") + }) }) // The following tests are all about behavior in combination with a @@ -887,228 +983,108 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, ginkgo.Context("cluster with DRA driver controller", func() { nodes := NewNodes(f, 1, 4) - ginkgo.Context("with structured parameters", func() { - driver := NewDriver(f, nodes, perNode(1, nodes)) - driver.parameterMode = parameterModeStructured - - f.It("must manage ResourceSlices", f.WithSlow(), func(ctx context.Context) { - nodeName := nodes.NodeNames[0] - driverName := driver.Name - - // Check for gRPC call on one node. If that already fails, then - // we have a fundamental problem. - m := MethodInstance{nodeName, NodeListAndWatchResourcesMethod} - ginkgo.By("wait for NodeListAndWatchResources call") - gomega.Eventually(ctx, func() int64 { - return driver.CallCount(m) - }).WithTimeout(podStartTimeout).Should(gomega.BeNumerically(">", int64(0)), "NodeListAndWatchResources call count") - - // Now check for exactly the right set of objects for all nodes. - ginkgo.By("check if ResourceSlice object(s) exist on the API server") - resourceClient := f.ClientSet.ResourceV1alpha2().ResourceSlices() - var expectedObjects []any - for _, nodeName := range nodes.NodeNames { - node, err := f.ClientSet.CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{}) - framework.ExpectNoError(err, "get node") - expectedObjects = append(expectedObjects, - gstruct.MatchAllFields(gstruct.Fields{ - "TypeMeta": gstruct.Ignore(), - "ObjectMeta": gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{ - "OwnerReferences": gomega.ContainElements( - gstruct.MatchAllFields(gstruct.Fields{ - "APIVersion": gomega.Equal("v1"), - "Kind": gomega.Equal("Node"), - "Name": gomega.Equal(nodeName), - "UID": gomega.Equal(node.UID), - "Controller": gomega.Equal(ptr.To(true)), - "BlockOwnerDeletion": gomega.BeNil(), - }), - ), - }), - "NodeName": gomega.Equal(nodeName), - "DriverName": gomega.Equal(driver.Name), - "ResourceModel": gomega.Equal(resourcev1alpha2.ResourceModel{NamedResources: &resourcev1alpha2.NamedResourcesResources{ - Instances: []resourcev1alpha2.NamedResourcesInstance{{Name: "instance-00"}}, - }}), - }), - ) - } - matchSlices := gomega.ContainElements(expectedObjects...) - getSlices := func(ctx context.Context) ([]resourcev1alpha2.ResourceSlice, error) { - slices, err := resourceClient.List(ctx, metav1.ListOptions{FieldSelector: fmt.Sprintf("driverName=%s", driverName)}) - if err != nil { - return nil, err - } - return slices.Items, nil - } - gomega.Eventually(ctx, getSlices).WithTimeout(20 * time.Second).Should(matchSlices) - gomega.Consistently(ctx, getSlices).WithTimeout(20 * time.Second).Should(matchSlices) - - // Removal of node resource slice is tested by the general driver removal code. - }) - - // TODO (https://github.com/kubernetes/kubernetes/issues/123699): more test scenarios: - // - driver returns "unimplemented" as method response - // - driver returns "Unimplemented" as part of stream - // - driver returns EOF - // - driver changes resources - // - // None of those matter if the publishing gets moved into the driver itself, - // which is the goal for 1.31 to support version skew for kubelet. - }) - - ginkgo.Context("with local unshared resources", func() { - driver := NewDriver(f, nodes, func() app.Resources { - return app.Resources{ - NodeLocal: true, - MaxAllocations: 10, - Nodes: nodes.NodeNames, - } - }) - b := newBuilder(f, driver) - - // This test covers some special code paths in the scheduler: - // - Patching the ReservedFor during PreBind because in contrast - // to claims specifically allocated for a pod, here the claim - // gets allocated without reserving it. - // - Error handling when PreBind fails: multiple attempts to bind pods - // are started concurrently, only one attempt succeeds. - // - Removing a ReservedFor entry because the first inline claim gets - // reserved during allocation. - ginkgo.It("reuses an allocated immediate claim", func(ctx context.Context) { - objects := []klog.KMetadata{ - b.parameters(), - b.externalClaim(resourcev1alpha2.AllocationModeImmediate), - } - podExternal := b.podExternal() - - // Create many pods to increase the chance that the scheduler will - // try to bind two pods at the same time. - numPods := 5 - for i := 0; i < numPods; i++ { - podInline, claimTemplate := b.podInline(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - podInline.Spec.Containers[0].Resources.Claims = append(podInline.Spec.Containers[0].Resources.Claims, podExternal.Spec.Containers[0].Resources.Claims[0]) - podInline.Spec.ResourceClaims = append(podInline.Spec.ResourceClaims, podExternal.Spec.ResourceClaims[0]) - objects = append(objects, claimTemplate, podInline) - } - b.create(ctx, objects...) - - var runningPod *v1.Pod - haveRunningPod := gcustom.MakeMatcher(func(pods []v1.Pod) (bool, error) { - numRunning := 0 - runningPod = nil - for _, pod := range pods { - if pod.Status.Phase == v1.PodRunning { - pod := pod // Don't keep pointer to loop variable... - runningPod = &pod - numRunning++ - } - } - return numRunning == 1, nil - }).WithTemplate("Expected one running Pod.\nGot instead:\n{{.FormattedActual}}") - - for i := 0; i < numPods; i++ { - ginkgo.By("waiting for exactly one pod to start") - runningPod = nil - gomega.Eventually(ctx, b.listTestPods).WithTimeout(f.Timeouts.PodStartSlow).Should(haveRunningPod) - - ginkgo.By("checking that no other pod gets scheduled") - havePendingPods := gcustom.MakeMatcher(func(pods []v1.Pod) (bool, error) { - numPending := 0 - for _, pod := range pods { - if pod.Status.Phase == v1.PodPending { - numPending++ - } - } - return numPending == numPods-1-i, nil - }).WithTemplate("Expected only one running Pod.\nGot instead:\n{{.FormattedActual}}") - gomega.Consistently(ctx, b.listTestPods).WithTimeout(time.Second).Should(havePendingPods) - - ginkgo.By(fmt.Sprintf("deleting pod %s", klog.KObj(runningPod))) - framework.ExpectNoError(b.f.ClientSet.CoreV1().Pods(b.f.Namespace.Name).Delete(ctx, runningPod.Name, metav1.DeleteOptions{})) - - ginkgo.By(fmt.Sprintf("waiting for pod %s to disappear", klog.KObj(runningPod))) - framework.ExpectNoError(e2epod.WaitForPodNotFoundInNamespace(ctx, b.f.ClientSet, runningPod.Name, runningPod.Namespace, f.Timeouts.PodDelete)) - } - }) - }) - - ginkgo.Context("with shared network resources", func() { - driver := NewDriver(f, nodes, networkResources) - b := newBuilder(f, driver) - - // This test complements "reuses an allocated immediate claim" above: - // because the claim can be shared, each PreBind attempt succeeds. - ginkgo.It("shares an allocated immediate claim", func(ctx context.Context) { - objects := []klog.KMetadata{ - b.parameters(), - b.externalClaim(resourcev1alpha2.AllocationModeImmediate), - } - // Create many pods to increase the chance that the scheduler will - // try to bind two pods at the same time. - numPods := 5 - pods := make([]*v1.Pod, numPods) - for i := 0; i < numPods; i++ { - pods[i] = b.podExternal() - objects = append(objects, pods[i]) - } - b.create(ctx, objects...) - - ginkgo.By("waiting all pods to start") - framework.ExpectNoError(e2epod.WaitForPodsRunning(ctx, b.f.ClientSet, f.Namespace.Name, numPods+len(nodes.NodeNames) /* driver(s) */, f.Timeouts.PodStartSlow)) - }) - }) - // kube-controller-manager can trigger delayed allocation for pods where the // node name was already selected when creating the pod. For immediate // allocation, the creator has to ensure that the node matches the claims. // This does not work for resource claim templates and only isn't // a problem here because the resource is network-attached and available // on all nodes. - preScheduledTests := func(b *builder, driver *Driver, allocationMode resourcev1alpha2.AllocationMode) { + preScheduledTests := func(b *builder, driver *Driver) { ginkgo.It("supports scheduled pod referencing inline resource claim", func(ctx context.Context) { - parameters := b.parameters() - pod, template := b.podInline(allocationMode) + pod, template := b.podInline() pod.Spec.NodeName = nodes.NodeNames[0] - b.create(ctx, parameters, pod, template) + b.create(ctx, pod, template) b.testPod(ctx, f.ClientSet, pod) }) ginkgo.It("supports scheduled pod referencing external resource claim", func(ctx context.Context) { - parameters := b.parameters() - claim := b.externalClaim(allocationMode) + claim := b.externalClaim() pod := b.podExternal() pod.Spec.NodeName = nodes.NodeNames[0] - b.create(ctx, parameters, claim, pod) + b.create(ctx, claim, pod) b.testPod(ctx, f.ClientSet, pod) }) } - ginkgo.Context("with delayed allocation and setting ReservedFor", func() { + ginkgo.Context("with setting ReservedFor", func() { driver := NewDriver(f, nodes, networkResources) + driver.parameterMode = parameterModeClassicDRA b := newBuilder(f, driver) - preScheduledTests(b, driver, resourcev1alpha2.AllocationModeWaitForFirstConsumer) - claimTests(b, driver, resourcev1alpha2.AllocationModeWaitForFirstConsumer) + preScheduledTests(b, driver) + claimTests(b, driver) }) - ginkgo.Context("with delayed allocation and not setting ReservedFor", func() { + ginkgo.Context("without setting ReservedFor", func() { driver := NewDriver(f, nodes, func() app.Resources { resources := networkResources() resources.DontSetReservedFor = true return resources }) + driver.parameterMode = parameterModeClassicDRA b := newBuilder(f, driver) - preScheduledTests(b, driver, resourcev1alpha2.AllocationModeWaitForFirstConsumer) - claimTests(b, driver, resourcev1alpha2.AllocationModeWaitForFirstConsumer) + preScheduledTests(b, driver) + claimTests(b, driver) }) + }) - ginkgo.Context("with immediate allocation", func() { - driver := NewDriver(f, nodes, networkResources) - b := newBuilder(f, driver) - preScheduledTests(b, driver, resourcev1alpha2.AllocationModeImmediate) - claimTests(b, driver, resourcev1alpha2.AllocationModeImmediate) + ginkgo.Context("cluster with structured parameters", func() { + nodes := NewNodes(f, 1, 4) + driver := NewDriver(f, nodes, perNode(1, nodes)) + + f.It("must manage ResourceSlices", f.WithSlow(), func(ctx context.Context) { + driverName := driver.Name + + // Now check for exactly the right set of objects for all nodes. + ginkgo.By("check if ResourceSlice object(s) exist on the API server") + resourceClient := f.ClientSet.ResourceV1alpha3().ResourceSlices() + var expectedObjects []any + for _, nodeName := range nodes.NodeNames { + node, err := f.ClientSet.CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{}) + framework.ExpectNoError(err, "get node") + expectedObjects = append(expectedObjects, + gstruct.MatchAllFields(gstruct.Fields{ + "TypeMeta": gstruct.Ignore(), + "ObjectMeta": gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{ + "OwnerReferences": gomega.ContainElements( + gstruct.MatchAllFields(gstruct.Fields{ + "APIVersion": gomega.Equal("v1"), + "Kind": gomega.Equal("Node"), + "Name": gomega.Equal(nodeName), + "UID": gomega.Equal(node.UID), + "Controller": gomega.Equal(ptr.To(true)), + "BlockOwnerDeletion": gomega.BeNil(), + }), + ), + }), + "Spec": gstruct.MatchAllFields(gstruct.Fields{ + "Driver": gomega.Equal(driver.Name), + "NodeName": gomega.Equal(nodeName), + "NodeSelector": gomega.BeNil(), + "AllNodes": gomega.BeFalseBecause("slice should be using NodeName"), + "Pool": gstruct.MatchAllFields(gstruct.Fields{ + "Name": gomega.Equal(nodeName), + "Generation": gstruct.Ignore(), + "ResourceSliceCount": gomega.Equal(int64(1)), + }), + "Devices": gomega.Equal([]resourceapi.Device{{Name: "device-00", Basic: &resourceapi.BasicDevice{}}}), + }), + }), + ) + } + matchSlices := gomega.ContainElements(expectedObjects...) + getSlices := func(ctx context.Context) ([]resourceapi.ResourceSlice, error) { + slices, err := resourceClient.List(ctx, metav1.ListOptions{FieldSelector: resourceapi.ResourceSliceSelectorDriver + "=" + driverName}) + if err != nil { + return nil, err + } + return slices.Items, nil + } + gomega.Eventually(ctx, getSlices).WithTimeout(20 * time.Second).Should(matchSlices) + gomega.Consistently(ctx, getSlices).WithTimeout(20 * time.Second).Should(matchSlices) + + // Removal of node resource slice is tested by the general driver removal code. }) }) @@ -1124,14 +1100,12 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, b2 := newBuilder(f, driver2) ginkgo.It("work", func(ctx context.Context) { - parameters1 := b1.parameters() - parameters2 := b2.parameters() - claim1 := b1.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - claim1b := b1.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - claim2 := b2.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) - claim2b := b2.externalClaim(resourcev1alpha2.AllocationModeWaitForFirstConsumer) + claim1 := b1.externalClaim() + claim1b := b1.externalClaim() + claim2 := b2.externalClaim() + claim2b := b2.externalClaim() pod := b1.podExternal() - for i, claim := range []*resourcev1alpha2.ResourceClaim{claim1b, claim2, claim2b} { + for i, claim := range []*resourceapi.ResourceClaim{claim1b, claim2, claim2b} { claim := claim pod.Spec.ResourceClaims = append(pod.Spec.ResourceClaims, v1.PodResourceClaim{ @@ -1140,7 +1114,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }, ) } - b1.create(ctx, parameters1, parameters2, claim1, claim1b, claim2, claim2b, pod) + b1.create(ctx, claim1, claim1b, claim2, claim2b, pod) b1.testPod(ctx, f.ClientSet, pod) }) } @@ -1161,36 +1135,43 @@ type builder struct { f *framework.Framework driver *Driver - podCounter int - parametersCounter int - claimCounter int - - classParametersName string + podCounter int + claimCounter int + classParameters string // JSON } -// className returns the default resource class name. +// className returns the default device class name. func (b *builder) className() string { return b.f.UniqueName + b.driver.NameSuffix + "-class" } -// class returns the resource class that the builder's other objects +// class returns the device class that the builder's other objects // reference. -func (b *builder) class() *resourcev1alpha2.ResourceClass { - class := &resourcev1alpha2.ResourceClass{ +func (b *builder) class() *resourceapi.DeviceClass { + class := &resourceapi.DeviceClass{ ObjectMeta: metav1.ObjectMeta{ Name: b.className(), }, - DriverName: b.driver.Name, - SuitableNodes: b.nodeSelector(), - StructuredParameters: ptr.To(b.driver.parameterMode != parameterModeConfigMap), } - if b.classParametersName != "" { - class.ParametersRef = &resourcev1alpha2.ResourceClassParametersReference{ - APIGroup: b.driver.parameterAPIGroup, - Kind: b.driver.classParameterAPIKind, - Name: b.classParametersName, - Namespace: b.f.Namespace.Name, - } + switch b.driver.parameterMode { + case parameterModeClassicDRA: + class.Spec.SuitableNodes = b.nodeSelector() + case parameterModeStructured: + class.Spec.Selectors = []resourceapi.DeviceSelector{{ + CEL: &resourceapi.CELDeviceSelector{ + Expression: fmt.Sprintf(`device.driver == "%s"`, b.driver.Name), + }, + }} + } + if b.classParameters != "" { + class.Spec.Config = []resourceapi.DeviceClassConfiguration{{ + DeviceConfiguration: resourceapi.DeviceConfiguration{ + Opaque: &resourceapi.OpaqueDeviceConfiguration{ + Driver: b.driver.Name, + Parameters: runtime.RawExtension{Raw: []byte(b.classParameters)}, + }, + }, + }} } return class } @@ -1215,171 +1196,55 @@ func (b *builder) nodeSelector() *v1.NodeSelector { // externalClaim returns external resource claim // that test pods can reference -func (b *builder) externalClaim(allocationMode resourcev1alpha2.AllocationMode) *resourcev1alpha2.ResourceClaim { +func (b *builder) externalClaim() *resourceapi.ResourceClaim { b.claimCounter++ name := "external-claim" + b.driver.NameSuffix // This is what podExternal expects. if b.claimCounter > 1 { name += fmt.Sprintf("-%d", b.claimCounter) } - return &resourcev1alpha2.ResourceClaim{ + // TODO: parameters + return &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: b.className(), - ParametersRef: &resourcev1alpha2.ResourceClaimParametersReference{ - APIGroup: b.driver.parameterAPIGroup, - Kind: b.driver.claimParameterAPIKind, - Name: b.parametersName(), - }, - AllocationMode: allocationMode, - }, - } -} - -// flexibleParameters returns parameter objects for claims and -// class with their type depending on the current parameter mode. -// It also returns the expected environment in a pod using -// the corresponding resource. -func (b *builder) flexibleParameters() ([]klog.KMetadata, []string) { - var objects []klog.KMetadata - switch b.driver.parameterMode { - case parameterModeConfigMap: - objects = append(objects, - b.parameters("x", "y"), - b.parameters("a", "b", "request_foo", "bar"), - ) - case parameterModeTranslated: - objects = append(objects, - b.parameters("x", "y"), - b.classParameters(b.parametersName(), "x", "y"), - b.parameters("a", "b", "request_foo", "bar"), - b.claimParameters(b.parametersName(), []string{"a", "b"}, []string{"request_foo", "bar"}), - ) - // The parameters object is not the last one but the second-last. - b.parametersCounter-- - case parameterModeStructured: - objects = append(objects, - b.classParameters("", "x", "y"), - b.claimParameters("", []string{"a", "b"}, []string{"request_foo", "bar"}), - ) - } - env := []string{"user_a", "b", "user_request_foo", "bar"} - if b.classParametersName != "" { - env = append(env, "admin_x", "y") - } - return objects, env -} - -// parametersName returns the current ConfigMap name for resource -// claim or class parameters. -func (b *builder) parametersName() string { - return fmt.Sprintf("parameters%s-%d", b.driver.NameSuffix, b.parametersCounter) -} - -// parametersEnv returns the default env variables. -func (b *builder) parametersEnv() map[string]string { - return map[string]string{ - "a": "b", - "request_foo": "bar", - } -} - -// parameters returns a config map with the default env variables. -func (b *builder) parameters(kv ...string) *v1.ConfigMap { - data := b.parameterData(kv...) - b.parametersCounter++ - return &v1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: b.f.Namespace.Name, - Name: b.parametersName(), - }, - Data: data, + Spec: b.claimSpec(), } } -func (b *builder) classParameters(generatedFrom string, kv ...string) *resourcev1alpha2.ResourceClassParameters { - raw := b.rawParameterData(kv...) - b.parametersCounter++ - parameters := &resourcev1alpha2.ResourceClassParameters{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: b.f.Namespace.Name, - Name: b.parametersName(), - }, - - VendorParameters: []resourcev1alpha2.VendorParameters{ - {DriverName: b.driver.Name, Parameters: runtime.RawExtension{Raw: raw}}, - }, - } - - if generatedFrom != "" { - parameters.GeneratedFrom = &resourcev1alpha2.ResourceClassParametersReference{ - Kind: "ConfigMap", - Namespace: b.f.Namespace.Name, - Name: generatedFrom, - } - } - - return parameters -} - -func (b *builder) claimParameters(generatedFrom string, claimKV, requestKV []string) *resourcev1alpha2.ResourceClaimParameters { - b.parametersCounter++ - parameters := &resourcev1alpha2.ResourceClaimParameters{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: b.f.Namespace.Name, - Name: b.parametersName(), - }, - - Shareable: true, - - // Without any request, nothing gets allocated and vendor - // parameters are also not passed down because they get - // attached to the allocation result. - DriverRequests: []resourcev1alpha2.DriverRequests{ - { - DriverName: b.driver.Name, - VendorParameters: runtime.RawExtension{Raw: b.rawParameterData(claimKV...)}, - Requests: []resourcev1alpha2.ResourceRequest{ - { - VendorParameters: runtime.RawExtension{Raw: b.rawParameterData(requestKV...)}, - ResourceRequestModel: resourcev1alpha2.ResourceRequestModel{ - NamedResources: &resourcev1alpha2.NamedResourcesRequest{ - Selector: "true", - }, +// claimSpec returns the device request for a claim or claim template +// with the associated config +func (b *builder) claimSpec() resourceapi.ResourceClaimSpec { + parameters, _ := b.parametersEnv() + spec := resourceapi.ResourceClaimSpec{ + Devices: resourceapi.DeviceClaim{ + Requests: []resourceapi.DeviceRequest{{ + Name: "my-request", + DeviceClassName: b.className(), + }}, + Config: []resourceapi.DeviceClaimConfiguration{{ + DeviceConfiguration: resourceapi.DeviceConfiguration{ + Opaque: &resourceapi.OpaqueDeviceConfiguration{ + Driver: b.driver.Name, + Parameters: runtime.RawExtension{ + Raw: []byte(parameters), }, }, }, - }, + }}, }, } - if generatedFrom != "" { - parameters.GeneratedFrom = &resourcev1alpha2.ResourceClaimParametersReference{ - Kind: "ConfigMap", - Name: generatedFrom, - } + if b.driver.parameterMode == parameterModeClassicDRA { + spec.Controller = b.driver.Name } - return parameters + return spec } -func (b *builder) parameterData(kv ...string) map[string]string { - data := map[string]string{} - for i := 0; i < len(kv); i += 2 { - data[kv[i]] = kv[i+1] - } - if len(data) == 0 { - data = b.parametersEnv() - } - return data -} - -func (b *builder) rawParameterData(kv ...string) []byte { - data := b.parameterData(kv...) - raw, err := json.Marshal(data) - framework.ExpectNoError(err, "JSON encoding of parameter data") - return raw +// parametersEnv returns the default user env variables as JSON (config) and key/value list (pod env). +func (b *builder) parametersEnv() (string, []string) { + return `{"a":"b"}`, + []string{"user_a", "b"} } // makePod returns a simple pod with no resource claims. @@ -1410,7 +1275,7 @@ func (b *builder) pod() *v1.Pod { } // makePodInline adds an inline resource claim with default class name and parameters. -func (b *builder) podInline(allocationMode resourcev1alpha2.AllocationMode) (*v1.Pod, *resourcev1alpha2.ResourceClaimTemplate) { +func (b *builder) podInline() (*v1.Pod, *resourceapi.ResourceClaimTemplate) { pod := b.pod() pod.Spec.Containers[0].Name = "with-resource" podClaimName := "my-inline-claim" @@ -1421,29 +1286,21 @@ func (b *builder) podInline(allocationMode resourcev1alpha2.AllocationMode) (*v1 ResourceClaimTemplateName: ptr.To(pod.Name), }, } - template := &resourcev1alpha2.ResourceClaimTemplate{ + template := &resourceapi.ResourceClaimTemplate{ ObjectMeta: metav1.ObjectMeta{ Name: pod.Name, Namespace: pod.Namespace, }, - Spec: resourcev1alpha2.ResourceClaimTemplateSpec{ - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: b.className(), - ParametersRef: &resourcev1alpha2.ResourceClaimParametersReference{ - APIGroup: b.driver.parameterAPIGroup, - Kind: b.driver.claimParameterAPIKind, - Name: b.parametersName(), - }, - AllocationMode: allocationMode, - }, + Spec: resourceapi.ResourceClaimTemplateSpec{ + Spec: b.claimSpec(), }, } return pod, template } // podInlineMultiple returns a pod with inline resource claim referenced by 3 containers -func (b *builder) podInlineMultiple(allocationMode resourcev1alpha2.AllocationMode) (*v1.Pod, *resourcev1alpha2.ResourceClaimTemplate) { - pod, template := b.podInline(allocationMode) +func (b *builder) podInlineMultiple() (*v1.Pod, *resourceapi.ResourceClaimTemplate) { + pod, template := b.podInline() pod.Spec.Containers = append(pod.Spec.Containers, *pod.Spec.Containers[0].DeepCopy(), *pod.Spec.Containers[0].DeepCopy()) pod.Spec.Containers[1].Name = pod.Spec.Containers[1].Name + "-1" pod.Spec.Containers[2].Name = pod.Spec.Containers[1].Name + "-2" @@ -1483,28 +1340,24 @@ func (b *builder) create(ctx context.Context, objs ...klog.KMetadata) []klog.KMe var err error var createdObj klog.KMetadata switch obj := obj.(type) { - case *resourcev1alpha2.ResourceClass: - createdObj, err = b.f.ClientSet.ResourceV1alpha2().ResourceClasses().Create(ctx, obj, metav1.CreateOptions{}) + case *resourceapi.DeviceClass: + createdObj, err = b.f.ClientSet.ResourceV1alpha3().DeviceClasses().Create(ctx, obj, metav1.CreateOptions{}) ginkgo.DeferCleanup(func(ctx context.Context) { - err := b.f.ClientSet.ResourceV1alpha2().ResourceClasses().Delete(ctx, createdObj.GetName(), metav1.DeleteOptions{}) - framework.ExpectNoError(err, "delete resource class") + err := b.f.ClientSet.ResourceV1alpha3().DeviceClasses().Delete(ctx, createdObj.GetName(), metav1.DeleteOptions{}) + framework.ExpectNoError(err, "delete device class") }) case *v1.Pod: createdObj, err = b.f.ClientSet.CoreV1().Pods(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) case *v1.ConfigMap: createdObj, err = b.f.ClientSet.CoreV1().ConfigMaps(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) - case *resourcev1alpha2.ResourceClaim: - createdObj, err = b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) - case *resourcev1alpha2.ResourceClaimTemplate: - createdObj, err = b.f.ClientSet.ResourceV1alpha2().ResourceClaimTemplates(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) - case *resourcev1alpha2.ResourceClassParameters: - createdObj, err = b.f.ClientSet.ResourceV1alpha2().ResourceClassParameters(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) - case *resourcev1alpha2.ResourceClaimParameters: - createdObj, err = b.f.ClientSet.ResourceV1alpha2().ResourceClaimParameters(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) - case *resourcev1alpha2.ResourceSlice: - createdObj, err = b.f.ClientSet.ResourceV1alpha2().ResourceSlices().Create(ctx, obj, metav1.CreateOptions{}) + case *resourceapi.ResourceClaim: + createdObj, err = b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) + case *resourceapi.ResourceClaimTemplate: + createdObj, err = b.f.ClientSet.ResourceV1alpha3().ResourceClaimTemplates(b.f.Namespace.Name).Create(ctx, obj, metav1.CreateOptions{}) + case *resourceapi.ResourceSlice: + createdObj, err = b.f.ClientSet.ResourceV1alpha3().ResourceSlices().Create(ctx, obj, metav1.CreateOptions{}) ginkgo.DeferCleanup(func(ctx context.Context) { - err := b.f.ClientSet.ResourceV1alpha2().ResourceSlices().Delete(ctx, createdObj.GetName(), metav1.DeleteOptions{}) + err := b.f.ClientSet.ResourceV1alpha3().ResourceSlices().Delete(ctx, createdObj.GetName(), metav1.DeleteOptions{}) framework.ExpectNoError(err, "delete node resource slice") }) default: @@ -1525,15 +1378,11 @@ func (b *builder) testPod(ctx context.Context, clientSet kubernetes.Interface, p log, err := e2epod.GetPodLogs(ctx, clientSet, pod.Namespace, pod.Name, container.Name) framework.ExpectNoError(err, "get logs") if len(env) == 0 { - for key, value := range b.parametersEnv() { - envStr := fmt.Sprintf("\nuser_%s=%s\n", key, value) - gomega.Expect(log).To(gomega.ContainSubstring(envStr), "container env variables") - } - } else { - for i := 0; i < len(env); i += 2 { - envStr := fmt.Sprintf("\n%s=%s\n", env[i], env[i+1]) - gomega.Expect(log).To(gomega.ContainSubstring(envStr), "container env variables") - } + _, env = b.parametersEnv() + } + for i := 0; i < len(env); i += 2 { + envStr := fmt.Sprintf("\n%s=%s\n", env[i], env[i+1]) + gomega.Expect(log).To(gomega.ContainSubstring(envStr), "container env variables") } } } @@ -1548,7 +1397,6 @@ func newBuilder(f *framework.Framework, driver *Driver) *builder { func (b *builder) setUp() { b.podCounter = 0 - b.parametersCounter = 0 b.claimCounter = 0 b.create(context.Background(), b.class()) ginkgo.DeferCleanup(b.tearDown) @@ -1576,14 +1424,14 @@ func (b *builder) tearDown(ctx context.Context) { return b.listTestPods(ctx) }).WithTimeout(time.Minute).Should(gomega.BeEmpty(), "remaining pods despite deletion") - claims, err := b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).List(ctx, metav1.ListOptions{}) + claims, err := b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).List(ctx, metav1.ListOptions{}) framework.ExpectNoError(err, "get resource claims") for _, claim := range claims.Items { if claim.DeletionTimestamp != nil { continue } ginkgo.By(fmt.Sprintf("deleting %T %s", &claim, klog.KObj(&claim))) - err := b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).Delete(ctx, claim.Name, metav1.DeleteOptions{}) + err := b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).Delete(ctx, claim.Name, metav1.DeleteOptions{}) if !apierrors.IsNotFound(err) { framework.ExpectNoError(err, "delete claim") } @@ -1595,8 +1443,8 @@ func (b *builder) tearDown(ctx context.Context) { } ginkgo.By("waiting for claims to be deallocated and deleted") - gomega.Eventually(func() ([]resourcev1alpha2.ResourceClaim, error) { - claims, err := b.f.ClientSet.ResourceV1alpha2().ResourceClaims(b.f.Namespace.Name).List(ctx, metav1.ListOptions{}) + gomega.Eventually(func() ([]resourceapi.ResourceClaim, error) { + claims, err := b.f.ClientSet.ResourceV1alpha3().ResourceClaims(b.f.Namespace.Name).List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } diff --git a/test/e2e/dra/kind.yaml b/test/e2e/dra/kind.yaml index 59884ed31b56c..80146fe1fc76e 100644 --- a/test/e2e/dra/kind.yaml +++ b/test/e2e/dra/kind.yaml @@ -14,12 +14,13 @@ nodes: scheduler: extraArgs: v: "5" + vmodule: "allocator=6,dynamicresources=6" # structured/allocator.go, DRA scheduler plugin controllerManager: extraArgs: v: "5" apiServer: extraArgs: - runtime-config: "resource.k8s.io/v1alpha2=true" + runtime-config: "resource.k8s.io/v1alpha3=true" - | kind: InitConfiguration nodeRegistration: diff --git a/test/e2e/dra/test-driver/README.md b/test/e2e/dra/test-driver/README.md index a8362f5850cea..baa275897c12c 100644 --- a/test/e2e/dra/test-driver/README.md +++ b/test/e2e/dra/test-driver/README.md @@ -55,7 +55,7 @@ kubelet<->dynamic resource allocation plugin interaction. To try out the feature, build Kubernetes, then in one console run: ```console -RUNTIME_CONFIG="resource.k8s.io/v1alpha2" FEATURE_GATES=DynamicResourceAllocation=true ALLOW_PRIVILEGED=1 ./hack/local-up-cluster.sh -O +RUNTIME_CONFIG="resource.k8s.io/v1alpha3" FEATURE_GATES=DynamicResourceAllocation=true ALLOW_PRIVILEGED=1 ./hack/local-up-cluster.sh -O ``` In another: @@ -66,7 +66,7 @@ go run ./test/e2e/dra/test-driver --feature-gates ContextualLogging=true -v=5 co In yet another: ```console sudo mkdir -p /var/run/cdi && sudo chmod a+rwx /var/run/cdi /var/lib/kubelet/plugins_registry -go run ./test/e2e/dra/test-driver --feature-gates ContextualLogging=true -v=5 kubelet-plugin +go run ./test/e2e/dra/test-driver --feature-gates ContextualLogging=true -v=5 kubelet-plugin --node-name=127.0.0.1 ``` And finally: diff --git a/test/e2e/dra/test-driver/app/controller.go b/test/e2e/dra/test-driver/app/controller.go index e094ac7894f4c..b3398bd13a295 100644 --- a/test/e2e/dra/test-driver/app/controller.go +++ b/test/e2e/dra/test-driver/app/controller.go @@ -20,16 +20,13 @@ package app import ( "context" - "encoding/json" "errors" "fmt" - "math/rand" - "strings" + "slices" "sync" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + resourceapi "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/informers" @@ -48,9 +45,10 @@ type Resources struct { Nodes []string // NodeLabels are labels which determine on which nodes resources are // available. Mutually exclusive with Nodes. - NodeLabels labels.Set + NodeLabels labels.Set + + // Number of devices called "device-000", "device-001", ... on each node or in the cluster. MaxAllocations int - Shareable bool // AllocateWrapper, if set, gets called for each Allocate call. AllocateWrapper AllocateWrapperType @@ -69,14 +67,16 @@ func (r Resources) AllNodes(nodeLister listersv1.NodeLister) []string { return r.Nodes } -func (r Resources) NewAllocation(node string, data []byte) *resourcev1alpha2.AllocationResult { - allocation := &resourcev1alpha2.AllocationResult{ - Shareable: r.Shareable, - } - allocation.ResourceHandles = []resourcev1alpha2.ResourceHandle{ - { - DriverName: r.DriverName, - Data: string(data), +func (r Resources) newAllocation(requestName, node string, config []resourceapi.DeviceAllocationConfiguration) *resourceapi.AllocationResult { + allocation := &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: []resourceapi.DeviceRequestAllocationResult{{ + Driver: r.DriverName, + Pool: "none", + Request: requestName, + Device: "none", + }}, + Config: config, }, } if node == "" && len(r.NodeLabels) > 0 { @@ -89,7 +89,7 @@ func (r Resources) NewAllocation(node string, data []byte) *resourcev1alpha2.All Values: []string{value}, }) } - allocation.AvailableOnNodes = &v1.NodeSelector{ + allocation.NodeSelector = &v1.NodeSelector{ NodeSelectorTerms: []v1.NodeSelectorTerm{ { MatchExpressions: requirements, @@ -106,7 +106,7 @@ func (r Resources) NewAllocation(node string, data []byte) *resourcev1alpha2.All nodes = r.Nodes } if len(nodes) > 0 { - allocation.AvailableOnNodes = &v1.NodeSelector{ + allocation.NodeSelector = &v1.NodeSelector{ NodeSelectorTerms: []v1.NodeSelectorTerm{ { MatchExpressions: []v1.NodeSelectorRequirement{ @@ -169,11 +169,6 @@ func (c *ExampleController) Run(ctx context.Context, workers int) { informerFactory.Shutdown() } -type parameters struct { - EnvVars map[string]string - NodeName string -} - var _ controller.Driver = &ExampleController{} // GetNumAllocations returns the number of times that a claim was allocated. @@ -196,36 +191,6 @@ func (c *ExampleController) GetNumDeallocations() int64 { return c.numDeallocations } -func (c *ExampleController) GetClassParameters(ctx context.Context, class *resourcev1alpha2.ResourceClass) (interface{}, error) { - if class.ParametersRef != nil { - if class.ParametersRef.APIGroup != "" || - class.ParametersRef.Kind != "ConfigMap" { - return nil, fmt.Errorf("class parameters are only supported in APIVersion v1, Kind ConfigMap, got: %v", class.ParametersRef) - } - return c.readParametersFromConfigMap(ctx, class.ParametersRef.Namespace, class.ParametersRef.Name) - } - return nil, nil -} - -func (c *ExampleController) GetClaimParameters(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, class *resourcev1alpha2.ResourceClass, classParameters interface{}) (interface{}, error) { - if claim.Spec.ParametersRef != nil { - if claim.Spec.ParametersRef.APIGroup != "" || - claim.Spec.ParametersRef.Kind != "ConfigMap" { - return nil, fmt.Errorf("claim parameters are only supported in APIVersion v1, Kind ConfigMap, got: %v", claim.Spec.ParametersRef) - } - return c.readParametersFromConfigMap(ctx, claim.Namespace, claim.Spec.ParametersRef.Name) - } - return nil, nil -} - -func (c *ExampleController) readParametersFromConfigMap(ctx context.Context, namespace, name string) (map[string]string, error) { - configMap, err := c.clientset.CoreV1().ConfigMaps(namespace).Get(ctx, name, metav1.GetOptions{}) - if err != nil { - return nil, fmt.Errorf("get config map: %w", err) - } - return configMap.Data, nil -} - func (c *ExampleController) Allocate(ctx context.Context, claimAllocations []*controller.ClaimAllocation, selectedNode string) { if c.resources.AllocateWrapper != nil { @@ -239,7 +204,7 @@ func (c *ExampleController) Allocate(ctx context.Context, claimAllocations []*co func (c *ExampleController) allocateOneByOne(ctx context.Context, claimAllocations []*controller.ClaimAllocation, selectedNode string) { for _, ca := range claimAllocations { - allocationResult, err := c.allocateOne(ctx, ca.Claim, ca.ClaimParameters, ca.Class, ca.ClassParameters, selectedNode) + allocationResult, err := c.allocateOne(ctx, ca.Claim, ca.DeviceClasses, selectedNode) if err != nil { ca.Error = err continue @@ -249,12 +214,25 @@ func (c *ExampleController) allocateOneByOne(ctx context.Context, claimAllocatio } // allocate simply copies parameters as JSON map into a ResourceHandle. -func (c *ExampleController) allocateOne(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, claimParameters interface{}, class *resourcev1alpha2.ResourceClass, classParameters interface{}, selectedNode string) (result *resourcev1alpha2.AllocationResult, err error) { +func (c *ExampleController) allocateOne(ctx context.Context, claim *resourceapi.ResourceClaim, deviceClasses map[string]*resourceapi.DeviceClass, selectedNode string) (result *resourceapi.AllocationResult, err error) { logger := klog.LoggerWithValues(klog.LoggerWithName(klog.FromContext(ctx), "Allocate"), "claim", klog.KObj(claim), "uid", claim.UID) defer func() { logger.V(3).Info("done", "result", result, "err", err) }() + if len(claim.Spec.Devices.Requests) != 1 || + claim.Spec.Devices.Requests[0].DeviceClassName == "" || + claim.Spec.Devices.Requests[0].CountMode != resourceapi.DeviceCountModeExact || + claim.Spec.Devices.Requests[0].Count != 1 { + return nil, errors.New("only claims requesting exactly one device are supported") + } + request := claim.Spec.Devices.Requests[0] + class := deviceClasses[request.DeviceClassName] + if len(request.Selectors) > 0 || + class != nil && len(class.Spec.Selectors) > 0 { + return nil, errors.New("device selectors are not supported") + } + c.mutex.Lock() defer c.mutex.Unlock() @@ -270,24 +248,7 @@ func (c *ExampleController) allocateOne(ctx context.Context, claim *resourcev1al nodes := c.resources.AllNodes(c.nodeLister) if c.resources.NodeLocal { node = selectedNode - if node == "" { - // If none has been selected because we do immediate allocation, - // then we need to pick one ourselves. - var viableNodes []string - for _, n := range nodes { - if c.resources.MaxAllocations == 0 || - c.claimsPerNode[n] < c.resources.MaxAllocations { - viableNodes = append(viableNodes, n) - } - } - if len(viableNodes) == 0 { - return nil, errors.New("resources exhausted on all nodes") - } - // Pick randomly. We could also prefer the one with the least - // number of allocations (even spreading) or the most (packing). - node = viableNodes[rand.Intn(len(viableNodes))] - logger.V(3).Info("picked a node ourselves", "selectedNode", selectedNode) - } else if !contains(nodes, node) || + if !slices.Contains(nodes, node) || c.resources.MaxAllocations > 0 && c.claimsPerNode[node] >= c.resources.MaxAllocations { return nil, fmt.Errorf("resources exhausted on node %q", node) @@ -300,17 +261,47 @@ func (c *ExampleController) allocateOne(ctx context.Context, claim *resourcev1al } } - p := parameters{ - EnvVars: make(map[string]string), - NodeName: node, + var configs []resourceapi.DeviceAllocationConfiguration + for i, config := range claim.Spec.Devices.Config { + if len(config.Requests) != 0 && + !slices.Contains(config.Requests, request.Name) { + // Does not apply to request. + continue + } + if config.Opaque == nil { + return nil, fmt.Errorf("claim config #%d: only opaque configuration supported", i) + } + if config.Opaque.Driver != c.resources.DriverName { + // Does not apply to driver. + continue + } + // A normal driver would validate the config here. The test + // driver just passes it through. + configs = append(configs, + resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClaim, + DeviceConfiguration: config.DeviceConfiguration, + }, + ) } - toEnvVars("user", claimParameters, p.EnvVars) - toEnvVars("admin", classParameters, p.EnvVars) - data, err := json.Marshal(p) - if err != nil { - return nil, fmt.Errorf("encode parameters: %w", err) + if class != nil { + for i, config := range class.Spec.Config { + if config.Opaque == nil { + return nil, fmt.Errorf("class config #%d: only opaque configuration supported", i) + } + if config.Opaque.Driver != c.resources.DriverName { + // Does not apply to driver. + continue + } + configs = append(configs, + resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClass, + DeviceConfiguration: config.DeviceConfiguration, + }, + ) + } } - allocation := c.resources.NewAllocation(node, data) + allocation := c.resources.newAllocation(request.Name, node, configs) if !alreadyAllocated { c.numAllocations++ c.allocated[claim.UID] = node @@ -319,7 +310,7 @@ func (c *ExampleController) allocateOne(ctx context.Context, claim *resourcev1al return allocation, nil } -func (c *ExampleController) Deallocate(ctx context.Context, claim *resourcev1alpha2.ResourceClaim) error { +func (c *ExampleController) Deallocate(ctx context.Context, claim *resourceapi.ResourceClaim) error { logger := klog.LoggerWithValues(klog.LoggerWithName(klog.FromContext(ctx), "Deallocate"), "claim", klog.KObj(claim), "uid", claim.UID) c.mutex.Lock() defer c.mutex.Unlock() @@ -362,7 +353,7 @@ func (c *ExampleController) UnsuitableNodes(ctx context.Context, pod *v1.Pod, cl // can only work if a node has capacity left // for all of them. Also, nodes that the driver // doesn't run on cannot be used. - if !contains(nodes, node) || + if !slices.Contains(nodes, node) || c.claimsPerNode[node]+len(claims) > c.resources.MaxAllocations { claim.UnsuitableNodes = append(claim.UnsuitableNodes, node) } @@ -375,7 +366,7 @@ func (c *ExampleController) UnsuitableNodes(ctx context.Context, pod *v1.Pod, cl for _, claim := range claims { claim.UnsuitableNodes = nil for _, node := range potentialNodes { - if !contains(nodes, node) || + if !slices.Contains(nodes, node) || allocations+len(claims) > c.resources.MaxAllocations { claim.UnsuitableNodes = append(claim.UnsuitableNodes, node) } @@ -384,24 +375,3 @@ func (c *ExampleController) UnsuitableNodes(ctx context.Context, pod *v1.Pod, cl return nil } - -func toEnvVars(what string, from interface{}, to map[string]string) { - if from == nil { - return - } - - env := from.(map[string]string) - for key, value := range env { - to[what+"_"+strings.ToLower(key)] = value - } -} - -func contains[T comparable](list []T, value T) bool { - for _, v := range list { - if v == value { - return true - } - } - - return false -} diff --git a/test/e2e/dra/test-driver/app/kubeletplugin.go b/test/e2e/dra/test-driver/app/kubeletplugin.go index 2656a45e10d82..a6db33cb3c57a 100644 --- a/test/e2e/dra/test-driver/app/kubeletplugin.go +++ b/test/e2e/dra/test-driver/app/kubeletplugin.go @@ -23,37 +23,39 @@ import ( "fmt" "os" "path/filepath" + "slices" + "sort" "strings" "sync" - "github.com/google/go-cmp/cmp" "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - resourceapi "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/client-go/kubernetes" "k8s.io/dynamic-resource-allocation/kubeletplugin" "k8s.io/klog/v2" - drapbv1alpha3 "k8s.io/kubelet/pkg/apis/dra/v1alpha3" + drapb "k8s.io/kubelet/pkg/apis/dra/v1alpha4" ) type ExamplePlugin struct { - stopCh <-chan struct{} - logger klog.Logger - d kubeletplugin.DRAPlugin - fileOps FileOperations + stopCh <-chan struct{} + logger klog.Logger + kubeClient kubernetes.Interface + d kubeletplugin.DRAPlugin + fileOps FileOperations - cdiDir string - driverName string - nodeName string - instances sets.Set[string] + cdiDir string + driverName string + nodeName string + deviceNames sets.Set[string] - mutex sync.Mutex - instancesInUse sets.Set[string] - prepared map[ClaimID]any - gRPCCalls []GRPCCall + mutex sync.Mutex + prepared map[ClaimID][]Device // prepared claims -> result of nodePrepareResource + gRPCCalls []GRPCCall blockPrepareResourcesMutex sync.Mutex blockUnprepareResourcesMutex sync.Mutex @@ -87,11 +89,18 @@ type ClaimID struct { UID string } -var _ drapbv1alpha3.NodeServer = &ExamplePlugin{} +type Device struct { + PoolName string + DeviceName string + RequestName string + CDIDeviceID string +} + +var _ drapb.NodeServer = &ExamplePlugin{} // getJSONFilePath returns the absolute path where CDI file is/should be. -func (ex *ExamplePlugin) getJSONFilePath(claimUID string) string { - return filepath.Join(ex.cdiDir, fmt.Sprintf("%s-%s.json", ex.driverName, claimUID)) +func (ex *ExamplePlugin) getJSONFilePath(claimUID string, requestName string) string { + return filepath.Join(ex.cdiDir, fmt.Sprintf("%s-%s-%s.json", ex.driverName, claimUID, requestName)) } // FileOperations defines optional callbacks for handling CDI files @@ -104,15 +113,19 @@ type FileOperations struct { // file does not exist. Remove func(name string) error - // NumResourceInstances determines whether the plugin reports resources - // instances and how many. A negative value causes it to report "not implemented" - // in the NodeListAndWatchResources gRPC call. - NumResourceInstances int + // NumDevices determines whether the plugin reports devices + // and how many. It reports nothing if negative. + NumDevices int + + // Pre-defined devices, with each device name mapped to + // the device attributes. Not used if NumDevices >= 0. + Devices map[string]map[resourceapi.QualifiedName]resourceapi.DeviceAttribute } // StartPlugin sets up the servers that are necessary for a DRA kubelet plugin. -func StartPlugin(ctx context.Context, cdiDir, driverName string, nodeName string, fileOps FileOperations, opts ...kubeletplugin.Option) (*ExamplePlugin, error) { +func StartPlugin(ctx context.Context, cdiDir, driverName string, kubeClient kubernetes.Interface, nodeName string, fileOps FileOperations, opts ...kubeletplugin.Option) (*ExamplePlugin, error) { logger := klog.FromContext(ctx) + if fileOps.Create == nil { fileOps.Create = func(name string, content []byte) error { return os.WriteFile(name, content, os.FileMode(0644)) @@ -127,33 +140,62 @@ func StartPlugin(ctx context.Context, cdiDir, driverName string, nodeName string } } ex := &ExamplePlugin{ - stopCh: ctx.Done(), - logger: logger, - fileOps: fileOps, - cdiDir: cdiDir, - driverName: driverName, - nodeName: nodeName, - instances: sets.New[string](), - instancesInUse: sets.New[string](), - prepared: make(map[ClaimID]any), + stopCh: ctx.Done(), + logger: logger, + kubeClient: kubeClient, + fileOps: fileOps, + cdiDir: cdiDir, + driverName: driverName, + nodeName: nodeName, + prepared: make(map[ClaimID][]Device), + deviceNames: sets.New[string](), } - for i := 0; i < ex.fileOps.NumResourceInstances; i++ { - ex.instances.Insert(fmt.Sprintf("instance-%02d", i)) + for i := 0; i < ex.fileOps.NumDevices; i++ { + ex.deviceNames.Insert(fmt.Sprintf("device-%02d", i)) + } + for deviceName := range ex.fileOps.Devices { + ex.deviceNames.Insert(deviceName) } - opts = append(opts, - kubeletplugin.Logger(logger), kubeletplugin.DriverName(driverName), + kubeletplugin.NodeName(nodeName), + kubeletplugin.KubeClient(kubeClient), kubeletplugin.GRPCInterceptor(ex.recordGRPCCall), kubeletplugin.GRPCStreamInterceptor(ex.recordGRPCStream), ) - d, err := kubeletplugin.Start(ex, opts...) + d, err := kubeletplugin.Start(ctx, ex, opts...) if err != nil { return nil, fmt.Errorf("start kubelet plugin: %w", err) } ex.d = d + if fileOps.NumDevices >= 0 { + devices := make([]resourceapi.Device, ex.fileOps.NumDevices) + for i := 0; i < ex.fileOps.NumDevices; i++ { + devices[i] = resourceapi.Device{ + Name: fmt.Sprintf("device-%02d", i), + Basic: &resourceapi.BasicDevice{}, + } + } + resources := kubeletplugin.Resources{ + Devices: devices, + } + ex.d.PublishResources(ctx, resources) + } else if len(ex.fileOps.Devices) > 0 { + devices := make([]resourceapi.Device, len(ex.fileOps.Devices)) + for i, deviceName := range sets.List(ex.deviceNames) { + devices[i] = resourceapi.Device{ + Name: deviceName, + Basic: &resourceapi.BasicDevice{Attributes: ex.fileOps.Devices[deviceName]}, + } + } + resources := kubeletplugin.Resources{ + Devices: devices, + } + ex.d.PublishResources(ctx, resources) + } + return ex, nil } @@ -226,128 +268,123 @@ func (ex *ExamplePlugin) getUnprepareResourcesFailure() error { return ex.unprepareResourcesFailure } -// NodePrepareResource ensures that the CDI file for the claim exists. It uses +// NodePrepareResource ensures that the CDI file(s) (one per request) for the claim exists. It uses // a deterministic name to simplify NodeUnprepareResource (no need to remember // or discover the name) and idempotency (when called again, the file simply // gets written again). -func (ex *ExamplePlugin) nodePrepareResource(ctx context.Context, claimName string, claimUID string, resourceHandle string, structuredResourceHandle []*resourceapi.StructuredResourceHandle) ([]string, error) { +func (ex *ExamplePlugin) nodePrepareResource(ctx context.Context, claimReq *drapb.Claim) ([]Device, error) { logger := klog.FromContext(ctx) + // The plugin must retrieve the claim itself to get it in the version + // that it understands. + claim, err := ex.kubeClient.ResourceV1alpha3().ResourceClaims(claimReq.Namespace).Get(ctx, claimReq.Name, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("retrieve claim %s/%s: %w", claimReq.Namespace, claimReq.Name, err) + } + if claim.Status.Allocation == nil { + return nil, fmt.Errorf("claim %s/%s not allocated", claimReq.Namespace, claimReq.Name) + } + if claim.UID != types.UID(claimReq.Uid) { + return nil, fmt.Errorf("claim %s/%s got replaced", claimReq.Namespace, claimReq.Name) + } + ex.mutex.Lock() defer ex.mutex.Unlock() ex.blockPrepareResourcesMutex.Lock() defer ex.blockPrepareResourcesMutex.Unlock() - deviceName := "claim-" + claimUID - vendor := ex.driverName - class := "test" - dev := vendor + "/" + class + "=" + deviceName - claimID := ClaimID{Name: claimName, UID: claimUID} - if _, ok := ex.prepared[claimID]; ok { + claimID := ClaimID{Name: claimReq.Name, UID: claimReq.Uid} + if result, ok := ex.prepared[claimID]; ok { // Idempotent call, nothing to do. - return []string{dev}, nil - } - - // Determine environment variables. - var p parameters - var actualResourceHandle any - var instanceNames []string - switch len(structuredResourceHandle) { - case 0: - // Control plane controller did the allocation. - if err := json.Unmarshal([]byte(resourceHandle), &p); err != nil { - return nil, fmt.Errorf("unmarshal resource handle: %w", err) - } - actualResourceHandle = resourceHandle - case 1: - // Scheduler did the allocation with structured parameters. - handle := structuredResourceHandle[0] - if handle == nil { - return nil, errors.New("unexpected nil StructuredResourceHandle") - } - p.NodeName = handle.NodeName - if err := extractParameters(handle.VendorClassParameters, &p.EnvVars, "admin"); err != nil { - return nil, err - } - if err := extractParameters(handle.VendorClaimParameters, &p.EnvVars, "user"); err != nil { - return nil, err - } - for _, result := range handle.Results { - if err := extractParameters(result.VendorRequestParameters, &p.EnvVars, "user"); err != nil { - return nil, err - } - namedResources := result.NamedResources - if namedResources == nil { - return nil, errors.New("missing named resources allocation result") - } - instanceName := namedResources.Name - if instanceName == "" { - return nil, errors.New("empty named resources instance name") - } - if !ex.instances.Has(instanceName) { - return nil, fmt.Errorf("unknown allocated instance %q", instanceName) + return result, nil + } + + var devices []Device + for _, result := range claim.Status.Allocation.Devices.Results { + requestName := result.Request + + // The driver joins all env variables in the order in which + // they appear in results (last one wins). + env := make(map[string]string) + for i, config := range claim.Status.Allocation.Devices.Config { + if config.Opaque == nil || + config.Opaque.Driver != ex.driverName || + len(config.Requests) > 0 && !slices.Contains(config.Requests, requestName) { + continue } - if ex.instancesInUse.Has(instanceName) { - return nil, fmt.Errorf("resource instance %q used more than once", instanceName) + if err := extractParameters(config.Opaque.Parameters, &env, config.Source == resourceapi.AllocationConfigSourceClass); err != nil { + return nil, fmt.Errorf("parameters in config #%d: %w", i, err) } - instanceNames = append(instanceNames, instanceName) } - actualResourceHandle = handle - default: - // Huh? - return nil, fmt.Errorf("invalid length of NodePrepareResourceRequest.StructuredResourceHandle: %d", len(structuredResourceHandle)) - } - // Sanity check scheduling. - if p.NodeName != "" && ex.nodeName != "" && p.NodeName != ex.nodeName { - return nil, fmt.Errorf("claim was allocated for %q, cannot be prepared on %q", p.NodeName, ex.nodeName) - } + deviceName := "claim-" + claimReq.Uid + "-" + requestName + vendor := ex.driverName + class := "test" + cdiDeviceID := vendor + "/" + class + "=" + deviceName - // CDI wants env variables as set of strings. - envs := []string{} - for key, val := range p.EnvVars { - envs = append(envs, key+"="+val) - } + // CDI wants env variables as set of strings. + envs := []string{} + for key, val := range env { + envs = append(envs, key+"="+val) + } + sort.Strings(envs) + + if len(envs) == 0 { + // CDI does not support empty ContainerEdits. For example, + // kubelet+crio then fail with: + // CDI device injection failed: unresolvable CDI devices ... + // + // Inject nothing instead, which is supported by DRA. + continue + } - spec := &spec{ - Version: "0.3.0", // This has to be a version accepted by the runtimes. - Kind: vendor + "/" + class, - // At least one device is required and its entry must have more - // than just the name. - Devices: []device{ - { - Name: deviceName, - ContainerEdits: containerEdits{ - Env: envs, + spec := &spec{ + Version: "0.3.0", // This has to be a version accepted by the runtimes. + Kind: vendor + "/" + class, + // At least one device is required and its entry must have more + // than just the name. + Devices: []device{ + { + Name: deviceName, + ContainerEdits: containerEdits{ + Env: envs, + }, }, }, - }, - } - filePath := ex.getJSONFilePath(claimUID) - buffer, err := json.Marshal(spec) - if err != nil { - return nil, fmt.Errorf("marshal spec: %w", err) - } - if err := ex.fileOps.Create(filePath, buffer); err != nil { - return nil, fmt.Errorf("failed to write CDI file %v", err) - } - - ex.prepared[claimID] = actualResourceHandle - for _, instanceName := range instanceNames { - ex.instancesInUse.Insert(instanceName) + } + filePath := ex.getJSONFilePath(claimReq.Uid, requestName) + buffer, err := json.Marshal(spec) + if err != nil { + return nil, fmt.Errorf("marshal spec: %w", err) + } + if err := ex.fileOps.Create(filePath, buffer); err != nil { + return nil, fmt.Errorf("failed to write CDI file: %w", err) + } + device := Device{ + PoolName: result.Pool, + DeviceName: result.Device, + RequestName: requestName, + CDIDeviceID: cdiDeviceID, + } + devices = append(devices, device) } - logger.V(3).Info("CDI file created", "path", filePath, "device", dev) - return []string{dev}, nil + logger.V(3).Info("CDI file(s) created", "devices", devices) + ex.prepared[claimID] = devices + return devices, nil } -func extractParameters(parameters runtime.RawExtension, env *map[string]string, kind string) error { +func extractParameters(parameters runtime.RawExtension, env *map[string]string, admin bool) error { if len(parameters.Raw) == 0 { return nil } + kind := "user" + if admin { + kind = "admin" + } var data map[string]string if err := json.Unmarshal(parameters.Raw, &data); err != nil { - return fmt.Errorf("decoding %s parameters: %v", kind, err) + return fmt.Errorf("decoding %s parameters: %w", kind, err) } if len(data) > 0 && *env == nil { *env = make(map[string]string) @@ -358,9 +395,9 @@ func extractParameters(parameters runtime.RawExtension, env *map[string]string, return nil } -func (ex *ExamplePlugin) NodePrepareResources(ctx context.Context, req *drapbv1alpha3.NodePrepareResourcesRequest) (*drapbv1alpha3.NodePrepareResourcesResponse, error) { - resp := &drapbv1alpha3.NodePrepareResourcesResponse{ - Claims: make(map[string]*drapbv1alpha3.NodePrepareResourceResponse), +func (ex *ExamplePlugin) NodePrepareResources(ctx context.Context, req *drapb.NodePrepareResourcesRequest) (*drapb.NodePrepareResourcesResponse, error) { + resp := &drapb.NodePrepareResourcesResponse{ + Claims: make(map[string]*drapb.NodePrepareResourceResponse), } if failure := ex.getPrepareResourcesFailure(); failure != nil { @@ -368,15 +405,23 @@ func (ex *ExamplePlugin) NodePrepareResources(ctx context.Context, req *drapbv1a } for _, claimReq := range req.Claims { - cdiDevices, err := ex.nodePrepareResource(ctx, claimReq.Name, claimReq.Uid, claimReq.ResourceHandle, claimReq.StructuredResourceHandle) + devices, err := ex.nodePrepareResource(ctx, claimReq) if err != nil { - resp.Claims[claimReq.Uid] = &drapbv1alpha3.NodePrepareResourceResponse{ + resp.Claims[claimReq.Uid] = &drapb.NodePrepareResourceResponse{ Error: err.Error(), } } else { - resp.Claims[claimReq.Uid] = &drapbv1alpha3.NodePrepareResourceResponse{ - CDIDevices: cdiDevices, + r := &drapb.NodePrepareResourceResponse{} + for _, device := range devices { + pbDevice := &drapb.Device{ + PoolName: device.PoolName, + DeviceName: device.DeviceName, + RequestNames: []string{device.RequestName}, + CDIDeviceIDs: []string{device.CDIDeviceID}, + } + r.Devices = append(r.Devices, pbDevice) } + resp.Claims[claimReq.Uid] = r } } return resp, nil @@ -385,55 +430,35 @@ func (ex *ExamplePlugin) NodePrepareResources(ctx context.Context, req *drapbv1a // NodeUnprepareResource removes the CDI file created by // NodePrepareResource. It's idempotent, therefore it is not an error when that // file is already gone. -func (ex *ExamplePlugin) nodeUnprepareResource(ctx context.Context, claimName string, claimUID string, resourceHandle string, structuredResourceHandle []*resourceapi.StructuredResourceHandle) error { +func (ex *ExamplePlugin) nodeUnprepareResource(ctx context.Context, claimReq *drapb.Claim) error { ex.blockUnprepareResourcesMutex.Lock() defer ex.blockUnprepareResourcesMutex.Unlock() logger := klog.FromContext(ctx) - filePath := ex.getJSONFilePath(claimUID) - if err := ex.fileOps.Remove(filePath); err != nil { - return fmt.Errorf("error removing CDI file: %w", err) - } - logger.V(3).Info("CDI file removed", "path", filePath) - - ex.mutex.Lock() - defer ex.mutex.Unlock() - - claimID := ClaimID{Name: claimName, UID: claimUID} - expectedResourceHandle, ok := ex.prepared[claimID] + claimID := ClaimID{Name: claimReq.Name, UID: claimReq.Uid} + devices, ok := ex.prepared[claimID] if !ok { // Idempotent call, nothing to do. return nil } - var actualResourceHandle any = resourceHandle - if structuredResourceHandle != nil { - if len(structuredResourceHandle) != 1 { - return fmt.Errorf("unexpected number of entries in StructuredResourceHandle: %d", len(structuredResourceHandle)) + for _, device := range devices { + filePath := ex.getJSONFilePath(claimReq.Uid, device.RequestName) + if err := ex.fileOps.Remove(filePath); err != nil { + return fmt.Errorf("error removing CDI file: %w", err) } - actualResourceHandle = structuredResourceHandle[0] - } - if diff := cmp.Diff(expectedResourceHandle, actualResourceHandle); diff != "" { - return fmt.Errorf("difference between expected (-) and actual resource handle (+):\n%s", diff) + logger.V(3).Info("CDI file removed", "path", filePath) } + delete(ex.prepared, claimID) - if structuredResourceHandle := structuredResourceHandle; structuredResourceHandle != nil { - for _, handle := range structuredResourceHandle { - for _, result := range handle.Results { - instanceName := result.NamedResources.Name - ex.instancesInUse.Delete(instanceName) - } - } - } - delete(ex.prepared, ClaimID{Name: claimName, UID: claimUID}) return nil } -func (ex *ExamplePlugin) NodeUnprepareResources(ctx context.Context, req *drapbv1alpha3.NodeUnprepareResourcesRequest) (*drapbv1alpha3.NodeUnprepareResourcesResponse, error) { - resp := &drapbv1alpha3.NodeUnprepareResourcesResponse{ - Claims: make(map[string]*drapbv1alpha3.NodeUnprepareResourceResponse), +func (ex *ExamplePlugin) NodeUnprepareResources(ctx context.Context, req *drapb.NodeUnprepareResourcesRequest) (*drapb.NodeUnprepareResourcesResponse, error) { + resp := &drapb.NodeUnprepareResourcesResponse{ + Claims: make(map[string]*drapb.NodeUnprepareResourceResponse), } if failure := ex.getUnprepareResourcesFailure(); failure != nil { @@ -441,51 +466,18 @@ func (ex *ExamplePlugin) NodeUnprepareResources(ctx context.Context, req *drapbv } for _, claimReq := range req.Claims { - err := ex.nodeUnprepareResource(ctx, claimReq.Name, claimReq.Uid, claimReq.ResourceHandle, claimReq.StructuredResourceHandle) + err := ex.nodeUnprepareResource(ctx, claimReq) if err != nil { - resp.Claims[claimReq.Uid] = &drapbv1alpha3.NodeUnprepareResourceResponse{ + resp.Claims[claimReq.Uid] = &drapb.NodeUnprepareResourceResponse{ Error: err.Error(), } } else { - resp.Claims[claimReq.Uid] = &drapbv1alpha3.NodeUnprepareResourceResponse{} + resp.Claims[claimReq.Uid] = &drapb.NodeUnprepareResourceResponse{} } } return resp, nil } -func (ex *ExamplePlugin) NodeListAndWatchResources(req *drapbv1alpha3.NodeListAndWatchResourcesRequest, stream drapbv1alpha3.Node_NodeListAndWatchResourcesServer) error { - if ex.fileOps.NumResourceInstances < 0 { - ex.logger.Info("Sending no NodeResourcesResponse") - return status.New(codes.Unimplemented, "node resource support disabled").Err() - } - - instances := make([]resourceapi.NamedResourcesInstance, len(ex.instances)) - for i, name := range sets.List(ex.instances) { - instances[i].Name = name - } - resp := &drapbv1alpha3.NodeListAndWatchResourcesResponse{ - Resources: []*resourceapi.ResourceModel{ - { - NamedResources: &resourceapi.NamedResourcesResources{ - Instances: instances, - }, - }, - }, - } - - ex.logger.Info("Sending NodeListAndWatchResourcesResponse", "response", resp) - if err := stream.Send(resp); err != nil { - return err - } - - // Keep the stream open until the test is done. - // TODO: test sending more updates later - <-ex.stopCh - ex.logger.Info("Done sending NodeListAndWatchResourcesResponse, closing stream") - - return nil -} - func (ex *ExamplePlugin) GetPreparedResources() []ClaimID { ex.mutex.Lock() defer ex.mutex.Unlock() diff --git a/test/e2e/dra/test-driver/app/server.go b/test/e2e/dra/test-driver/app/server.go index 3f55c5414634c..cb0cb4c3696a3 100644 --- a/test/e2e/dra/test-driver/app/server.go +++ b/test/e2e/dra/test-driver/app/server.go @@ -21,6 +21,7 @@ package app import ( "context" "encoding/json" + "errors" "fmt" "net" "net/http" @@ -272,6 +273,7 @@ func NewCommand() *cobra.Command { draAddress := fs.String("dra-address", "/var/lib/kubelet/plugins/test-driver/dra.sock", "The Unix domain socket that kubelet will connect to for dynamic resource allocation requests, in the filesystem of kubelet.") fs = kubeletPluginFlagSets.FlagSet("CDI") cdiDir := fs.String("cdi-dir", "/var/run/cdi", "directory for dynamically created CDI JSON files") + nodeName := fs.String("node-name", "", "name of the node that the kubelet plugin is responsible for") fs = kubeletPlugin.Flags() for _, f := range kubeletPluginFlagSets.FlagSets { fs.AddFlagSet(f) @@ -287,7 +289,11 @@ func NewCommand() *cobra.Command { return fmt.Errorf("create socket directory: %w", err) } - plugin, err := StartPlugin(cmd.Context(), *cdiDir, *driverName, "", FileOperations{}, + if *nodeName == "" { + return errors.New("--node-name not set") + } + + plugin, err := StartPlugin(cmd.Context(), *cdiDir, *driverName, clientset, *nodeName, FileOperations{}, kubeletplugin.PluginSocketPath(*endpoint), kubeletplugin.RegistrarSocketPath(path.Join(*pluginRegistrationPath, *driverName+"-reg.sock")), kubeletplugin.KubeletPluginSocketPath(*draAddress), diff --git a/test/e2e/dra/test-driver/deploy/example/admin-access-policy.yaml b/test/e2e/dra/test-driver/deploy/example/admin-access-policy.yaml new file mode 100644 index 0000000000000..133dd2caf78fc --- /dev/null +++ b/test/e2e/dra/test-driver/deploy/example/admin-access-policy.yaml @@ -0,0 +1,71 @@ +# This example shows how to use a validating admission policy (VAP) +# to control who may use "admin access", a privileged mode which +# grants access to devices which are currently in use, potentially +# by some other user. +# +# The policy applies in any namespace which does not have the +# "admin-access.dra.example.com" label. Other ways of making that decision are +# also possible. +# +# Cluster administrators need to adapt at least the names and replace +# "dra.example.com". + +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingAdmissionPolicy +metadata: + name: resourceclaim-policy.dra.example.com +spec: + failurePolicy: Fail + matchConstraints: + resourceRules: + - apiGroups: ["resource.k8s.io"] + apiVersions: ["v1alpha3"] + operations: ["CREATE", "UPDATE"] + resources: ["resourceclaims"] + validations: + - expression: '! object.spec.devices.requests.exists(e, has(e.adminAccess) && e.adminAccess)' + reason: Forbidden + messageExpression: '"admin access to devices not enabled"' # in namespace " + object.metadata.namespace' - need to use __namespace__, but somehow that also doesn't work. +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingAdmissionPolicyBinding +metadata: + name: resourceclaim-binding.dra.example.com +spec: + policyName: resourceclaim-policy.dra.example.com + validationActions: [Deny] + matchResources: + namespaceSelector: + matchExpressions: + - key: admin-access.dra.example.com + operator: DoesNotExist +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingAdmissionPolicy +metadata: + name: resourceclaimtemplate-policy.dra.example.com +spec: + failurePolicy: Fail + matchConstraints: + resourceRules: + - apiGroups: ["resource.k8s.io"] + apiVersions: ["v1alpha3"] + operations: ["CREATE", "UPDATE"] + resources: ["resourceclaimtemplates"] + validations: + - expression: '! object.spec.spec.devices.requests.exists(e, has(e.adminAccess) && e.adminAccess)' + reason: Forbidden + messageExpression: '"admin access to devices not enabled"' # in namespace " + object.metadata.namespace' - need to use __namespace__, but somehow that also doesn't work. +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingAdmissionPolicyBinding +metadata: + name: resourceclaimtemplate-binding.dra.example.com +spec: + policyName: resourceclaimtemplate-policy.dra.example.com + validationActions: [Deny] + matchResources: + namespaceSelector: + matchExpressions: + - key: admin-access.dra.example.com + operator: DoesNotExist diff --git a/test/e2e/dra/test-driver/deploy/example/broken-resourceclass.yaml b/test/e2e/dra/test-driver/deploy/example/broken-resourceclass.yaml index c6cf1c2ec9e96..0cfb6d6ee7663 100644 --- a/test/e2e/dra/test-driver/deploy/example/broken-resourceclass.yaml +++ b/test/e2e/dra/test-driver/deploy/example/broken-resourceclass.yaml @@ -2,7 +2,7 @@ # When using it instead of a functional one, scheduling a pod leads to: # Warning FailedScheduling 16s default-scheduler 0/1 nodes are available: 1 excluded via potential node filter in resource class. -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClass metadata: name: example diff --git a/test/e2e/dra/test-driver/deploy/example/deviceclass.yaml b/test/e2e/dra/test-driver/deploy/example/deviceclass.yaml new file mode 100644 index 0000000000000..44f4fcf468689 --- /dev/null +++ b/test/e2e/dra/test-driver/deploy/example/deviceclass.yaml @@ -0,0 +1,8 @@ +apiVersion: resource.k8s.io/v1alpha3 +kind: ResourceClass +metadata: + name: example +spec: + selectors: + - cel: + expression: device.driver == "test-driver.cdi.k8s.io" diff --git a/test/e2e/dra/test-driver/deploy/example/plugin-rbac.yaml b/test/e2e/dra/test-driver/deploy/example/plugin-rbac.yaml new file mode 100644 index 0000000000000..3259ba87a08b3 --- /dev/null +++ b/test/e2e/dra/test-driver/deploy/example/plugin-rbac.yaml @@ -0,0 +1,36 @@ +# Real driver deployments must replace all occurrences of "dra-kubelet-plugin" +# with something specific to their driver. + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: dra-kubelet-plugin-service-account + namespace: default +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: dra-kubelet-plugin-role +rules: +- apiGroups: ["resource.k8s.io"] + resources: ["resourceclaims"] + verbs: ["get"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get"] +- apiGroups: ["resource.k8s.io"] + resources: ["resourceslices"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete" ] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: dra-kubelet-plugin-role-binding +subjects: +- kind: ServiceAccount + name: dra-kubelet-plugin-service-account + namespace: default +roleRef: + kind: ClusterRole + name: dra-kubelet-plugin-role + apiGroup: rbac.authorization.k8s.io diff --git a/test/e2e/dra/test-driver/deploy/example/pod-external.yaml b/test/e2e/dra/test-driver/deploy/example/pod-external.yaml index 4901a4810dd14..304dd903d4ee9 100644 --- a/test/e2e/dra/test-driver/deploy/example/pod-external.yaml +++ b/test/e2e/dra/test-driver/deploy/example/pod-external.yaml @@ -8,7 +8,7 @@ metadata: data: a: b --- -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaim metadata: name: external-claim diff --git a/test/e2e/dra/test-driver/deploy/example/pod-inline-multiple.yaml b/test/e2e/dra/test-driver/deploy/example/pod-inline-multiple.yaml index 10e4503ee77a7..a859834cb6bee 100644 --- a/test/e2e/dra/test-driver/deploy/example/pod-inline-multiple.yaml +++ b/test/e2e/dra/test-driver/deploy/example/pod-inline-multiple.yaml @@ -6,7 +6,7 @@ metadata: data: a: b --- -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: name: pause-template diff --git a/test/e2e/dra/test-driver/deploy/example/pod-inline.yaml b/test/e2e/dra/test-driver/deploy/example/pod-inline.yaml index 8248cd6333a72..10619b12e3e52 100644 --- a/test/e2e/dra/test-driver/deploy/example/pod-inline.yaml +++ b/test/e2e/dra/test-driver/deploy/example/pod-inline.yaml @@ -8,7 +8,7 @@ metadata: data: a: b --- -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: name: test-inline-claim-template diff --git a/test/e2e/dra/test-driver/deploy/example/pod-shared.yaml b/test/e2e/dra/test-driver/deploy/example/pod-shared.yaml index 54b120c28cddb..164ed41fa6073 100644 --- a/test/e2e/dra/test-driver/deploy/example/pod-shared.yaml +++ b/test/e2e/dra/test-driver/deploy/example/pod-shared.yaml @@ -8,7 +8,7 @@ metadata: data: a: b --- -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaim metadata: name: shared-claim diff --git a/test/e2e/dra/test-driver/deploy/example/resourceclaim.yaml b/test/e2e/dra/test-driver/deploy/example/resourceclaim.yaml index 705891324c910..ec965e847e224 100644 --- a/test/e2e/dra/test-driver/deploy/example/resourceclaim.yaml +++ b/test/e2e/dra/test-driver/deploy/example/resourceclaim.yaml @@ -1,19 +1,10 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: example-claim-parameters - namespace: default -data: - a: b ---- -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaim metadata: name: example namespace: default spec: - allocationMode: Immediate - resourceClassName: example - parametersRef: - kind: ConfigMap - name: example-claim-parameters + devices: + requests: + - name: req-0 + deviceClassName: example diff --git a/test/e2e/dra/test-driver/deploy/example/resourceclass.yaml b/test/e2e/dra/test-driver/deploy/example/resourceclass.yaml deleted file mode 100644 index 948b39fb18f6e..0000000000000 --- a/test/e2e/dra/test-driver/deploy/example/resourceclass.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha2 -kind: ResourceClass -metadata: - name: example -driverName: test-driver.cdi.k8s.io -# TODO: -# parameters diff --git a/test/e2e_node/dra_test.go b/test/e2e_node/dra_test.go index 871f11e4abeb2..a737169e8ec8e 100644 --- a/test/e2e_node/dra_test.go +++ b/test/e2e_node/dra_test.go @@ -34,10 +34,14 @@ import ( "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" + "github.com/onsi/gomega/gstruct" + "github.com/onsi/gomega/types" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes" "k8s.io/klog/v2" draplugin "k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin" @@ -66,14 +70,19 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, f := framework.NewDefaultFramework("dra-node") f.NamespacePodSecurityLevel = admissionapi.LevelBaseline - var kubeletPlugin, kubeletPlugin1, kubeletPlugin2 *testdriver.ExamplePlugin - - f.Context("Resource Kubelet Plugin", f.WithSerial(), func() { - ginkgo.BeforeEach(func(ctx context.Context) { - kubeletPlugin = newKubeletPlugin(ctx, getNodeName(ctx, f), driverName) + ginkgo.BeforeEach(func() { + ginkgo.DeferCleanup(func(ctx context.Context) { + // When plugin and kubelet get killed at the end of the tests, they leave ResourceSlices behind. + // Perhaps garbage collection would eventually remove them (not sure how the node instance + // is managed), but this could take time. Let's clean up explicitly. + framework.ExpectNoError(f.ClientSet.ResourceV1alpha3().ResourceSlices().DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{})) }) + }) + f.Context("Resource Kubelet Plugin", f.WithSerial(), func() { ginkgo.It("must register after Kubelet restart", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + oldCalls := kubeletPlugin.GetGRPCCalls() getNewCalls := func() []testdriver.GRPCCall { calls := kubeletPlugin.GetGRPCCalls() @@ -88,16 +97,21 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must register after plugin restart", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + ginkgo.By("restart Kubelet Plugin") kubeletPlugin.Stop() - kubeletPlugin = newKubeletPlugin(ctx, getNodeName(ctx, f), driverName) + kubeletPlugin = newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) ginkgo.By("wait for Kubelet plugin re-registration") gomega.Eventually(kubeletPlugin.GetGRPCCalls).WithTimeout(pluginRegistrationTimeout).Should(testdriver.BeRegistered) }) ginkgo.It("must process pod created when kubelet is not running", func(ctx context.Context) { + newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + // Stop Kubelet + ginkgo.By("stop kubelet") startKubelet := stopKubelet() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{driverName}) // Pod must be in pending state @@ -106,6 +120,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) framework.ExpectNoError(err) // Start Kubelet + ginkgo.By("restart kubelet") startKubelet() // Pod should succeed err = e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, pod.Name, f.Namespace.Name, framework.PodStartShortTimeout) @@ -113,6 +128,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must keep pod in pending state if NodePrepareResources times out", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unblock := kubeletPlugin.BlockNodePrepareResources() defer unblock() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{driverName}) @@ -131,6 +148,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must run pod if NodePrepareResources fails and then succeeds", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unset := kubeletPlugin.SetNodePrepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{driverName}) @@ -154,6 +173,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must run pod if NodeUnprepareResources fails and then succeeds", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unset := kubeletPlugin.SetNodeUnprepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{driverName}) @@ -174,6 +195,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must retry NodePrepareResources after Kubelet restart", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unset := kubeletPlugin.SetNodePrepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{driverName}) @@ -203,6 +226,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must retry NodeUnprepareResources after Kubelet restart", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unset := kubeletPlugin.SetNodeUnprepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{driverName}) ginkgo.By("wait for NodePrepareResources call to succeed") @@ -228,6 +253,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must call NodeUnprepareResources for deleted pod", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unset := kubeletPlugin.SetNodeUnprepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", false, []string{driverName}) @@ -250,6 +277,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must call NodeUnprepareResources for deleted pod after Kubelet restart", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unset := kubeletPlugin.SetNodeUnprepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", false, []string{driverName}) @@ -279,6 +308,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must not call NodePrepareResources for deleted pod after Kubelet restart", func(ctx context.Context) { + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unblock := kubeletPlugin.BlockNodePrepareResources() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", false, []string{driverName}) @@ -306,16 +337,21 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) f.Context("Two resource Kubelet Plugins", f.WithSerial(), func() { - ginkgo.BeforeEach(func(ctx context.Context) { - kubeletPlugin1 = newKubeletPlugin(ctx, getNodeName(ctx, f), kubeletPlugin1Name) - kubeletPlugin2 = newKubeletPlugin(ctx, getNodeName(ctx, f), kubeletPlugin2Name) + // start creates plugins which will get stopped when the context gets canceled. + start := func(ctx context.Context) (*testdriver.ExamplePlugin, *testdriver.ExamplePlugin) { + kubeletPlugin1 := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), kubeletPlugin1Name) + kubeletPlugin2 := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), kubeletPlugin2Name) ginkgo.By("wait for Kubelet plugin registration") gomega.Eventually(kubeletPlugin1.GetGRPCCalls()).WithTimeout(pluginRegistrationTimeout).Should(testdriver.BeRegistered) gomega.Eventually(kubeletPlugin2.GetGRPCCalls()).WithTimeout(pluginRegistrationTimeout).Should(testdriver.BeRegistered) - }) + + return kubeletPlugin1, kubeletPlugin2 + } ginkgo.It("must prepare and unprepare resources", func(ctx context.Context) { + kubeletPlugin1, kubeletPlugin2 := start(ctx) + pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{kubeletPlugin1Name, kubeletPlugin2Name}) ginkgo.By("wait for pod to succeed") @@ -332,6 +368,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must run pod if NodePrepareResources fails for one plugin and then succeeds", func(ctx context.Context) { + _, kubeletPlugin2 := start(ctx) + unset := kubeletPlugin2.SetNodePrepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{kubeletPlugin1Name, kubeletPlugin2Name}) @@ -355,6 +393,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must run pod if NodeUnprepareResources fails for one plugin and then succeeds", func(ctx context.Context) { + kubeletPlugin1, kubeletPlugin2 := start(ctx) + unset := kubeletPlugin2.SetNodeUnprepareResourcesFailureMode() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{kubeletPlugin1Name, kubeletPlugin2Name}) @@ -378,6 +418,9 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must run pod if NodePrepareResources is in progress for one plugin when Kubelet restarts", func(ctx context.Context) { + _, kubeletPlugin2 := start(ctx) + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + unblock := kubeletPlugin.BlockNodePrepareResources() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{kubeletPlugin1Name, kubeletPlugin2Name}) @@ -401,6 +444,8 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }) ginkgo.It("must call NodeUnprepareResources again if it's in progress for one plugin when Kubelet restarts", func(ctx context.Context) { + kubeletPlugin1, kubeletPlugin2 := start(ctx) + unblock := kubeletPlugin2.BlockNodeUnprepareResources() pod := createTestObjects(ctx, f.ClientSet, getNodeName(ctx, f), f.Namespace.Name, "draclass", "external-claim", "drapod", true, []string{kubeletPlugin1Name, kubeletPlugin2Name}) @@ -423,10 +468,70 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, framework.ExpectNoError(err) }) }) + + f.Context("ResourceSlice", f.WithSerial(), func() { + listResources := func(ctx context.Context) ([]resourceapi.ResourceSlice, error) { + slices, err := f.ClientSet.ResourceV1alpha3().ResourceSlices().List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + return slices.Items, nil + } + + matchResourcesByNodeName := func(nodeName string) types.GomegaMatcher { + return gstruct.MatchFields(gstruct.IgnoreExtras, gstruct.Fields{ + "NodeName": gomega.Equal(nodeName), + }) + } + + f.It("must be removed on kubelet startup", f.WithDisruptive(), func(ctx context.Context) { + ginkgo.By("stop kubelet") + startKubelet := stopKubelet() + ginkgo.DeferCleanup(func() { + if startKubelet != nil { + startKubelet() + } + }) + + ginkgo.By("create some ResourceSlices") + nodeName := getNodeName(ctx, f) + otherNodeName := nodeName + "-other" + createTestResourceSlice(ctx, f.ClientSet, nodeName, driverName) + createTestResourceSlice(ctx, f.ClientSet, nodeName+"-other", driverName) + + matchAll := gomega.ConsistOf(matchResourcesByNodeName(nodeName), matchResourcesByNodeName(otherNodeName)) + matchOtherNode := gomega.ConsistOf(matchResourcesByNodeName(otherNodeName)) + + gomega.Consistently(ctx, listResources).WithTimeout(5*time.Second).Should(matchAll, "ResourceSlices without kubelet") + + ginkgo.By("start kubelet") + startKubelet() + startKubelet = nil + + ginkgo.By("wait for exactly the node's ResourceSlice to get deleted") + gomega.Eventually(ctx, listResources).Should(matchOtherNode, "ResourceSlices with kubelet") + gomega.Consistently(ctx, listResources).WithTimeout(5*time.Second).Should(matchOtherNode, "ResourceSlices with kubelet") + }) + + f.It("must be removed after plugin unregistration", func(ctx context.Context) { + nodeName := getNodeName(ctx, f) + matchNode := gomega.ConsistOf(matchResourcesByNodeName(nodeName)) + + ginkgo.By("start plugin and wait for ResourceSlice") + kubeletPlugin := newKubeletPlugin(ctx, f.ClientSet, getNodeName(ctx, f), driverName) + gomega.Eventually(ctx, listResources).Should(matchNode, "ResourceSlice from kubelet plugin") + gomega.Consistently(ctx, listResources).WithTimeout(5*time.Second).Should(matchNode, "ResourceSlice from kubelet plugin") + + ginkgo.By("stop plugin and wait for ResourceSlice removal") + kubeletPlugin.Stop() + gomega.Eventually(ctx, listResources).Should(gomega.BeEmpty(), "ResourceSlices with no plugin") + gomega.Consistently(ctx, listResources).WithTimeout(5*time.Second).Should(gomega.BeEmpty(), "ResourceSlices with no plugin") + }) + }) }) // Run Kubelet plugin and wait until it's registered -func newKubeletPlugin(ctx context.Context, nodeName, pluginName string) *testdriver.ExamplePlugin { +func newKubeletPlugin(ctx context.Context, clientSet kubernetes.Interface, nodeName, pluginName string) *testdriver.ExamplePlugin { ginkgo.By("start Kubelet plugin") logger := klog.LoggerWithValues(klog.LoggerWithName(klog.Background(), "kubelet plugin "+pluginName), "node", nodeName) ctx = klog.NewContext(ctx, logger) @@ -444,7 +549,8 @@ func newKubeletPlugin(ctx context.Context, nodeName, pluginName string) *testdri ctx, cdiDir, pluginName, - "", + clientSet, + nodeName, testdriver.FileOperations{}, kubeletplugin.PluginSocketPath(endpoint), kubeletplugin.RegistrarSocketPath(path.Join(pluginRegistrationPath, pluginName+"-reg.sock")), @@ -454,6 +560,11 @@ func newKubeletPlugin(ctx context.Context, nodeName, pluginName string) *testdri gomega.Eventually(plugin.GetGRPCCalls).WithTimeout(pluginRegistrationTimeout).Should(testdriver.BeRegistered) + ginkgo.DeferCleanup(func(ctx context.Context) { + // kubelet should do this eventually, but better make sure. + // A separate test checks this explicitly. + framework.ExpectNoError(clientSet.ResourceV1alpha3().ResourceSlices().DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{FieldSelector: resourceapi.ResourceSliceSelectorDriver + "=" + driverName})) + }) ginkgo.DeferCleanup(plugin.Stop) return plugin @@ -463,33 +574,37 @@ func newKubeletPlugin(ctx context.Context, nodeName, pluginName string) *testdri // NOTE: as scheduler and controller manager are not running by the Node e2e, // the objects must contain all required data to be processed correctly by the API server // and placed on the node without involving the scheduler and the DRA controller -func createTestObjects(ctx context.Context, clientSet kubernetes.Interface, nodename, namespace, className, claimName, podName string, deferPodDeletion bool, pluginNames []string) *v1.Pod { - // ResourceClass - class := &resourcev1alpha2.ResourceClass{ +func createTestObjects(ctx context.Context, clientSet kubernetes.Interface, nodename, namespace, className, claimName, podName string, deferPodDeletion bool, driverNames []string) *v1.Pod { + // DeviceClass + class := &resourceapi.DeviceClass{ ObjectMeta: metav1.ObjectMeta{ Name: className, }, - DriverName: "controller", } - _, err := clientSet.ResourceV1alpha2().ResourceClasses().Create(ctx, class, metav1.CreateOptions{}) + _, err := clientSet.ResourceV1alpha3().DeviceClasses().Create(ctx, class, metav1.CreateOptions{}) framework.ExpectNoError(err) - ginkgo.DeferCleanup(clientSet.ResourceV1alpha2().ResourceClasses().Delete, className, metav1.DeleteOptions{}) + ginkgo.DeferCleanup(clientSet.ResourceV1alpha3().DeviceClasses().Delete, className, metav1.DeleteOptions{}) // ResourceClaim podClaimName := "resource-claim" - claim := &resourcev1alpha2.ResourceClaim{ + claim := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Name: claimName, }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: className, + Spec: resourceapi.ResourceClaimSpec{ + Devices: resourceapi.DeviceClaim{ + Requests: []resourceapi.DeviceRequest{{ + Name: "my-request", + DeviceClassName: className, + }}, + }, }, } - createdClaim, err := clientSet.ResourceV1alpha2().ResourceClaims(namespace).Create(ctx, claim, metav1.CreateOptions{}) + createdClaim, err := clientSet.ResourceV1alpha3().ResourceClaims(namespace).Create(ctx, claim, metav1.CreateOptions{}) framework.ExpectNoError(err) - ginkgo.DeferCleanup(clientSet.ResourceV1alpha2().ResourceClaims(namespace).Delete, claimName, metav1.DeleteOptions{}) + ginkgo.DeferCleanup(clientSet.ResourceV1alpha3().ResourceClaims(namespace).Delete, claimName, metav1.DeleteOptions{}) // Pod containerName := "testcontainer" @@ -527,25 +642,62 @@ func createTestObjects(ctx context.Context, clientSet kubernetes.Interface, node } // Update claim status: set ReservedFor and AllocationResult - // NOTE: This is usually done by the DRA controller - resourceHandlers := make([]resourcev1alpha2.ResourceHandle, len(pluginNames)) - for i, pluginName := range pluginNames { - resourceHandlers[i] = resourcev1alpha2.ResourceHandle{ - DriverName: pluginName, - Data: "{\"EnvVars\":{\"DRA_PARAM1\":\"PARAM1_VALUE\"},\"NodeName\":\"\"}", + // NOTE: This is usually done by the DRA controller or the scheduler. + results := make([]resourceapi.DeviceRequestAllocationResult, len(driverNames)) + for i, driverName := range driverNames { + results[i] = resourceapi.DeviceRequestAllocationResult{ + Driver: driverName, + Pool: "some-pool", + Device: "some-device", } } - createdClaim.Status = resourcev1alpha2.ResourceClaimStatus{ - DriverName: "controller", - ReservedFor: []resourcev1alpha2.ResourceClaimConsumerReference{ + + createdClaim.Status = resourceapi.ResourceClaimStatus{ + ReservedFor: []resourceapi.ResourceClaimConsumerReference{ {Resource: "pods", Name: podName, UID: createdPod.UID}, }, - Allocation: &resourcev1alpha2.AllocationResult{ - ResourceHandles: resourceHandlers, + Allocation: &resourceapi.AllocationResult{ + Devices: resourceapi.DeviceAllocationResult{ + Results: results, + Config: []resourceapi.DeviceAllocationConfiguration{{ + DeviceConfiguration: resourceapi.DeviceConfiguration{ + Opaque: &resourceapi.OpaqueDeviceConfiguration{ + Driver: driverName, + Parameters: runtime.RawExtension{Raw: []byte(`{"EnvVars":{"DRA_PARAM1":"PARAM1_VALUE"}}`)}, + }, + }, + }}, + }, }, } - _, err = clientSet.ResourceV1alpha2().ResourceClaims(namespace).UpdateStatus(ctx, createdClaim, metav1.UpdateOptions{}) + _, err = clientSet.ResourceV1alpha3().ResourceClaims(namespace).UpdateStatus(ctx, createdClaim, metav1.UpdateOptions{}) framework.ExpectNoError(err) return pod } + +func createTestResourceSlice(ctx context.Context, clientSet kubernetes.Interface, nodeName, driverName string) { + slice := &resourceapi.ResourceSlice{ + ObjectMeta: metav1.ObjectMeta{ + Name: nodeName, + }, + Spec: resourceapi.ResourceSliceSpec{ + NodeName: nodeName, + Driver: driverName, + Pool: resourceapi.ResourcePool{ + Name: nodeName, + }, + }, + } + + ginkgo.By(fmt.Sprintf("Creating ResourceSlice %s", nodeName)) + slice, err := clientSet.ResourceV1alpha3().ResourceSlices().Create(ctx, slice, metav1.CreateOptions{}) + framework.ExpectNoError(err, "create ResourceSlice") + ginkgo.DeferCleanup(func(ctx context.Context) { + ginkgo.By(fmt.Sprintf("Deleting ResourceSlice %s", nodeName)) + err := clientSet.ResourceV1alpha3().ResourceSlices().Delete(ctx, slice.Name, metav1.DeleteOptions{}) + if !apierrors.IsNotFound(err) { + framework.ExpectNoError(err, "delete ResourceSlice") + } + }) +} diff --git a/test/integration/apiserver/apply/reset_fields_test.go b/test/integration/apiserver/apply/reset_fields_test.go index 33ca07a7383a1..b1f7de70f8cde 100644 --- a/test/integration/apiserver/apply/reset_fields_test.go +++ b/test/integration/apiserver/apply/reset_fields_test.go @@ -59,8 +59,8 @@ var resetFieldsStatusData = map[schema.GroupVersionResource]string{ gvr("storage.k8s.io", "v1", "volumeattachments"): `{"status": {"attached": false}}`, gvr("policy", "v1", "poddisruptionbudgets"): `{"status": {"currentHealthy": 25}}`, gvr("policy", "v1beta1", "poddisruptionbudgets"): `{"status": {"currentHealthy": 25}}`, - gvr("resource.k8s.io", "v1alpha2", "podschedulingcontexts"): `{"status": {"resourceClaims": [{"name": "my-claim", "unsuitableNodes": ["node2"]}]}}`, // Not really a conflict with status_test.go: Apply just stores both nodes. Conflict testing therefore gets disabled for podschedulingcontexts. - gvr("resource.k8s.io", "v1alpha2", "resourceclaims"): `{"status": {"driverName": "other.example.com"}}`, + gvr("resource.k8s.io", "v1alpha3", "podschedulingcontexts"): `{"status": {"resourceClaims": [{"name": "my-claim", "unsuitableNodes": ["node2"]}]}}`, // Not really a conflict with status_test.go: Apply just stores both nodes. Conflict testing therefore gets disabled for podschedulingcontexts. + gvr("resource.k8s.io", "v1alpha3", "resourceclaims"): `{"status": {"allocation": {"controller": "other.example.com"}}}`, gvr("internal.apiserver.k8s.io", "v1alpha1", "storageversions"): `{"status": {"commonEncodingVersion":"v1","storageVersions":[{"apiServerID":"1","decodableVersions":["v1","v2"],"encodingVersion":"v1"}],"conditions":[{"type":"AllEncodingVersionsEqual","status":"False","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"allEncodingVersionsEqual","message":"all encoding versions are set to v1"}]}}`, // standard for []metav1.Condition gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicies"): `{"status": {"conditions":[{"type":"Accepted","status":"True","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"RuleApplied","message":"Rule was applied"}]}}`, @@ -152,10 +152,10 @@ var resetFieldsSpecData = map[schema.GroupVersionResource]string{ gvr("awesome.bears.com", "v3", "pandas"): `{"spec": {"replicas": 302}}`, gvr("apiregistration.k8s.io", "v1beta1", "apiservices"): `{"metadata": {"labels": {"a":"c"}}, "spec": {"group": "foo2.com"}}`, gvr("apiregistration.k8s.io", "v1", "apiservices"): `{"metadata": {"labels": {"a":"c"}}, "spec": {"group": "foo2.com"}}`, - gvr("resource.k8s.io", "v1alpha2", "podschedulingcontexts"): `{"spec": {"selectedNode": "node2name"}}`, - gvr("resource.k8s.io", "v1alpha2", "resourceclasses"): `{"driverName": "other.example.com"}`, - gvr("resource.k8s.io", "v1alpha2", "resourceclaims"): `{"spec": {"resourceClassName": "class2name"}}`, // ResourceClassName is immutable, but that doesn't matter for the test. - gvr("resource.k8s.io", "v1alpha2", "resourceclaimtemplates"): `{"spec": {"spec": {"resourceClassName": "class2name"}}}`, + gvr("resource.k8s.io", "v1alpha3", "podschedulingcontexts"): `{"spec": {"selectedNode": "node2name"}}`, + gvr("resource.k8s.io", "v1alpha3", "deviceclasses"): `{"metadata": {"labels":{"a":"c"}}}`, + gvr("resource.k8s.io", "v1alpha3", "resourceclaims"): `{"spec": {"devices": {"requests": [{"name": "req-0", "deviceClassName": "other-class"}]}}}`, // spec is immutable, but that doesn't matter for the test. + gvr("resource.k8s.io", "v1alpha3", "resourceclaimtemplates"): `{"spec": {"spec": {"resourceClassName": "class2name"}}}`, gvr("internal.apiserver.k8s.io", "v1alpha1", "storageversions"): `{}`, gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicies"): `{"metadata": {"labels": {"a":"c"}}, "spec": {"paramKind": {"apiVersion": "apps/v1", "kind": "Deployment"}}}`, gvr("admissionregistration.k8s.io", "v1beta1", "validatingadmissionpolicies"): `{"metadata": {"labels": {"a":"c"}}, "spec": {"paramKind": {"apiVersion": "apps/v1", "kind": "Deployment"}}}`, diff --git a/test/integration/apiserver/apply/status_test.go b/test/integration/apiserver/apply/status_test.go index efae4a5cfa97a..c715a96836d42 100644 --- a/test/integration/apiserver/apply/status_test.go +++ b/test/integration/apiserver/apply/status_test.go @@ -52,8 +52,8 @@ var statusData = map[schema.GroupVersionResource]string{ gvr("storage.k8s.io", "v1", "volumeattachments"): `{"status": {"attached": true}}`, gvr("policy", "v1", "poddisruptionbudgets"): `{"status": {"currentHealthy": 5}}`, gvr("policy", "v1beta1", "poddisruptionbudgets"): `{"status": {"currentHealthy": 5}}`, - gvr("resource.k8s.io", "v1alpha2", "podschedulingcontexts"): `{"status": {"resourceClaims": [{"name": "my-claim", "unsuitableNodes": ["node1"]}]}}`, - gvr("resource.k8s.io", "v1alpha2", "resourceclaims"): `{"status": {"driverName": "example.com"}}`, + gvr("resource.k8s.io", "v1alpha3", "podschedulingcontexts"): `{"status": {"resourceClaims": [{"name": "my-claim", "unsuitableNodes": ["node1"]}]}}`, + gvr("resource.k8s.io", "v1alpha3", "resourceclaims"): `{"status": {"allocation": {"controller": "example.com"}}}`, gvr("internal.apiserver.k8s.io", "v1alpha1", "storageversions"): `{"status": {"commonEncodingVersion":"v1","storageVersions":[{"apiServerID":"1","decodableVersions":["v1","v2"],"encodingVersion":"v1"}],"conditions":[{"type":"AllEncodingVersionsEqual","status":"True","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"allEncodingVersionsEqual","message":"all encoding versions are set to v1"}]}}`, // standard for []metav1.Condition gvr("admissionregistration.k8s.io", "v1alpha1", "validatingadmissionpolicies"): `{"status": {"conditions":[{"type":"Accepted","status":"False","lastTransitionTime":"2020-01-01T00:00:00Z","reason":"RuleApplied","message":"Rule was applied"}]}}`, diff --git a/test/integration/auth/node_test.go b/test/integration/auth/node_test.go index 774ebd7e3ff9f..94d17a4967df3 100644 --- a/test/integration/auth/node_test.go +++ b/test/integration/auth/node_test.go @@ -27,7 +27,7 @@ import ( coordination "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1" - "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" storagev1 "k8s.io/api/storage/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" @@ -41,6 +41,7 @@ import ( "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/test/integration/framework" "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) func TestNodeAuthorizer(t *testing.T) { @@ -107,10 +108,16 @@ func TestNodeAuthorizer(t *testing.T) { if _, err := superuserClient.CoreV1().ConfigMaps("ns").Create(context.TODO(), &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "myconfigmap"}}, metav1.CreateOptions{}); err != nil { t.Fatal(err) } - if _, err := superuserClient.ResourceV1alpha2().ResourceClaims("ns").Create(context.TODO(), &v1alpha2.ResourceClaim{ObjectMeta: metav1.ObjectMeta{Name: "mynamedresourceclaim"}, Spec: v1alpha2.ResourceClaimSpec{ResourceClassName: "example.com"}}, metav1.CreateOptions{}); err != nil { + if _, err := superuserClient.ResourceV1alpha3().ResourceClaims("ns").Create(context.TODO(), &resourceapi.ResourceClaim{ObjectMeta: metav1.ObjectMeta{Name: "mynamedresourceclaim"}}, metav1.CreateOptions{}); err != nil { t.Fatal(err) } - if _, err := superuserClient.ResourceV1alpha2().ResourceClaims("ns").Create(context.TODO(), &v1alpha2.ResourceClaim{ObjectMeta: metav1.ObjectMeta{Name: "mytemplatizedresourceclaim"}, Spec: v1alpha2.ResourceClaimSpec{ResourceClassName: "example.com"}}, metav1.CreateOptions{}); err != nil { + if _, err := superuserClient.ResourceV1alpha3().ResourceClaims("ns").Create(context.TODO(), &resourceapi.ResourceClaim{ObjectMeta: metav1.ObjectMeta{Name: "mytemplatizedresourceclaim"}}, metav1.CreateOptions{}); err != nil { + t.Fatal(err) + } + if _, err := superuserClient.ResourceV1alpha3().ResourceSlices().Create(context.TODO(), &resourceapi.ResourceSlice{ObjectMeta: metav1.ObjectMeta{Name: "myslice1"}, Spec: resourceapi.ResourceSliceSpec{NodeName: "node1", Driver: "dra.example.com"}}, metav1.CreateOptions{}); err != nil { + t.Fatal(err) + } + if _, err := superuserClient.ResourceV1alpha3().ResourceSlices().Create(context.TODO(), &resourceapi.ResourceSlice{ObjectMeta: metav1.ObjectMeta{Name: "myslice2"}, Spec: resourceapi.ResourceSliceSpec{NodeName: "node2", Driver: "dra.example.com"}}, metav1.CreateOptions{}); err != nil { t.Fatal(err) } @@ -185,16 +192,25 @@ func TestNodeAuthorizer(t *testing.T) { } getResourceClaim := func(client clientset.Interface) func() error { return func() error { - _, err := client.ResourceV1alpha2().ResourceClaims("ns").Get(context.TODO(), "mynamedresourceclaim", metav1.GetOptions{}) + _, err := client.ResourceV1alpha3().ResourceClaims("ns").Get(context.TODO(), "mynamedresourceclaim", metav1.GetOptions{}) return err } } getResourceClaimTemplate := func(client clientset.Interface) func() error { return func() error { - _, err := client.ResourceV1alpha2().ResourceClaims("ns").Get(context.TODO(), "mytemplatizedresourceclaim", metav1.GetOptions{}) + _, err := client.ResourceV1alpha3().ResourceClaims("ns").Get(context.TODO(), "mytemplatizedresourceclaim", metav1.GetOptions{}) return err } } + deleteResourceSliceCollection := func(client clientset.Interface, nodeName *string) func() error { + return func() error { + var listOptions metav1.ListOptions + if nodeName != nil { + listOptions.FieldSelector = "nodeName=" + *nodeName + } + return client.ResourceV1alpha3().ResourceSlices().DeleteCollection(context.TODO(), metav1.DeleteOptions{}, listOptions) + } + } addResourceClaimTemplateReference := func(client clientset.Interface) func() error { return func() error { _, err := client.CoreV1().Pods("ns").Patch(context.TODO(), "node2normalpod", types.MergePatchType, @@ -640,6 +656,32 @@ func TestNodeAuthorizer(t *testing.T) { expectForbidden(t, updateNode1CSINode(csiNode2Client)) expectForbidden(t, patchNode1CSINode(csiNode2Client)) expectForbidden(t, deleteNode1CSINode(csiNode2Client)) + + // Always allowed. Permission to delete specific objects is checked per object. + // Beware, this is destructive! + expectAllowed(t, deleteResourceSliceCollection(csiNode1Client, ptr.To("node1"))) + + // One slice must have been deleted, the other not. + slices, err := superuserClient.ResourceV1alpha3().ResourceSlices().List(context.TODO(), metav1.ListOptions{}) + if err != nil { + t.Fatal(err) + } + if len(slices.Items) != 1 { + t.Fatalf("unexpected slices: %v", slices.Items) + } + if slices.Items[0].Spec.NodeName != "node2" { + t.Fatal("wrong slice deleted") + } + + // Superuser can delete. + expectAllowed(t, deleteResourceSliceCollection(superuserClient, nil)) + slices, err = superuserClient.ResourceV1alpha3().ResourceSlices().List(context.TODO(), metav1.ListOptions{}) + if err != nil { + t.Fatal(err) + } + if len(slices.Items) != 0 { + t.Fatalf("unexpected slices: %v", slices.Items) + } } // expect executes a function a set number of times until it either returns the diff --git a/test/integration/etcd/data.go b/test/integration/etcd/data.go index a3934fc3fecdc..0aa313b3fc69e 100644 --- a/test/integration/etcd/data.go +++ b/test/integration/etcd/data.go @@ -403,33 +403,25 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes }, // -- - // k8s.io/kubernetes/pkg/apis/resource/v1alpha2 - gvr("resource.k8s.io", "v1alpha2", "resourceclasses"): { - Stub: `{"metadata": {"name": "class1name"}, "driverName": "example.com"}`, - ExpectedEtcdPath: "/registry/resourceclasses/class1name", + // k8s.io/kubernetes/pkg/apis/resource/v1alpha3 + gvr("resource.k8s.io", "v1alpha3", "deviceclasses"): { + Stub: `{"metadata": {"name": "class1name"}}`, + ExpectedEtcdPath: "/registry/deviceclasses/class1name", }, - gvr("resource.k8s.io", "v1alpha2", "resourceclaims"): { - Stub: `{"metadata": {"name": "claim1name"}, "spec": {"resourceClassName": "class1name", "allocationMode": "WaitForFirstConsumer"}}`, + gvr("resource.k8s.io", "v1alpha3", "resourceclaims"): { + Stub: `{"metadata": {"name": "claim1name"}, "spec": {"devices": {"requests": [{"name": "req-0", "deviceClassName": "example-class", "countMode": "Exact", "count": 1}]}}}`, ExpectedEtcdPath: "/registry/resourceclaims/" + namespace + "/claim1name", }, - gvr("resource.k8s.io", "v1alpha2", "resourceclaimtemplates"): { - Stub: `{"metadata": {"name": "claimtemplate1name"}, "spec": {"spec": {"resourceClassName": "class1name", "allocationMode": "WaitForFirstConsumer"}}}`, + gvr("resource.k8s.io", "v1alpha3", "resourceclaimtemplates"): { + Stub: `{"metadata": {"name": "claimtemplate1name"}, "spec": {"spec": {"devices": {"requests": [{"name": "req-0", "deviceClassName": "example-class", "countMode": "Exact", "count": 1}]}}}}`, ExpectedEtcdPath: "/registry/resourceclaimtemplates/" + namespace + "/claimtemplate1name", }, - gvr("resource.k8s.io", "v1alpha2", "podschedulingcontexts"): { + gvr("resource.k8s.io", "v1alpha3", "podschedulingcontexts"): { Stub: `{"metadata": {"name": "pod1name"}, "spec": {"selectedNode": "node1name", "potentialNodes": ["node1name", "node2name"]}}`, ExpectedEtcdPath: "/registry/podschedulingcontexts/" + namespace + "/pod1name", }, - gvr("resource.k8s.io", "v1alpha2", "resourceclassparameters"): { - Stub: `{"metadata": {"name": "class1parameters"}}`, - ExpectedEtcdPath: "/registry/resourceclassparameters/" + namespace + "/class1parameters", - }, - gvr("resource.k8s.io", "v1alpha2", "resourceclaimparameters"): { - Stub: `{"metadata": {"name": "claim1parameters"}}`, - ExpectedEtcdPath: "/registry/resourceclaimparameters/" + namespace + "/claim1parameters", - }, - gvr("resource.k8s.io", "v1alpha2", "resourceslices"): { - Stub: `{"metadata": {"name": "node1slice"}, "nodeName": "worker1", "driverName": "dra.example.com", "namedResources": {}}`, + gvr("resource.k8s.io", "v1alpha3", "resourceslices"): { + Stub: `{"metadata": {"name": "node1slice"}, "spec": {"nodeName": "worker1", "driver": "dra.example.com", "pool": {"name": "worker1", "resourceSliceCount": 1}}}`, ExpectedEtcdPath: "/registry/resourceslices/node1slice", }, // -- diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go index 6a33addf9db4c..2e86191f4af31 100644 --- a/test/integration/scheduler/scheduler_test.go +++ b/test/integration/scheduler/scheduler_test.go @@ -29,7 +29,7 @@ import ( "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -678,31 +678,16 @@ func TestPodSchedulingContextSSA(t *testing.T) { } } - defer func() { - if err := testCtx.ClientSet.ResourceV1alpha2().ResourceClasses().DeleteCollection(testCtx.Ctx, metav1.DeleteOptions{}, metav1.ListOptions{}); err != nil { - t.Errorf("Unexpected error deleting ResourceClasses: %v", err) - } - }() - class := &resourcev1alpha2.ResourceClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-class", - }, - DriverName: "does-not-matter", - } - if _, err := testCtx.ClientSet.ResourceV1alpha2().ResourceClasses().Create(testCtx.Ctx, class, metav1.CreateOptions{}); err != nil { - t.Fatalf("Failed to create class: %v", err) - } - - claim := &resourcev1alpha2.ResourceClaim{ + claim := &resourceapi.ResourceClaim{ ObjectMeta: metav1.ObjectMeta{ Name: "my-claim", Namespace: testCtx.NS.Name, }, - Spec: resourcev1alpha2.ResourceClaimSpec{ - ResourceClassName: class.Name, + Spec: resourceapi.ResourceClaimSpec{ + Controller: "dra.example.com", }, } - if _, err := testCtx.ClientSet.ResourceV1alpha2().ResourceClaims(claim.Namespace).Create(testCtx.Ctx, claim, metav1.CreateOptions{}); err != nil { + if _, err := testCtx.ClientSet.ResourceV1alpha3().ResourceClaims(claim.Namespace).Create(testCtx.Ctx, claim, metav1.CreateOptions{}); err != nil { t.Fatalf("Failed to create claim: %v", err) } @@ -719,11 +704,11 @@ func TestPodSchedulingContextSSA(t *testing.T) { } // Check that the PodSchedulingContext exists and has a selected node. - var schedulingCtx *resourcev1alpha2.PodSchedulingContext + var schedulingCtx *resourceapi.PodSchedulingContext if err := wait.PollUntilContextTimeout(testCtx.Ctx, 10*time.Microsecond, 30*time.Second, true, func(context.Context) (bool, error) { var err error - schedulingCtx, err = testCtx.ClientSet.ResourceV1alpha2().PodSchedulingContexts(pod.Namespace).Get(testCtx.Ctx, pod.Name, metav1.GetOptions{}) + schedulingCtx, err = testCtx.ClientSet.ResourceV1alpha3().PodSchedulingContexts(pod.Namespace).Get(testCtx.Ctx, pod.Name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { return false, nil } @@ -756,12 +741,12 @@ func TestPodSchedulingContextSSA(t *testing.T) { // Now force the scheduler to update the PodSchedulingContext by setting UnsuitableNodes so that // the selected node is not suitable. - schedulingCtx.Status.ResourceClaims = []resourcev1alpha2.ResourceClaimSchedulingStatus{{ + schedulingCtx.Status.ResourceClaims = []resourceapi.ResourceClaimSchedulingStatus{{ Name: podClaimName, UnsuitableNodes: []string{schedulingCtx.Spec.SelectedNode}, }} - if _, err := testCtx.ClientSet.ResourceV1alpha2().PodSchedulingContexts(pod.Namespace).UpdateStatus(testCtx.Ctx, schedulingCtx, metav1.UpdateOptions{}); err != nil { + if _, err := testCtx.ClientSet.ResourceV1alpha3().PodSchedulingContexts(pod.Namespace).UpdateStatus(testCtx.Ctx, schedulingCtx, metav1.UpdateOptions{}); err != nil { t.Fatalf("Unexpected PodSchedulingContext status update error: %v", err) } diff --git a/test/integration/scheduler_perf/config/dra/another-resourceclaimtemplate.yaml b/test/integration/scheduler_perf/config/dra/another-resourceclaimtemplate.yaml index f68127b67a8d8..9ac0b32715fd8 100644 --- a/test/integration/scheduler_perf/config/dra/another-resourceclaimtemplate.yaml +++ b/test/integration/scheduler_perf/config/dra/another-resourceclaimtemplate.yaml @@ -1,7 +1,11 @@ -apiVersion: resource.k8s.io/v1alpha1 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: name: another-test-claim-template spec: spec: - resourceClassName: another-test-class + controller: another-test-driver.cdi.k8s.io + devices: + requests: + - name: req-0 + deviceClassName: test-class diff --git a/test/integration/scheduler_perf/config/dra/another-resourceclass.yaml b/test/integration/scheduler_perf/config/dra/another-resourceclass.yaml deleted file mode 100644 index 52eb55698b83b..0000000000000 --- a/test/integration/scheduler_perf/config/dra/another-resourceclass.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha1 -kind: ResourceClass -metadata: - name: another-test-class -driverName: another-test-driver.cdi.k8s.io diff --git a/test/integration/scheduler_perf/config/dra/claim-template.yaml b/test/integration/scheduler_perf/config/dra/claim-template.yaml deleted file mode 100644 index 2ccc57e478c08..0000000000000 --- a/test/integration/scheduler_perf/config/dra/claim-template.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha1 -kind: ResourceClaimTemplate -metadata: - name: claim-template -spec: - spec: - resourceClassName: scheduler-performance diff --git a/test/integration/scheduler_perf/config/dra/deviceclass-structured.yaml b/test/integration/scheduler_perf/config/dra/deviceclass-structured.yaml new file mode 100644 index 0000000000000..873fd282bd20e --- /dev/null +++ b/test/integration/scheduler_perf/config/dra/deviceclass-structured.yaml @@ -0,0 +1,8 @@ +apiVersion: resource.k8s.io/v1alpha3 +kind: DeviceClass +metadata: + name: test-class +spec: + selectors: + - cel: + expression: device.driver == "test-driver.cdi.k8s.io" diff --git a/test/integration/scheduler_perf/config/dra/deviceclass.yaml b/test/integration/scheduler_perf/config/dra/deviceclass.yaml new file mode 100644 index 0000000000000..62417231b9afb --- /dev/null +++ b/test/integration/scheduler_perf/config/dra/deviceclass.yaml @@ -0,0 +1,4 @@ +apiVersion: resource.k8s.io/v1alpha3 +kind: DeviceClass +metadata: + name: test-class diff --git a/test/integration/scheduler_perf/config/dra/resourceclaim-structured.yaml b/test/integration/scheduler_perf/config/dra/resourceclaim-structured.yaml index cc591c6542f03..0207afc2a51e5 100644 --- a/test/integration/scheduler_perf/config/dra/resourceclaim-structured.yaml +++ b/test/integration/scheduler_perf/config/dra/resourceclaim-structured.yaml @@ -1,10 +1,9 @@ -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaim metadata: name: test-claim-{{.Index}} spec: - resourceClassName: test-class - parametersRef: - apiGroup: resource.k8s.io - kind: ResourceClaimParameters - name: test-claim-parameters + devices: + requests: + - name: req-0 + deviceClassName: test-class diff --git a/test/integration/scheduler_perf/config/dra/resourceclaim.yaml b/test/integration/scheduler_perf/config/dra/resourceclaim.yaml index e2420f077e82e..510a5a1ba2c26 100644 --- a/test/integration/scheduler_perf/config/dra/resourceclaim.yaml +++ b/test/integration/scheduler_perf/config/dra/resourceclaim.yaml @@ -1,6 +1,10 @@ -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaim metadata: name: test-claim-{{.Index}} spec: - resourceClassName: test-class + controller: test-driver.cdi.k8s.io + devices: + requests: + - name: req-0 + deviceClassName: test-class diff --git a/test/integration/scheduler_perf/config/dra/resourceclaimparameters.yaml b/test/integration/scheduler_perf/config/dra/resourceclaimparameters.yaml deleted file mode 100644 index b10a111040120..0000000000000 --- a/test/integration/scheduler_perf/config/dra/resourceclaimparameters.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha2 -kind: ResourceClaimParameters -metadata: - name: test-claim-parameters -shareable: true -driverRequests: -- driverName: test-driver.cdi.k8s.io - requests: - - namedResources: - selector: "true" diff --git a/test/integration/scheduler_perf/config/dra/resourceclaimtemplate-structured.yaml b/test/integration/scheduler_perf/config/dra/resourceclaimtemplate-structured.yaml index 413125058acee..77aa178afa5b5 100644 --- a/test/integration/scheduler_perf/config/dra/resourceclaimtemplate-structured.yaml +++ b/test/integration/scheduler_perf/config/dra/resourceclaimtemplate-structured.yaml @@ -1,11 +1,10 @@ -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: name: test-claim-template spec: spec: - resourceClassName: test-class - parametersRef: - apiGroup: resource.k8s.io - kind: ResourceClaimParameters - name: test-claim-parameters + devices: + requests: + - name: req-0 + deviceClassName: test-class diff --git a/test/integration/scheduler_perf/config/dra/resourceclaimtemplate.yaml b/test/integration/scheduler_perf/config/dra/resourceclaimtemplate.yaml index 29048726caf46..9b94a70b9875d 100644 --- a/test/integration/scheduler_perf/config/dra/resourceclaimtemplate.yaml +++ b/test/integration/scheduler_perf/config/dra/resourceclaimtemplate.yaml @@ -1,7 +1,11 @@ -apiVersion: resource.k8s.io/v1alpha2 +apiVersion: resource.k8s.io/v1alpha3 kind: ResourceClaimTemplate metadata: name: test-claim-template spec: spec: - resourceClassName: test-class + controller: test-driver.cdi.k8s.io + devices: + requests: + - name: req-0 + deviceClassName: test-class diff --git a/test/integration/scheduler_perf/config/dra/resourceclass-structured.yaml b/test/integration/scheduler_perf/config/dra/resourceclass-structured.yaml deleted file mode 100644 index ac1bb2e530d48..0000000000000 --- a/test/integration/scheduler_perf/config/dra/resourceclass-structured.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha2 -kind: ResourceClass -metadata: - name: test-class -driverName: test-driver.cdi.k8s.io -structuredParameters: true diff --git a/test/integration/scheduler_perf/config/dra/resourceclass.yaml b/test/integration/scheduler_perf/config/dra/resourceclass.yaml deleted file mode 100644 index 8ba0fcb3a2a92..0000000000000 --- a/test/integration/scheduler_perf/config/dra/resourceclass.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: resource.k8s.io/v1alpha2 -kind: ResourceClass -metadata: - name: test-class -driverName: test-driver.cdi.k8s.io diff --git a/test/integration/scheduler_perf/config/performance-config.yaml b/test/integration/scheduler_perf/config/performance-config.yaml index 8c256a65fc237..4b6905a70ffa1 100644 --- a/test/integration/scheduler_perf/config/performance-config.yaml +++ b/test/integration/scheduler_perf/config/performance-config.yaml @@ -758,7 +758,7 @@ nodes: scheduler-perf-dra-* maxClaimsPerNodeParam: $maxClaimsPerNode - opcode: createAny - templatePath: config/dra/resourceclass.yaml + templatePath: config/dra/deviceclass.yaml - opcode: createAny templatePath: config/dra/resourceclaimtemplate.yaml namespace: init @@ -829,9 +829,7 @@ nodes: scheduler-perf-dra-* maxClaimsPerNodeParam: $maxClaimsPerNode - opcode: createAny - templatePath: config/dra/resourceclass.yaml - - opcode: createAny - templatePath: config/dra/another-resourceclass.yaml + templatePath: config/dra/deviceclass.yaml - opcode: createAny templatePath: config/dra/resourceclaimtemplate.yaml namespace: init @@ -855,6 +853,7 @@ collectMetrics: true workloads: - name: fast + labels: [integration-test, fast] params: # This testcase runs through all code paths without # taking too long overall. @@ -902,10 +901,7 @@ maxClaimsPerNodeParam: $maxClaimsPerNode structuredParameters: true - opcode: createAny - templatePath: config/dra/resourceclass-structured.yaml - - opcode: createAny - templatePath: config/dra/resourceclaimparameters.yaml - namespace: init + templatePath: config/dra/deviceclass-structured.yaml - opcode: createAny templatePath: config/dra/resourceclaimtemplate-structured.yaml namespace: init @@ -913,9 +909,6 @@ namespace: init countParam: $initPods podTemplatePath: config/dra/pod-with-claim-template.yaml - - opcode: createAny - templatePath: config/dra/resourceclaimparameters.yaml - namespace: test - opcode: createAny templatePath: config/dra/resourceclaimtemplate-structured.yaml namespace: test @@ -979,10 +972,7 @@ maxClaimsPerNodeParam: $maxClaimsPerNode structuredParameters: true - opcode: createAny - templatePath: config/dra/resourceclass-structured.yaml - - opcode: createAny - templatePath: config/dra/resourceclaimparameters.yaml - namespace: init + templatePath: config/dra/deviceclass-structured.yaml - opcode: createAny templatePath: config/dra/resourceclaim-structured.yaml namespace: init @@ -991,9 +981,6 @@ namespace: init countParam: $initPods podTemplatePath: config/dra/pod-with-claim-ref.yaml - - opcode: createAny - templatePath: config/dra/resourceclaimparameters.yaml - namespace: test - opcode: createAny templatePath: config/dra/resourceclaim-structured.yaml namespace: test @@ -1100,4 +1087,4 @@ labels: [performance, fast] params: gatedPods: 10000 - measurePods: 20000 \ No newline at end of file + measurePods: 20000 diff --git a/test/integration/scheduler_perf/dra.go b/test/integration/scheduler_perf/dra.go index 6a2d21b9f7582..d76cfd6b2ac2a 100644 --- a/test/integration/scheduler_perf/dra.go +++ b/test/integration/scheduler_perf/dra.go @@ -22,7 +22,7 @@ import ( "path/filepath" "sync" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/workqueue" "k8s.io/klog/v2" @@ -84,7 +84,7 @@ func (op *createResourceClaimsOp) requiredNamespaces() []string { func (op *createResourceClaimsOp) run(tCtx ktesting.TContext) { tCtx.Logf("creating %d claims in namespace %q", op.Count, op.Namespace) - var claimTemplate *resourcev1alpha2.ResourceClaim + var claimTemplate *resourceapi.ResourceClaim if err := getSpecFromFile(&op.TemplatePath, &claimTemplate); err != nil { tCtx.Fatalf("parsing ResourceClaim %q: %v", op.TemplatePath, err) } @@ -92,7 +92,7 @@ func (op *createResourceClaimsOp) run(tCtx ktesting.TContext) { var mutex sync.Mutex create := func(i int) { err := func() error { - if _, err := tCtx.Client().ResourceV1alpha2().ResourceClaims(op.Namespace).Create(tCtx, claimTemplate.DeepCopy(), metav1.CreateOptions{}); err != nil { + if _, err := tCtx.Client().ResourceV1alpha3().ResourceClaims(op.Namespace).Create(tCtx, claimTemplate.DeepCopy(), metav1.CreateOptions{}); err != nil { return fmt.Errorf("create claim: %v", err) } return nil @@ -177,7 +177,6 @@ func (op *createResourceDriverOp) run(tCtx ktesting.TContext) { DriverName: op.DriverName, NodeLocal: true, MaxAllocations: op.MaxClaimsPerNode, - Shareable: true, } nodes, err := tCtx.Client().CoreV1().Nodes().List(tCtx, metav1.ListOptions{}) @@ -197,13 +196,13 @@ func (op *createResourceDriverOp) run(tCtx ktesting.TContext) { if op.StructuredParameters { for _, nodeName := range resources.Nodes { slice := resourceSlice(op.DriverName, nodeName, op.MaxClaimsPerNode) - _, err := tCtx.Client().ResourceV1alpha2().ResourceSlices().Create(tCtx, slice, metav1.CreateOptions{}) + _, err := tCtx.Client().ResourceV1alpha3().ResourceSlices().Create(tCtx, slice, metav1.CreateOptions{}) tCtx.ExpectNoError(err, "create node resource slice") } tCtx.CleanupCtx(func(tCtx ktesting.TContext) { - err := tCtx.Client().ResourceV1alpha2().ResourceSlices().DeleteCollection(tCtx, + err := tCtx.Client().ResourceV1alpha3().ResourceSlices().DeleteCollection(tCtx, metav1.DeleteOptions{}, - metav1.ListOptions{FieldSelector: "driverName=" + op.DriverName}, + metav1.ListOptions{FieldSelector: resourceapi.ResourceSliceSelectorDriver + "=" + op.DriverName}, ) tCtx.ExpectNoError(err, "delete node resource slices") }) @@ -229,24 +228,27 @@ func (op *createResourceDriverOp) run(tCtx ktesting.TContext) { }) } -func resourceSlice(driverName, nodeName string, capacity int) *resourcev1alpha2.ResourceSlice { - slice := &resourcev1alpha2.ResourceSlice{ +func resourceSlice(driverName, nodeName string, capacity int) *resourceapi.ResourceSlice { + slice := &resourceapi.ResourceSlice{ ObjectMeta: metav1.ObjectMeta{ Name: nodeName, }, - NodeName: nodeName, - DriverName: driverName, - - ResourceModel: resourcev1alpha2.ResourceModel{ - NamedResources: &resourcev1alpha2.NamedResourcesResources{}, + Spec: resourceapi.ResourceSliceSpec{ + Driver: driverName, + NodeName: nodeName, + Pool: resourceapi.ResourcePool{ + Name: nodeName, + ResourceSliceCount: 1, + }, }, } for i := 0; i < capacity; i++ { - slice.ResourceModel.NamedResources.Instances = append(slice.ResourceModel.NamedResources.Instances, - resourcev1alpha2.NamedResourcesInstance{ - Name: fmt.Sprintf("instance-%d", i), + slice.Spec.Devices = append(slice.Spec.Devices, + resourceapi.Device{ + Name: fmt.Sprintf("instance-%d", i), + Basic: &resourceapi.BasicDevice{}, }, ) } diff --git a/test/integration/scheduler_perf/util.go b/test/integration/scheduler_perf/util.go index 56f24c4fb0044..40e252fd6a94d 100644 --- a/test/integration/scheduler_perf/util.go +++ b/test/integration/scheduler_perf/util.go @@ -87,7 +87,7 @@ func mustSetupCluster(tCtx ktesting.TContext, config *config.KubeSchedulerConfig // except for DRA API group when needed. runtimeConfig := []string{"api/alpha=false"} if enabledFeatures[features.DynamicResourceAllocation] { - runtimeConfig = append(runtimeConfig, "resource.k8s.io/v1alpha2=true") + runtimeConfig = append(runtimeConfig, "resource.k8s.io/v1alpha3=true") } customFlags := []string{ // Disable ServiceAccount admission plugin as we don't have serviceaccount controller running. diff --git a/test/integration/util/util.go b/test/integration/util/util.go index c975c1187b9ed..9a028e0f36ddc 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourceapi "k8s.io/api/resource/v1alpha3" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -130,9 +130,9 @@ func StartScheduler(ctx context.Context, clientSet clientset.Interface, kubeConf func CreateResourceClaimController(ctx context.Context, tb ktesting.TB, clientSet clientset.Interface, informerFactory informers.SharedInformerFactory) func() { podInformer := informerFactory.Core().V1().Pods() - schedulingInformer := informerFactory.Resource().V1alpha2().PodSchedulingContexts() - claimInformer := informerFactory.Resource().V1alpha2().ResourceClaims() - claimTemplateInformer := informerFactory.Resource().V1alpha2().ResourceClaimTemplates() + schedulingInformer := informerFactory.Resource().V1alpha3().PodSchedulingContexts() + claimInformer := informerFactory.Resource().V1alpha3().ResourceClaims() + claimTemplateInformer := informerFactory.Resource().V1alpha3().ResourceClaimTemplates() claimController, err := resourceclaim.NewController(klog.FromContext(ctx), clientSet, podInformer, schedulingInformer, claimInformer, claimTemplateInformer) if err != nil { tb.Fatalf("Error creating claim controller: %v", err) @@ -512,7 +512,7 @@ func InitTestAPIServer(t *testing.T, nsPrefix string, admission admission.Interf options.Admission.GenericAdmission.DisablePlugins = []string{"ServiceAccount", "TaintNodesByCondition", "Priority", "StorageObjectInUseProtection"} if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { options.APIEnablement.RuntimeConfig = cliflag.ConfigurationMap{ - resourcev1alpha2.SchemeGroupVersion.String(): "true", + resourceapi.SchemeGroupVersion.String(): "true", } } },