code: func WrapCli(dockerCli command.Cli, opts Options) (*KubeCli, error) {
  	cli := &KubeCli{
  		Cli: dockerCli,
  	}
  	var (
  		clientConfig clientcmd.ClientConfig
  		err          error
  	)
  	if dockerCli.CurrentContext() == "" {
  		clientConfig = kubernetes.NewKubernetesConfig(opts.Config)
  	} else {
  		clientConfig, err = kubecontext.ConfigFromContext(dockerCli.CurrentContext(), dockerCli.ContextStore())
  	}
  	if err != nil {
  		return nil, err
  	}
  
  	cli.kubeNamespace = opts.Namespace
  	if opts.Namespace == "" {
  		configNamespace, _, err := clientConfig.Namespace()
  		switch {
  		case os.IsNotExist(err), os.IsPermission(err):
  			return nil, errors.Wrap(err, "unable to load configuration file")
  		case err != nil:
  			return nil, err
  		}
  		cli.kubeNamespace = configNamespace
  	}
  
  	config, err := clientConfig.ClientConfig()
  	if err != nil {
  		return nil, err
  	}
  	cli.kubeConfig = config
  
  	clientSet, err := kubeclient.NewForConfig(config)
  	if err != nil {
  		return nil, err
  	}
  	cli.clientSet = clientSet
  
  	if opts.Orchestrator.HasAll() {
  		if err := cli.checkHostsMatch(); err != nil {
  			return nil, err
  		}
  	}
  	return cli, nil
  }
docs: // WrapCli wraps command.Cli with kubernetes specifics