Skip to content

Commit

Permalink
DRA: remove immediate allocation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pohly authored and k8s-publishing-bot committed Jun 13, 2024
1 parent 8cd8793 commit 35de2c0
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 219 deletions.
320 changes: 139 additions & 181 deletions resource/v1alpha3/generated.pb.go

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions resource/v1alpha3/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions resource/v1alpha3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,34 +72,8 @@ type ResourceClaimSpec struct {
// 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 {
Expand Down
1 change: 0 additions & 1 deletion resource/v1alpha3/types_swagger_doc_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ 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 {
Expand Down
3 changes: 1 addition & 2 deletions testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
"apiGroup": "apiGroupValue",
"kind": "kindValue",
"name": "nameValue"
},
"allocationMode": "allocationModeValue"
}
},
"status": {
"driverName": "driverNameValue",
Expand Down
Binary file modified testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.pb
Binary file not shown.
1 change: 0 additions & 1 deletion testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ metadata:
selfLink: selfLinkValue
uid: uidValue
spec:
allocationMode: allocationModeValue
parametersRef:
apiGroup: apiGroupValue
kind: kindValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@
"apiGroup": "apiGroupValue",
"kind": "kindValue",
"name": "nameValue"
},
"allocationMode": "allocationModeValue"
}
}
}
}
Binary file modified testdata/HEAD/resource.k8s.io.v1alpha3.ResourceClaimTemplate.pb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ spec:
selfLink: selfLinkValue
uid: uidValue
spec:
allocationMode: allocationModeValue
parametersRef:
apiGroup: apiGroupValue
kind: kindValue
Expand Down

0 comments on commit 35de2c0

Please sign in to comment.