Bug 1386119 - oadm diagnostics --config= don't recognize the symbol "~"
Summary: oadm diagnostics --config= don't recognize the symbol "~"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-18 08:35 UTC by Peng Li
Modified: 2018-01-15 18:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-15 18:16:55 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Peng Li 2016-10-18 08:35:17 UTC
Description of problem:
oadm diagnostics --config= don't recognize the symbol "~"

Version-Release number of selected component (if applicable):
openshift v3.3.1.2
kubernetes v1.3.0+52492b4
etcd 2.3.0+git


How reproducible:
always

Steps to Reproduce:
1. login a OpenShift, so config exist under ~/.kube/config
2. run 'oadm diagnostics --config=~/.kube/config'

ERROR: [DCli1001 from diagnostic ConfigLoading@openshift/origin/pkg/diagnostics/client/config_loading.go:79]
       The client configuration file was not found where the --config flag indicated:
         ~/.kube/config
       A config file was found at the following location:
         /home/penli/.kube/config
       If you wish to use this file for client configuration, you can specify it
       with the --config flag, or just not specify the flag.
       
ERROR: [CED3015 from controller openshift/origin/pkg/cmd/admin/diagnostics/diagnostics.go]
       Client configuration failed to load; skipping client and cluster diagnostics due to error: stat ~/.kube/config: no such file or directory

3. use the same config, but with the absolute path
 no error shown.

4. use other symbol like '.' or '..', no such error
[penli@dhcp-137-185 .kube]$ pwd
/home/penli/.kube
[penli@dhcp-137-185 .kube]$ oadm diagnostics --config=./config


Actual results:
      The client configuration file was not found where the --config flag indicated:
         ~/.kube/config


Expected results:
no error show

Additional info:
n/a

Comment 2 Peng Li 2016-10-18 09:27:43 UTC
@lmeyer, after file this bug, xxia point me above bug which looks alike but with 'oc', not 'oadm', should we add some document in case user also run into this issue?

Comment 3 Luke Meyer 2016-10-18 13:51:22 UTC
It's bash that is responsible for expanding ~ and it only does it for the first character of a parameter, which is why you're running into this.

Given it's bash's "problem" and the use of --config is pretty rare for most users (the problem exists for any parameter, but I doubt any other will ever point to something in ~), I'm not inclined to try to document this. The only change I can think of that would help much would be to modify the auto-created option docs:

  $ oadm diagnostics -h
  [...]
      --config='': Path to the config file to use for CLI requests.

If we left out "=" there it might encourage new users to do the same in their invocations. That would be a CLI concern.

Comment 4 Luke Meyer 2018-01-15 18:16:55 UTC
I just don't see this being worth the effort.


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