Skip to content

Allow overwriting plugin output with command's stdout - #2644

Merged
derailed merged 3 commits into
derailed:masterfrom
rtim75:master
Apr 20, 2024
Merged

derailed merged 3 commits into
derailed:masterfrom
rtim75:master

Conversation

@rtim75

@rtim75 rtim75 commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

Closes #2617

This allows plugin developers to overwrite standard Plugin command launched successfully: "Command completed successfully:..... with their custom messages.

I have a plugin that finds all ingress hosts and saves them in MacOS clipboard:

plugins:
  copy-ingress-hosts:
    shortCut: h
    confirm: false
    overwriteOutput: true
    description: Copy ingress hosts
    scopes:
      - ingresses
    command: sh
    background: true
    args:
      - -c
      - >-
        kubectl --context $CONTEXT
        get ingress -n $NAMESPACE $NAME
        -o go-template='{{range .spec.rules}}{{.host}},{{end}}' | sed 's/,$//' | pbcopy && echo "Successfully copied hosts"

with overwriteOutput: true when I execute the plugin I receive Successfully copied hosts:

CleanShot 2024-03-27 at 15 48 41@2x

@rtim75
rtim75 marked this pull request as draft March 27, 2024 14:09
@rtim75
rtim75 marked this pull request as ready for review March 27, 2024 14:29

@derailed derailed left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rtim75 Nice! Thank you for this update!!

@derailed
derailed merged commit 21e091b into derailed:master Apr 20, 2024
@derailed derailed mentioned this pull request Jun 15, 2024
aeltai pushed a commit to aeltai/rk9s that referenced this pull request Feb 20, 2026
* Allow overwriting plugin output with command's stdout

* Update README.md

* remove 1  indentation level
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.

Plugin command execeution output

2 participants