Description of problem: Since oc 3.1.1.6 windows oc cli seems to use homeDrive + homePath to define the user's home directory. before 3.1.1.6 oc kubeconfig was written in directory from HOME env variable. Version-Release number of selected component (if applicable): oc cli 3.1.1.6 How reproducible: Steps to Reproduce: 1. Have homeDrive != actual home drive (Z:\ vs C:\ Actual results: C:\Users\XXXX>oc version oc v3.1.1.6 kubernetes v1.1.0-origin-1107-g4c8e6f4 C:\Users\XXXX>oc whoami error: open Z:\/.kube/config: The system cannot find the path specified. C:\Users\XXXX>env | grep HOMEDRIVE HOMEDRIVE=Z: C:\Users\SHJN2064>env | grep HOME HOME=/c/Users/XXXX Expected results: If HOME is set, use home prior to homeDrive + homePath Additional info:
We have to be careful about relying in the HOME env var on Windows because in many cases it is set to the wrong location, we've seen for example HOME=/c in a few cases. The recommended way of doing it is to first try HOMEDRIVE + HOMEPATH and then fallback to USERPROFILE, which is what we are doing[1]. We could add a check for the existence of these two locations, and add HOME as a third location which would be used if any of the other two options are available as env vars and/or path doesn't actually exist. Could you please confirm what you have in USERPROFILE? [1] References https://support.microsoft.com/en-us/kb/100843 http://blogs.msdn.com/b/patricka/archive/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions.aspx
Fixed in https://github.com/openshift/origin/pull/7449
The fix works on latest origin client oc v1.1.3-170-g14b50fd, but the codes are not merged in enterprise, so still can reproduce the bug on the latest oc v3.1.1.904, wait for a puddle containing the fix to verify the bug.
@Fabian USERPROFILE=C:\Users\XXXX Could we implement in https://github.com/openshift/origin/pull/7449 in downstream?
Christophe yes, it's coming downstream soon.
Tested on v3.1.1.905 Steps to verify: 1.1 $ export HOMEDRIVE=Z: 1.2. $ env|grep HOME HOMEPATH=\Users\oppenshift HOME=/c/Users/oppenshift HOMEDRIVE=Z: 1.3. $ ./oc.exe whoami yanpzhan 2.1 $ env|grep HOME HOMEPATH=\Users\oppenshift HOME=/z/Users/oppenshift HOMEDRIVE=C: 2.2 $ ./oc.exe whoami yanpzhan The bug has been fixed on v3.1.1.905, so move it to Verified.
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/RHSA-2016:1064