Description of problem: Create a oc plugin with negative command, exec the oc plugin command and check exit code again on terminal, exit code is not correct. Version-Release number of selected component (if applicable): oc v3.7.0-0.147.1 How reproducible: Always Steps to Reproduce: 1. # mkdir -p /usr/share/kubectl/plugins/myplugin 2. # vi /usr/share/kubectl/plugins/myplugin/plugin.yaml name: "myplugin" shortDesc: "My plugin's short description" command: "ls non-existed" 3. # oc plugin myplugin 4. check exit code by echo $? Actual results: 3. ls: cannot access non-existed: No such file or directory error: exit status 2 4. 1 Expected results: 4. Exit code should be 2 Additional info:
Checked on oc v3.7.0-0.150 and it reproduces.
Upstream PR: https://github.com/kubernetes/kubernetes/pull/54094
Upstream PR [1] has merged. Changes will be brought in to Origin after the next rebase. 1. https://github.com/kubernetes/kubernetes/pull/54094
Issue has been fixed for long time. Verified with oc v3.9.30: [xxia@fedora28 my]$ oc plugin myplugin ls: cannot access 'non-existed': No such file or directory error: exit status 2 [xxia@fedora28 my]$ echo $? 2 Moving to VERIFIED directly, thanks
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0403