Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overwriting plugin output with command's stdout #2644

Merged
merged 3 commits into from
Apr 20, 2024

Conversation

rtim75
Copy link
Contributor

@rtim75 rtim75 commented Mar 27, 2024

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 ready for review March 27, 2024 14:29
Copy link
Owner

@derailed derailed left a comment

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
2 of 3 checks passed
@derailed derailed mentioned this pull request Jun 15, 2024
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