mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Catch and throw error when trying to get kube config
Handle error when building config to debug
This commit is contained in:
parent
c3a54de181
commit
c3115237a4
@ -28,7 +28,10 @@ func (widget *Widget) getInstance() *clientInstance {
|
||||
|
||||
// getKubeClient returns a kubernetes clientset for the kubeconfig provided
|
||||
func (widget *Widget) getKubeClient() kubernetes.Interface {
|
||||
config, _ := clientcmd.BuildConfigFromFlags("", widget.kubeconfig)
|
||||
config, err := clientcmd.BuildConfigFromFlags("", widget.kubeconfig)
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
}
|
||||
clientset, err := kubernetes.NewForConfig(config)
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user