Skip to content

Commit

Permalink
Update kubeletplugin API for DynamicResourceAllocation to v1alpha2
Browse files Browse the repository at this point in the history
This PR makes the NodePrepareResources() and NodeUnprepareResource()
calls of the kubeletplugin API for DynamicResourceAllocation
symmetrical. It wasn't clear how one would use the set of CDIDevices
passed back in the NodeUnprepareResource() of the v1alpha1 API, and the
new API now passes back the full ResourceHandle that was originally
passed to the Prepare() call. Passing the ResourceHandle is strictly
more informative and a plugin could always (re)derive the set of
CDIDevice from it.

This is a breaking change, but this release is scheduled to break
multiple APIs for DynamicResourceAllocation, so it makes sense to do
this now instead of later.

Signed-off-by: Kevin Klues <[email protected]>

Kubernetes-commit: 579295e727a12deadad9e084ff8efd2708707091
  • Loading branch information
klueska authored and k8s-publishing-bot committed Mar 13, 2023
1 parent 507755b commit 7045907
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 65 deletions.
112 changes: 54 additions & 58 deletions pkg/apis/dra/v1alpha1/api.pb.go → pkg/apis/dra/v1alpha2/api.pb.go

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 The Kubernetes Authors.
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.
Expand All @@ -18,8 +18,8 @@ limitations under the License.

syntax = "proto3";

package v1alpha1;
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha1";
package v1alpha2;
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha2";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

Expand Down Expand Up @@ -49,7 +49,7 @@ message NodePrepareResourceRequest {
// The name of the Resource claim (ResourceClaim.meta.Name)
// This field is REQUIRED.
string claim_name = 3;
// Resource handle (AllocationResult.ResourceHandle)
// Resource handle (AllocationResult.ResourceHandles[*].Data)
// This field is REQUIRED.
string resource_handle = 4;
}
Expand All @@ -71,9 +71,9 @@ message NodeUnprepareResourceRequest {
// The name of the Resource claim (ResourceClaim.meta.Name)
// This field is REQUIRED.
string claim_name = 3;
// List of fully qualified CDI device names
// Kubelet plugin returns them in the NodePrepareResourceResponse
repeated string cdi_devices = 4;
// Resource handle (AllocationResult.ResourceHandles[*].Data)
// This field is REQUIRED.
string resource_handle = 4;
}

message NodeUnprepareResourceResponse {
Expand Down

0 comments on commit 7045907

Please sign in to comment.