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.
This commit is contained in:
Patrick Ohly
2024-11-12 17:22:05 +01:00
parent 6b031e50b2
commit 6c27e8dc8f
3 changed files with 56 additions and 55 deletions

View File

@@ -65,8 +65,8 @@ import (
)
const (
NodePrepareResourcesMethod = "/v1beta1.DRAPlugin/NodePrepareResources"
NodeUnprepareResourcesMethod = "/v1beta1.DRAPlugin/NodeUnprepareResources"
NodePrepareResourcesMethod = "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodePrepareResources"
NodeUnprepareResourcesMethod = "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodeUnprepareResources"
)
type Nodes struct {