Description of problem: Trying to use oc command with existing config, eg, placed under ~/.config/openshift_config, it cannot be parsed by the oc command and said no such file or path. Version-Release number of selected component (if applicable): oc v0.6.0.1-78-g1c816ed How reproducible: always Steps to Reproduce: 1. Run oc command with --config option $ oc get po --config=~/.kube/config 2. Run co login with --config option $ oc login https://master_ip:8443/ -u bmeng -p redhat --config=~/.config/openshift_config 3. Actual results: 1. $ oc get po --config=~/.kube/config error: stat ~/.kube/config: no such file or directory 2. It will generate a new dir named "~" under the current working dir. $ ls -alp total 16 drwxr-xr-x. 3 bmeng bmeng 20 Jun 15 16:50 ~/ drwx------. 3 bmeng bmeng 80 Jun 15 16:50 ./ drwxr-xr-x. 3 root root 18 Jun 15 16:48 ../ -rw-r--r--. 1 bmeng bmeng 18 Jan 11 18:06 .bash_logout -rw-r--r--. 1 bmeng bmeng 193 Jan 11 18:06 .bash_profile -rw-r--r--. 1 bmeng bmeng 231 Jan 11 18:06 .bashrc -rw-r--r--. 1 root root 1066 Jun 15 16:49 ca.crt Expected results: 1. It should be able to read the existing config file. 2. It should be able to generate the config file under the user's home. Additional info:
I think this will require upstream change to expand '~' to Getenv("HOME")
Fabiano, I can take this :)
(In reply to Meng Bo from comment #0) > Description of problem: > Trying to use oc command with existing config, eg, placed under > ~/.config/openshift_config, it cannot be parsed by the oc command and said > no such file or path. > > Version-Release number of selected component (if applicable): > oc v0.6.0.1-78-g1c816ed > > How reproducible: > always > > Steps to Reproduce: > 1. Run oc command with --config option > $ oc get po --config=~/.kube/config > 2. Run co login with --config option > $ oc login https://master_ip:8443/ -u bmeng -p redhat > --config=~/.config/openshift_config > 3. > > Actual results: > 1. > $ oc get po --config=~/.kube/config > error: stat ~/.kube/config: no such file or directory You have to use it without '=' sign: $ oc get po --config ~/.kube/config The ~ is expanded by the shell in this case. If you use '=' sign, it is passed with '~' unexpanded. > 2. It will generate a new dir named "~" under the current working dir. > $ ls -alp > total 16 > drwxr-xr-x. 3 bmeng bmeng 20 Jun 15 16:50 ~/ > drwx------. 3 bmeng bmeng 80 Jun 15 16:50 ./ > drwxr-xr-x. 3 root root 18 Jun 15 16:48 ../ > -rw-r--r--. 1 bmeng bmeng 18 Jan 11 18:06 .bash_logout > -rw-r--r--. 1 bmeng bmeng 193 Jan 11 18:06 .bash_profile > -rw-r--r--. 1 bmeng bmeng 231 Jan 11 18:06 .bashrc > -rw-r--r--. 1 root root 1066 Jun 15 16:49 ca.crt > > > Expected results: > 1. It should be able to read the existing config file. > 2. It should be able to generate the config file under the user's home. > > Additional info:
Checked with oc version v1.0.6-442-gc5a2711-dirty The '~' can be parsed without the '='. [user1@master ~]$ oc get po --config ~/.kube/config NAME READY STATUS RESTARTS AGE service-spreading-8dpi6 1/1 Running 1 16h service-spreading-hyvoa 1/1 Running 1 16h Move bug to verified.