code: func validateKubeConfig(outDir, filename string, config *clientcmdapi.Config) error {
  	kubeConfigFilePath := filepath.Join(outDir, filename)
  
  	if _, err := os.Stat(kubeConfigFilePath); err != nil {
  		return err
  	}
  
  	// The kubeconfig already exists, let's check if it has got the same CA and server URL
  	currentConfig, err := clientcmd.LoadFromFile(kubeConfigFilePath)
  	if err != nil {
  		return errors.Wrapf(err, "failed to load kubeconfig file %s that already exists on disk", kubeConfigFilePath)
  	}
  
  	expectedCtx := config.CurrentContext
  	expectedCluster := config.Contexts[expectedCtx].Cluster
  	currentCtx := currentConfig.CurrentContext
  	currentCluster := currentConfig.Contexts[currentCtx].Cluster
  
  	// If the current CA cert on disk doesn't match the expected CA cert, error out because we have a file, but it's stale
  	if !bytes.Equal(currentConfig.Clusters[currentCluster].CertificateAuthorityData, config.Clusters[expectedCluster].CertificateAuthorityData) {
  		return errors.Errorf("a kubeconfig file %q exists already but has got the wrong CA cert", kubeConfigFilePath)
  	}
  	// If the current API Server location on disk doesn't match the expected API server, error out because we have a file, but it's stale
  	if currentConfig.Clusters[currentCluster].Server != config.Clusters[expectedCluster].Server {
  		return errors.Errorf("a kubeconfig file %q exists already but has got the wrong API Server URL", kubeConfigFilePath)
  	}
  
  	return nil
  }
docs: // validateKubeConfig check if the kubeconfig file exist and has the expected CA and server URL