Skip to content

Commit 35de2c0

Browse files
pohlyk8s-publishing-bot
authored andcommitted
DRA: remove immediate allocation
As agreed in kubernetes/enhancements#4709, immediate allocation is one of those features which can be removed because it makes no sense for structured parameters and the justification for classic DRA is weak. Kubernetes-commit: de5742ae83c8d77268a7caf5f3b1f418c4a13a84
1 parent 8cd8793 commit 35de2c0

10 files changed

+141
-219
lines changed

resource/v1alpha3/generated.pb.go

+139-181
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resource/v1alpha3/generated.proto

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resource/v1alpha3/types.go

-26
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,8 @@ type ResourceClaimSpec struct {
7272
// The object must be in the same namespace as the ResourceClaim.
7373
// +optional
7474
ParametersRef *ResourceClaimParametersReference `json:"parametersRef,omitempty" protobuf:"bytes,2,opt,name=parametersRef"`
75-
76-
// Allocation can start immediately or when a Pod wants to use the
77-
// resource. "WaitForFirstConsumer" is the default.
78-
// +optional
79-
AllocationMode AllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"`
8075
}
8176

82-
// AllocationMode describes whether a ResourceClaim gets allocated immediately
83-
// when it gets created (AllocationModeImmediate) or whether allocation is
84-
// delayed until it is needed for a Pod
85-
// (AllocationModeWaitForFirstConsumer). Other modes might get added in the
86-
// future.
87-
type AllocationMode string
88-
89-
const (
90-
// When a ResourceClaim has AllocationModeWaitForFirstConsumer, allocation is
91-
// delayed until a Pod gets scheduled that needs the ResourceClaim. The
92-
// scheduler will consider all resource requirements of that Pod and
93-
// trigger allocation for a node that fits the Pod.
94-
AllocationModeWaitForFirstConsumer AllocationMode = "WaitForFirstConsumer"
95-
96-
// When a ResourceClaim has AllocationModeImmediate, allocation starts
97-
// as soon as the ResourceClaim gets created. This is done without
98-
// considering the needs of Pods that will use the ResourceClaim
99-
// because those Pods are not known yet.
100-
AllocationModeImmediate AllocationMode = "Immediate"
101-
)
102-
10377
// ResourceClaimStatus tracks whether the resource has been allocated and what
10478
// the resulting attributes are.
10579
type ResourceClaimStatus struct {

resource/v1alpha3/types_swagger_doc_generated.go

-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ var map_ResourceClaimSpec = map[string]string{
187187
"": "ResourceClaimSpec defines how a resource is to be allocated.",
188188
"resourceClassName": "ResourceClassName references the driver and additional parameters via the name of a ResourceClass that was created as part of the driver deployment.",
189189
"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.",
190-
"allocationMode": "Allocation can start immediately or when a Pod wants to use the resource. \"WaitForFirstConsumer\" is the default.",
191190
}
192191

193192
func (ResourceClaimSpec) SwaggerDoc() map[string]string {

testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
"apiGroup": "apiGroupValue",
5050
"kind": "kindValue",
5151
"name": "nameValue"
52-
},
53-
"allocationMode": "allocationModeValue"
52+
}
5453
},
5554
"status": {
5655
"driverName": "driverNameValue",
Binary file not shown.

testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ metadata:
3333
selfLink: selfLinkValue
3434
uid: uidValue
3535
spec:
36-
allocationMode: allocationModeValue
3736
parametersRef:
3837
apiGroup: apiGroupValue
3938
kind: kindValue

testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@
9292
"apiGroup": "apiGroupValue",
9393
"kind": "kindValue",
9494
"name": "nameValue"
95-
},
96-
"allocationMode": "allocationModeValue"
95+
}
9796
}
9897
}
9998
}
Binary file not shown.

testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ spec:
6666
selfLink: selfLinkValue
6767
uid: uidValue
6868
spec:
69-
allocationMode: allocationModeValue
7069
parametersRef:
7170
apiGroup: apiGroupValue
7271
kind: kindValue

0 commit comments

Comments
 (0)