Skip to content

Commit 5d0a25f

Browse files
committed
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 <[email protected]>
1 parent 8c53e55 commit 5d0a25f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/stub/stub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func WithOnClose(onClose func()) Option {
217217
func WithPluginName(name string) Option {
218218
return func(s *stub) error {
219219
if s.name != "" {
220-
return fmt.Errorf("plugin name already set (%q)", s.name)
220+
log.Infof(noCtx, "Plugin name overridden: %q (previously %q)", name, s.name)
221221
}
222222
s.name = name
223223
return nil

0 commit comments

Comments
 (0)