datawire / kubernaut

Instant ephemeral Kubernetes clusters for development and testing
Apache License 2.0
117 stars 8 forks source link

[RFE] Add a --quiet flag #44

Closed LukeShu closed 2 years ago

LukeShu commented 6 years ago

Whenever you call kubernaut claims create it spits out a big usage message:

$ ./kubernaut claims create --name "$(cat mycluster.knaut.claim)" --cluster-group main

 Your clusters kubeconfig has been written to the below path:

 /home/lukeshu/.kube/mycluster-lukeshu-1fe24e81-5104-476c-8983-288b4594da26.yaml

 Usage Instructions:

 There are several ways you can use this kubeconfig file:

 1. Pass --kubeconfig to the `kubectl` command:

    kubectl --kubeconfig=/home/lukeshu/.kube/mycluster-lukeshu-1fe24e81-5104-476c-8983-288b4594da26.yaml ...

 2. Set the KUBECONFIG environment variable:

    export KUBECONFIG=/home/lukeshu/.kube/mycluster-lukeshu-1fe24e81-5104-476c-8983-288b4594da26.yaml

This is surely helpful for interactive use. However, when calling it from another program/script, this is just noise that the user would have to ignore. I'm hesitant to just say >/dev/null because if there is diagnostic output, I don't want to hide it.

I think that it would be a good UI improvement to either

ark3 commented 6 years ago

Another approach is to check stdout for a tty and only show interactive stuff if it has one.

LukeShu commented 6 years ago

If it's called from a shell script, the script has no real reason to capture stdout, so kubernaut's stdout would probably still be a tty, even if it's not being called interactively. The "solution" to which would be for the caller to pipe it to cat, which is a real bad smell.

LukeShu commented 2 years ago

Kubernaut is dead.