Origin: oc exec <pod> bash -c date doesn't work correctly [Solved]

Created on 27 Mar 2017  路  1Comment  路  Source: openshift/origin

Running oc exec bash -c date produces
Error from server: container date is not valid for pod

It appears that the oc command is interpreting the -c option as its own instead of passing it along as a command line argument to bash

Version

oc version
oc v1.4.1
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://oso-master.cisco.com:8443
openshift v1.4.0+208f053
kubernetes v1.4.0+776c994

Steps To Reproduce
  1. Start a pod that has a bash shell
  2. Determine the name of the running pod
  3. Run 'oc exec bash -c date'
Current Result

Error from server: container date is not valid for pod

Expected Result

Additional Information

N/A

Most helpful comment

I just realized that using -- to separate the exec from the command solves this problem

>All comments

I just realized that using -- to separate the exec from the command solves this problem

Was this page helpful?
0 / 5 - 0 ratings