Skip to content

Commit 6c27e8d

Browse files
committed
DRA kubelet: use unique protobuf package name
As mentioned in https://protobuf.dev/programming-guides/style, package names "should be unique". For generated API pb files, Kubernetes uses "k8s.io.api.<api group>.<version>". The same approach is now used for the kubelet DRA v1beta1 API. This can be changed without a breaking change because the API is still unreleased. This avoids a conflict between the DevicePlugin and the DRA API when both get used by kubelet: 2024/11/10 12:51:40 proto: duplicate proto type registered: v1beta1.Device The exact impact of that conflict is unknown but it seems better to pro-actively avoid the problem.
1 parent 6b031e5 commit 6c27e8d

File tree

3 files changed

+56
-55
lines changed

3 files changed

+56
-55
lines changed

staging/src/k8s.io/kubelet/pkg/apis/dra/v1beta1/api.pb.go

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

staging/src/k8s.io/kubelet/pkg/apis/dra/v1beta1/api.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818

1919
syntax = "proto3";
2020

21-
package v1beta1;
21+
package k8s.io.kubelet.pkg.apis.dra.v1beta1;
2222
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1beta1";
2323

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

test/e2e/dra/deploy.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ import (
6565
)
6666

6767
const (
68-
NodePrepareResourcesMethod = "/v1beta1.DRAPlugin/NodePrepareResources"
69-
NodeUnprepareResourcesMethod = "/v1beta1.DRAPlugin/NodeUnprepareResources"
68+
NodePrepareResourcesMethod = "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodePrepareResources"
69+
NodeUnprepareResourcesMethod = "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodeUnprepareResources"
7070
)
7171

7272
type Nodes struct {

0 commit comments

Comments
 (0)