Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1771553

Summary: oc debug node does not return proper exit status
Product: OpenShift Container Platform Reporter: Maciej Szulik <maszulik>
Component: ocAssignee: Sally <somalley>
Status: CLOSED ERRATA QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.zCC: akostadi, aos-bugs, jokerman, mfojtik, somalley
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-04 11:15:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maciej Szulik 2019-11-12 15:27:55 UTC
$ oc --config=/tmp/kubeconfig debug node/ip-10-0-146-187.us-east-2.compute.internal -- false
Starting pod/ip-10-0-146-187us-east-2computeinternal-debug ...
To use host binaries, run `chroot /host`

Removing debug pod ...
$ echo $?
0

As you can see the command `false` has been executed but exit code of `oc` is still `0`.

– Client Version: v4.2.0

Comment 2 Sally 2020-02-01 13:58:57 UTC
https://github.com/openshift/oc/pull/277  for multiple bzs including this

Comment 4 zhou ying 2020-02-14 02:38:47 UTC
Confirmed with latest oc client, the issue has fixed:
[root@dhcp-140-138 ~]# oc version -o yaml 
clientVersion:
  buildDate: "2020-02-13T22:50:14Z"
  compiler: gc
  gitCommit: 5d7a12f03389b03b651f963cb5ee8ddfa9cff559
  gitTreeState: clean
  gitVersion: v4.4.0
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64


[root@dhcp-140-138 ~]# oc debug node/ip-xxxxx  -- /bin/missing param1 param2
Starting pod/ip-xxxxx-debug ...
To use host binaries, run `chroot /host`

Removing debug pod ...
error: container create failed: time="2020-02-14T02:34:39Z" level=error msg="container_linux.go:346: starting container process caused \"exec: \\\"/bin/missing\\\": stat /bin/missing: no such file or directory\""
container_linux.go:346: starting container process caused "exec: \"/bin/missing\": stat /bin/missing: no such file or directory"
[root@dhcp-140-138 ~]# echo $?
1

Comment 6 errata-xmlrpc 2020-05-04 11:15:07 UTC
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-2020:0581