DRA: remove "source" indirection from v1 Pod API

This makes the API nicer:

    resourceClaims:
    - name: with-template
      resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      resourceClaimName: test-shared-claim

Previously, this was:

    resourceClaims:
    - name: with-template
      source:
        resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      source:
        resourceClaimName: test-shared-claim

A more long-term benefit is that other, future alternatives
might not make sense under the "source" umbrella.

This is a breaking change. It's justified because DRA is still
alpha and will have several other API breaks in 1.31.
This commit is contained in:
Patrick Ohly
2024-05-24 15:24:24 +02:00
parent bb95d084a2
commit bde9b64cdf
209 changed files with 117866 additions and 2126 deletions

View File

@@ -5813,20 +5813,6 @@
],
"type": "object"
},
"io.k8s.api.core.v1.ClaimSource": {
"description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.",
"properties": {
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.",
"type": "string"
}
},
"type": "object"
},
"io.k8s.api.core.v1.ClientIPConfig": {
"description": "ClientIPConfig represents the configurations of Client IP based session affinity.",
"properties": {
@@ -9371,15 +9357,19 @@
"type": "object"
},
"io.k8s.api.core.v1.PodResourceClaim": {
"description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"description": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"properties": {
"name": {
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
"type": "string"
},
"source": {
"$ref": "#/definitions/io.k8s.api.core.v1.ClaimSource",
"description": "Source describes where to find the ResourceClaim."
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
}
},
"required": [

View File

@@ -721,20 +721,6 @@
],
"type": "object"
},
"io.k8s.api.core.v1.ClaimSource": {
"description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.",
"properties": {
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.",
"type": "string"
}
},
"type": "object"
},
"io.k8s.api.core.v1.ClientIPConfig": {
"description": "ClientIPConfig represents the configurations of Client IP based session affinity.",
"properties": {
@@ -5253,21 +5239,20 @@
"type": "object"
},
"io.k8s.api.core.v1.PodResourceClaim": {
"description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"description": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"properties": {
"name": {
"default": "",
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
"type": "string"
},
"source": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource"
}
],
"default": {},
"description": "Source describes where to find the ResourceClaim."
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
}
},
"required": [

View File

@@ -1611,20 +1611,6 @@
],
"type": "object"
},
"io.k8s.api.core.v1.ClaimSource": {
"description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.",
"properties": {
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.",
"type": "string"
}
},
"type": "object"
},
"io.k8s.api.core.v1.ClusterTrustBundleProjection": {
"description": "ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.",
"properties": {
@@ -3574,21 +3560,20 @@
"type": "object"
},
"io.k8s.api.core.v1.PodResourceClaim": {
"description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"description": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"properties": {
"name": {
"default": "",
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
"type": "string"
},
"source": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource"
}
],
"default": {},
"description": "Source describes where to find the ResourceClaim."
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
}
},
"required": [

View File

@@ -960,20 +960,6 @@
],
"type": "object"
},
"io.k8s.api.core.v1.ClaimSource": {
"description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.",
"properties": {
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.",
"type": "string"
}
},
"type": "object"
},
"io.k8s.api.core.v1.ClusterTrustBundleProjection": {
"description": "ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.",
"properties": {
@@ -2778,21 +2764,20 @@
"type": "object"
},
"io.k8s.api.core.v1.PodResourceClaim": {
"description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"description": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
"properties": {
"name": {
"default": "",
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
"type": "string"
},
"source": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource"
}
],
"default": {},
"description": "Source describes where to find the ResourceClaim."
"resourceClaimName": {
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
},
"resourceClaimTemplateName": {
"description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
"type": "string"
}
},
"required": [