Skip to content

Plugin handling if it retuns with non-zero exit status #904

@navidshaikh

Description

@navidshaikh

Bug report

If a plugin exits with non-zero status, help usage hint is printed, which seems to be unnecessary.

Expected behavior

If plugin execution path is invoked, let plugin print message or error.

Steps to reproduce the problem

  1. Create a sample plugin
cat ~/.config/kn/plugins/kn-source-test.sh 
#!/bin/bash
echo "hello"
exit 1
  1. Make sure its executable
chmod +x ~/.config/kn/plugins/kn-source-test.sh
  1. Run
kn source test.sh
hello
Error: exit status 1
Run 'kn --help' for usage

Notice the last help usage message printed.

kn version

master

kn version 
Version:      v20200619-local-a98d22a1-dirty
Build Date:   2020-06-19 15:35:19
Git Revision: a98d22a1
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.15.0)
* Eventing
  - sources.knative.dev/v1alpha2 (knative-eventing v0.15.0)
  - eventing.knative.dev/v1alpha1 (knative-eventing v0.15.0)

/kind cleanup

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions