fabric8io / gofabric8

CLI used when working with fabric8 running on Kubernetes or OpenShift
https://fabric8.io/
Apache License 2.0
147 stars 72 forks source link

gofabric8 docker-env should be always non-interactive #175

Open rhuss opened 8 years ago

rhuss commented 8 years ago

When not logged in into k8s / minishift, gofabric8 docker-env will ask for a password. This makes problems when used in startup scripts or from fabric8-maven-plugin.

It would be better, that when not logged in, simply nothing will be printed out. Or only a warning, but nothing blocking.

jimmidyson commented 8 years ago

Hmm docker-env shouldn't ever require logging in...

rhuss commented 8 years ago
$ ~/fabric8/bin/gofabric8 docker-env
Please enter Username: admin
Please enter Password: admin
Unable to find any nodes: User "system:anonymous" cannot list all nodes in the cluster
docker-env is only available to run on clusters of 1 node%
rawlingsj commented 8 years ago

I'll have a look shortly, from memory I check the node name using the k client to see if it's minishift or minikube. If it's an openshift cluster and the login token has expired then a user would normally need to log in again before interacting with the API server. Anyway, I'll have a proper look when I'm at my laptop and have a think.

rawlingsj commented 8 years ago

@rhuss I'll take a stab checking the current ~/.kube/config context to tell whether we're minishift or minikube so that we dont need to use the kubernetes go client, which is the things that's throwing that error.

rawlingsj commented 8 years ago

hopefully this will be resolved with the latest release https://github.com/fabric8io/gofabric8/releases/tag/v0.4.67 following the PR https://github.com/fabric8io/gofabric8/pull/181 - I wasn't ever prompted for a username / password during my recent working so lets keep this issue open until it'c confirmed fixed.