From c30d397665d1c8878d9be702f4e6618725107d18 Mon Sep 17 00:00:00 2001 From: patrickog11 Date: Tue, 1 Nov 2022 17:25:12 +0000 Subject: [PATCH] GRPC update (#69) Bug Fix for K8s v25 I have replicated this error on the newest version of kubernetes v25.3 with CRI-O runtime. The error is due to the order of initializing grpc with kubelet. Newest version of kubelet requires grpc to first start and then register a session. I've also tested the reordering of the grpc functions with older version of k8s (22.5) which works as expected. --- internal/deviceplugin/poolManager.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/deviceplugin/poolManager.go b/internal/deviceplugin/poolManager.go index bdc490f..ae623be 100644 --- a/internal/deviceplugin/poolManager.go +++ b/internal/deviceplugin/poolManager.go @@ -82,16 +82,16 @@ func (pm *PoolManager) Init(config PoolConfig) error { pm.BpfHandler = bpf.NewHandler() pm.NetHandler = networking.NewHandler() + if err := pm.startGRPC(); err != nil { + return err + } + logging.Infof("Pool "+pm.DevicePrefix+"/%s started serving", pm.Name) + if err := pm.registerWithKubelet(); err != nil { return err } logging.Infof("Pool "+pm.DevicePrefix+"/%s registered with Kubelet", pm.Name) - if err := pm.startGRPC(); err != nil { - return err - } - logging.Infof("Pool "+pm.DevicePrefix+"/%s started serving", pm.Name) - if len(pm.Devices) > 0 { pm.UpdateSignal <- true }