| Summary: | windows oc cli doesn't use home env variable as home directory | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Christophe Augello <caugello> |
| Component: | oc | Assignee: | Fabiano Franz <ffranz> |
| Status: | CLOSED ERRATA | QA Contact: | Wei Sun <wsun> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.1.0 | CC: | aos-bugs, caugello, ederevea, erich, jokerman, mmccomas, tdawson, yanpzhan |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Windows | ||
| Whiteboard: | |||
| Fixed In Version: | atomic-openshift-3.1.1.905-1.git.0.ef5902f.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-05-12 16:28:30 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: | |
|
Description
Christophe Augello
2016-02-09 08:00:32 UTC
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 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 |