Bug 1839631 - `oc rsh ` failed with panic error
Summary: `oc rsh ` failed with panic error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.5
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.5.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-25 06:33 UTC by zhou ying
Modified: 2020-07-13 17:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:41:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 436 0 None closed Bug 1839631: fix validation code for arguments passed 2020-07-05 18:56:51 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:41:39 UTC

Description zhou ying 2020-05-25 06:33:59 UTC
Description of problem:
`oc rsh ` failed with panic: runtime error: index out of range [1] with length 1


Version-Release number of selected component (if applicable):
[root@dhcp-140-138 roottest]# oc version -o yaml 
clientVersion:
  buildDate: "2020-05-23T15:25:26Z"
  compiler: gc
  gitCommit: 44354e2c9621e62b46d1854fd2d868f46fcdffff
  gitTreeState: clean
  gitVersion: 4.5.0-202005231517-44354e2
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64
openshiftVersion: 4.5.0-0.nightly-2020-05-24-223848
serverVersion:
  buildDate: "2020-05-23T18:34:28Z"
  compiler: gc
  gitCommit: afc841d
  gitTreeState: clean
  gitVersion: v1.18.2
  goVersion: go1.13.4
  major: "1"
  minor: 18+
  platform: linux/amd64


How reproducible:
always

Steps to Reproduce:
1.`oc rsh` 


Actual results:
1. [root@dhcp-140-138 roottest]# oc rsh po/kube-controller-manager-yinzhou25-nvnkx-master-0.c.openshift-qe.internal
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/openshift/oc/pkg/cli/rsh.(*RshOptions).Complete(0xc0011fe330, 0x353cfe0, 0xc0010c6090, 0xc001202580, 0xc0012e98f0, 0x1, 0x1, 0xc00138db48, 0x0)
	/builddir/build/BUILD/openshift-clients-git-1.b0bfdd0/__gopath/src/github.com/openshift/oc/pkg/cli/rsh/rsh.go:136 +0x5d0
github.com/openshift/oc/pkg/cli/rsh.NewCmdRsh.func1(0xc001202580, 0xc0012e98f0, 0x1, 0x1)
	/builddir/build/BUILD/openshift-clients-git-1.b0bfdd0/__gopath/src/github.com/openshift/oc/pkg/cli/rsh/rsh.go:101 +0x6d
github.com/spf13/cobra.(*Command).execute(0xc001202580, 0xc0012e98c0, 0x1, 0x1, 0xc001202580, 0xc0012e98c0)
	/builddir/build/BUILD/openshift-clients-git-1.b0bfdd0/__gopath/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:844 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0xc000fc8dc0, 0x2, 0xc000fc8dc0, 0x2)
	/builddir/build/BUILD/openshift-clients-git-1.b0bfdd0/__gopath/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:945 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
	/builddir/build/BUILD/openshift-clients-git-1.b0bfdd0/__gopath/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:885
main.main()
	/builddir/build/BUILD/openshift-clients-git-1.b0bfdd0/__gopath/src/github.com/openshift/oc/cmd/oc/oc.go:110 +0x853
[root@dhcp-140-138 roottest]# oc version -o yaml 


Expected results:
1. no error.

Additional info:

Comment 4 zhou ying 2020-05-26 02:46:38 UTC
[root@dhcp-140-138 ~]# oc rsh po/kube-controller-manager-yinzhou25-nvnkx-master-0.c.openshift-qe.internal
Defaulting container name to kube-controller-manager.
Use 'oc describe pod/kube-controller-manager-yinzhou25-nvnkx-master-0.c.openshift-qe.internal -n openshift-kube-controller-manager' to see all of the containers in this pod.
sh-4.2# ls
bin  boot  dev	etc  home  lib	lib64  media  mnt  opt	proc  root  run  sbin  srv  sys  tmp  usr  var
sh-4.2# date
Tue May 26 02:45:52 UTC 2020
sh-4.2# exit
exit
[root@dhcp-140-138 ~]# oc version -o yaml 
clientVersion:
  buildDate: "2020-05-25T20:42:46Z"
  compiler: gc
  gitCommit: e21eeff1b118f8eb0ea892a59bbc13a6f3488c89
  gitTreeState: clean
  gitVersion: 4.5.0-202005252037-e21eeff
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64

Comment 5 errata-xmlrpc 2020-07-13 17:41:26 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:2409


Note You need to log in before you can comment on or make changes to this bug.