From d14b6a17302378663cb72d1c090b2b2bc6e65bc9 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 20 Oct 2023 17:30:09 +0300 Subject: [PATCH] plugins/logger: Add NRI network messages to logger plugin Log NRI network messages Signed-off-by: Patrik Flykt --- plugins/logger/nri-logger.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugins/logger/nri-logger.go b/plugins/logger/nri-logger.go index 66fcb4ad..cbcfe9a0 100644 --- a/plugins/logger/nri-logger.go +++ b/plugins/logger/nri-logger.go @@ -161,6 +161,26 @@ func (p *plugin) RemoveContainer(_ context.Context, pod *api.PodSandbox, contain return nil } +func (p *plugin) NetworkConfigurationChanged(_ context.Context, cniconfigs []*api.CNIConfig) ([]*api.CNIConfig, error) { + dump("NetworkConfigurationchanged", "cniconfigs", cniconfigs) + return nil, nil +} + +func (p *plugin) PreSetupNetwork(_ context.Context, pod *api.PodSandbox, cniconfigs []*api.CNIConfig) ([]*api.CNICapabilities, error) { + dump("PreSetupNetwork", "pod", pod, "cniconfigs", cniconfigs) + return nil, nil +} + +func (p *plugin) PostSetupNetwork(_ context.Context, pod *api.PodSandbox, result []*api.Result) ([]*api.Result, error) { + dump("PostSetupNetwork", "pod", pod, "result", result) + return nil, nil +} + +func (p *plugin) NetworkDeleted(_ context.Context, pod *api.PodSandbox) error { + dump("NetworkDeleted", "pod", pod) + return nil +} + func (p *plugin) onClose() { os.Exit(0) }