Description of problem: When use kubeconfig option (such as --context, --cluster) with non exist value, the command gives confusing error message: error: No configuration file found, please login or point to an existing file: Version-Release number of selected component (if applicable): oc v1.0.8-16-gd81eca7 kubernetes v1.1.0-origin-1107-g4c8e6f4 How reproducible: Always Steps to Reproduce: 1. Start openshift 2. oc login, create a project and new app $ oc login --server=https://<server>:8443 -u gim -p abc $ oc new-project gim-proj $ oc new-app -f origin/examples/sample-app/application-template-stibuild.json 3. Check config file $ oc config view 4. Use invalid values 1> $ oc get bc --user='gim/<server>:8443' --cluster='no-this-cluster' -n gim-proj 2> $ oc get bc --context='no-this-context' 5. 1> check env $ env | grep KUBE # Got empty 2> check config $ ls ~/.kube/config /home/tester/.kube/config Actual results: 3. apiVersion: v1 clusters: - cluster: insecure-skip-tls-verify: true server: https://<server>:8443 name: <server>:8443 contexts: - context: cluster: <server>:8443 namespace: gim-proj user: gim/<server>:8443 name: gim-proj/<server>:8443/gim current-context: gim-proj/<server>:8443/gim kind: Config preferences: {} users: - name: gim/<server>:8443 user: token: 7vUToaM2QdO8DMCvCubPCabkiFoDjXFtrJdOYtde9As 4 1> and 2>: error: No configuration file found, please login or point to an existing file: 1. Via the command-line flag --config 2. Via the KUBECONFIG environment variable 3. In your home directory as ~/.kube/config Expected results: 4. Should give prompt such as no context/cluster found (once upon a time, it prompted so!), rather than no configuration file found. Indeed the configuration file exists Additional info:
Related PR: https://github.com/openshift/origin/pull/9944
Thanks. Verified in oc v1.4.0-alpha.0+e3a2814. Fixed. Now prompt message looks clearly: $ oc get bc --user='no-this' --cluster='no-this-cluster' error: auth info "no-this" does not exist $ oc get bc --cluster='no-this-cluster' error: cluster "no-this-cluster" does not exist