From 5d0a25f06f51f8e1c3ef2672727b66a58978f20e Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 11 Aug 2025 10:58:31 +0300 Subject: [PATCH] stub: allow overriding plugin name with Option Use the given name instead of erroring out. The command line flag takes precedence over the NRI_PLUGIN_NAME environment variable. Signed-off-by: Markus Lehtonen --- pkg/stub/stub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stub/stub.go b/pkg/stub/stub.go index 4dc7fbb2..c8d95ea1 100644 --- a/pkg/stub/stub.go +++ b/pkg/stub/stub.go @@ -217,7 +217,7 @@ func WithOnClose(onClose func()) Option { func WithPluginName(name string) Option { return func(s *stub) error { if s.name != "" { - return fmt.Errorf("plugin name already set (%q)", s.name) + log.Infof(noCtx, "Plugin name overridden: %q (previously %q)", name, s.name) } s.name = name return nil