Skip to content

feat(plugin): add runWithNoSelection option#4032

Open
ykgoesdumb wants to merge 1 commit into
derailed:masterfrom
ykgoesdumb:fix-3992-run-plugin-no-selection
Open

feat(plugin): add runWithNoSelection option#4032
ykgoesdumb wants to merge 1 commit into
derailed:masterfrom
ykgoesdumb:fix-3992-run-plugin-no-selection

Conversation

@ykgoesdumb

Copy link
Copy Markdown

Plugins currently exit early when no resource is selected, so they cannot be triggered in an empty namespace (#3992).

This adds an opt-in runWithNoSelection plugin option (default false, so existing plugins are unaffected). When enabled, the plugin runs even without a selection, and $NAMESPACE falls back to the current view namespace so namespace-scoped plugins keep working.

Tested with go build, the config/view unit tests, and manually against a live cluster: a plugin with the flag runs in an empty namespace with $NAMESPACE populated, while a plugin without it behaves as before.

Closes #3992

Plugins exit early when no resource is selected, so they cannot be run
in an empty namespace. Add an opt-in runWithNoSelection flag (default
false) that lets a plugin run without a selection. The viewer's
namespace is used for $NAMESPACE so namespace-scoped plugins keep working.

Closes derailed#3992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't run plugins in empty namespaces

1 participant