databricks / click

The "Command Line Interactive Controller for Kubernetes"
Apache License 2.0
1.49k stars 84 forks source link

On Mac, Using minikube - click crashes when trying to set context #102

Closed nagoclpl closed 5 years ago

nagoclpl commented 5 years ago

Hello,

I am on Mac.

I have started minikube. It has started successfully.

I have tried to set the context to minikube in click.

When trying to do so, click crashes.

Here's full details on the environment and the crash including backtrace ...

$
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.3
BuildVersion:   18D109
$
$ minikube status
host: Running
kubelet: Running
apiserver: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
$
$ RUST_BACKTRACE=1 target/release/click 
[none] [none] [none] > context minikube
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src/libcore/result.rs:997:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: click::certs::try_ip_to_name
  10: click::kube::Kluster::new
  11: click::config::kube::Config::cluster_for_context
  12: click::Env::set_context
  13: <click::cmd::Context as click::cmd::Cmd>::exec
  14: click::main
  15: std::rt::lang_start::{{closure}}
  16: std::panicking::try::do_call
  17: __rust_maybe_catch_panic
  18: std::rt::lang_start_internal
  19: main
$

Please help!

Thanks Naga

nicklan commented 5 years ago

Yep. See #98 for a workaround. I actually do have a hacky fix for this, and will push something that handles this case as soon as I find time to clean it up.