Skip to content

Commit ac9aec9

Browse files
authored
Merge pull request kubernetes#125116 from pohly/dra-one-of-source
DRA: remove "source" indirection from v1 Pod API
2 parents 0cde5f1 + 8e37501 commit ac9aec9

File tree

209 files changed

+117866
-2158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+117866
-2158
lines changed

api/openapi-spec/swagger.json

Lines changed: 8 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/api__v1_openapi.json

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -725,20 +725,6 @@
725725
],
726726
"type": "object"
727727
},
728-
"io.k8s.api.core.v1.ClaimSource": {
729-
"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.",
730-
"properties": {
731-
"resourceClaimName": {
732-
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
733-
"type": "string"
734-
},
735-
"resourceClaimTemplateName": {
736-
"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.",
737-
"type": "string"
738-
}
739-
},
740-
"type": "object"
741-
},
742728
"io.k8s.api.core.v1.ClientIPConfig": {
743729
"description": "ClientIPConfig represents the configurations of Client IP based session affinity.",
744730
"properties": {
@@ -5259,21 +5245,20 @@
52595245
"type": "object"
52605246
},
52615247
"io.k8s.api.core.v1.PodResourceClaim": {
5262-
"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.",
5248+
"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.",
52635249
"properties": {
52645250
"name": {
52655251
"default": "",
52665252
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
52675253
"type": "string"
52685254
},
5269-
"source": {
5270-
"allOf": [
5271-
{
5272-
"$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource"
5273-
}
5274-
],
5275-
"default": {},
5276-
"description": "Source describes where to find the ResourceClaim."
5255+
"resourceClaimName": {
5256+
"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.",
5257+
"type": "string"
5258+
},
5259+
"resourceClaimTemplateName": {
5260+
"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.",
5261+
"type": "string"
52775262
}
52785263
},
52795264
"required": [

api/openapi-spec/v3/apis__apps__v1_openapi.json

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,20 +1615,6 @@
16151615
],
16161616
"type": "object"
16171617
},
1618-
"io.k8s.api.core.v1.ClaimSource": {
1619-
"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.",
1620-
"properties": {
1621-
"resourceClaimName": {
1622-
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
1623-
"type": "string"
1624-
},
1625-
"resourceClaimTemplateName": {
1626-
"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.",
1627-
"type": "string"
1628-
}
1629-
},
1630-
"type": "object"
1631-
},
16321618
"io.k8s.api.core.v1.ClusterTrustBundleProjection": {
16331619
"description": "ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.",
16341620
"properties": {
@@ -3579,21 +3565,20 @@
35793565
"type": "object"
35803566
},
35813567
"io.k8s.api.core.v1.PodResourceClaim": {
3582-
"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.",
3568+
"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.",
35833569
"properties": {
35843570
"name": {
35853571
"default": "",
35863572
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
35873573
"type": "string"
35883574
},
3589-
"source": {
3590-
"allOf": [
3591-
{
3592-
"$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource"
3593-
}
3594-
],
3595-
"default": {},
3596-
"description": "Source describes where to find the ResourceClaim."
3575+
"resourceClaimName": {
3576+
"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.",
3577+
"type": "string"
3578+
},
3579+
"resourceClaimTemplateName": {
3580+
"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.",
3581+
"type": "string"
35973582
}
35983583
},
35993584
"required": [

api/openapi-spec/v3/apis__batch__v1_openapi.json

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -964,20 +964,6 @@
964964
],
965965
"type": "object"
966966
},
967-
"io.k8s.api.core.v1.ClaimSource": {
968-
"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.",
969-
"properties": {
970-
"resourceClaimName": {
971-
"description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.",
972-
"type": "string"
973-
},
974-
"resourceClaimTemplateName": {
975-
"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.",
976-
"type": "string"
977-
}
978-
},
979-
"type": "object"
980-
},
981967
"io.k8s.api.core.v1.ClusterTrustBundleProjection": {
982968
"description": "ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.",
983969
"properties": {
@@ -2783,21 +2769,20 @@
27832769
"type": "object"
27842770
},
27852771
"io.k8s.api.core.v1.PodResourceClaim": {
2786-
"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.",
2772+
"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.",
27872773
"properties": {
27882774
"name": {
27892775
"default": "",
27902776
"description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
27912777
"type": "string"
27922778
},
2793-
"source": {
2794-
"allOf": [
2795-
{
2796-
"$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource"
2797-
}
2798-
],
2799-
"default": {},
2800-
"description": "Source describes where to find the ResourceClaim."
2779+
"resourceClaimName": {
2780+
"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.",
2781+
"type": "string"
2782+
},
2783+
"resourceClaimTemplateName": {
2784+
"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.",
2785+
"type": "string"
28012786
}
28022787
},
28032788
"required": [

pkg/api/pod/util_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,8 @@ func TestDropDynamicResourceAllocation(t *testing.T) {
841841
},
842842
ResourceClaims: []api.PodResourceClaim{
843843
{
844-
Name: "my-claim",
845-
Source: api.ClaimSource{
846-
ResourceClaimName: &resourceClaimName,
847-
},
844+
Name: "my-claim",
845+
ResourceClaimName: &resourceClaimName,
848846
},
849847
},
850848
},

pkg/apis/core/types.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,17 +3476,11 @@ type PodResourceClaim struct {
34763476
// This must be a DNS_LABEL.
34773477
Name string
34783478

3479-
// Source describes where to find the ResourceClaim.
3480-
Source ClaimSource
3481-
}
3482-
3483-
// ClaimSource describes a reference to a ResourceClaim.
3484-
//
3485-
// Exactly one of these fields should be set. Consumers of this type must
3486-
// treat an empty object as if it has an unknown value.
3487-
type ClaimSource struct {
34883479
// ResourceClaimName is the name of a ResourceClaim object in the same
34893480
// namespace as this pod.
3481+
//
3482+
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
3483+
// be set.
34903484
ResourceClaimName *string
34913485

34923486
// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
@@ -3501,6 +3495,9 @@ type ClaimSource struct {
35013495
// This field is immutable and no changes will be made to the
35023496
// corresponding ResourceClaim by the control plane after creating the
35033497
// ResourceClaim.
3498+
//
3499+
// Exactly one of ResourceClaimName and ResourceClaimTemplateName must
3500+
// be set.
35043501
ResourceClaimTemplateName *string
35053502
}
35063503

pkg/apis/core/v1/zz_generated.conversion.go

Lines changed: 4 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)