code: func createKubeConfigFileIfNotExists(outDir, filename string, config *clientcmdapi.Config) error {
  	kubeConfigFilePath := filepath.Join(outDir, filename)
  
  	err := validateKubeConfig(outDir, filename, config)
  	if err != nil {
  		// Check if the file exist, and if it doesn't, just write it to disk
  		if !os.IsNotExist(err) {
  			return err
  		}
  		fmt.Printf("[kubeconfig] Writing %q kubeconfig file\n", filename)
  		err = kubeconfigutil.WriteToDisk(kubeConfigFilePath, config)
  		if err != nil {
  			return errors.Wrapf(err, "failed to save kubeconfig file %q on disk", kubeConfigFilePath)
  		}
  		return nil
  	}
  	// kubeadm doesn't validate the existing kubeconfig file more than this (kubeadm trusts the client certs to be valid)
  	// Basically, if we find a kubeconfig file with the same path; the same CA cert and the same server URL;
  	// kubeadm thinks those files are equal and doesn't bother writing a new file
  	fmt.Printf("[kubeconfig] Using existing kubeconfig file: %q\n", kubeConfigFilePath)
  
  	return nil
  }
docs: // createKubeConfigFileIfNotExists saves the KubeConfig object into a file if there isn't any file at the given path.
  // If there already is a kubeconfig file at the given path; kubeadm tries to load it and check if the values in the
  // existing and the expected config equals. If they do; kubeadm will just skip writing the file as it's up-to-date,
  // but if a file exists but has old content or isn't a kubeconfig file, this function returns an error.