Hide Forgot
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
https://bugzilla.redhat.com/show_bug.cgi?id=1231760
@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?
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.
I just don't see this being worth the effort.