From e80ca292f75e77c697235415a87d9c1ed3b0db95 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 7 Aug 2025 15:40:19 +0300 Subject: [PATCH] plugins/logger: handle missing events Fix crash with error "Plugin subscribed for unhandled events..." when started with -events=all. Signed-off-by: Markus Lehtonen --- plugins/logger/nri-logger.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/logger/nri-logger.go b/plugins/logger/nri-logger.go index 66fcb4ad..e6e6753f 100644 --- a/plugins/logger/nri-logger.go +++ b/plugins/logger/nri-logger.go @@ -93,6 +93,16 @@ func (p *plugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { return nil } +func (p *plugin) UpdatePodSandbox(_ context.Context, pod *api.PodSandbox, overHeadResources, resources *api.LinuxResources) error { + dump("UpdatePodSandbox", "pod", pod, "overHeadResources", overHeadResources, "resources", resources) + return nil +} + +func (p *plugin) PostUpdatePodSandbox(_ context.Context, pod *api.PodSandbox) error { + dump("PostUpdatePodSandbox", "pod", pod) + return nil +} + func (p *plugin) StopPodSandbox(_ context.Context, pod *api.PodSandbox) error { dump("StopPodSandbox", "pod", pod) return nil @@ -161,6 +171,11 @@ func (p *plugin) RemoveContainer(_ context.Context, pod *api.PodSandbox, contain return nil } +func (p *plugin) ValidateContainerAdjustment(_ context.Context, req *api.ValidateContainerAdjustmentRequest) error { + dump("ValidateContainerAdjustment", "request", req) + return nil +} + func (p *plugin) onClose() { os.Exit(0) }