code: func FromKubeConfig(kubeconfig, kubeContext, namespaceOverride string) (Endpoint, error) {
  	cfg := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
  		&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeconfig},
  		&clientcmd.ConfigOverrides{CurrentContext: kubeContext, Context: clientcmdapi.Context{Namespace: namespaceOverride}})
  	ns, _, err := cfg.Namespace()
  	if err != nil {
  		return Endpoint{}, err
  	}
  	clientcfg, err := cfg.ClientConfig()
  	if err != nil {
  		return Endpoint{}, err
  	}
  	var ca, key, cert []byte
  	if ca, err = readFileOrDefault(clientcfg.CAFile, clientcfg.CAData); err != nil {
  		return Endpoint{}, err
  	}
  	if key, err = readFileOrDefault(clientcfg.KeyFile, clientcfg.KeyData); err != nil {
  		return Endpoint{}, err
  	}
  	if cert, err = readFileOrDefault(clientcfg.CertFile, clientcfg.CertData); err != nil {
  		return Endpoint{}, err
  	}
  	var tlsData *context.TLSData
  	if ca != nil || cert != nil || key != nil {
  		tlsData = &context.TLSData{
  			CA:   ca,
  			Cert: cert,
  			Key:  key,
  		}
  	}
  	return Endpoint{
  		EndpointMeta: EndpointMeta{
  			EndpointMetaBase: context.EndpointMetaBase{
  				Host:          clientcfg.Host,
  				SkipTLSVerify: clientcfg.Insecure,
  			},
  			DefaultNamespace: ns,
  			AuthProvider:     clientcfg.AuthProvider,
  			Exec:             clientcfg.ExecProvider,
  		},
  		TLSData: tlsData,
  	}, nil
  }
docs: // FromKubeConfig creates a Kubernetes endpoint from a Kubeconfig file