code: func runKubeConfigFile(kubeConfigFileName string) func(workflow.RunData) error {
  	return func(c workflow.RunData) error {
  		data, ok := c.(InitData)
  		if !ok {
  			return errors.New("kubeconfig phase invoked with an invalid data struct")
  		}
  
  		// if external CA mode, skip certificate authority generation
  		if data.ExternalCA() {
  			fmt.Printf("[kubeconfig] External CA mode: Using user provided %s\n", kubeConfigFileName)
  			return nil
  		}
  
  		// if dryrunning, reads certificates from a temporary folder (and defer restore to the path originally specified by the user)
  		cfg := data.Cfg()
  		cfg.CertificatesDir = data.CertificateWriteDir()
  		defer func() { cfg.CertificatesDir = data.CertificateDir() }()
  
  		// creates the KubeConfig file (or use existing)
  		return kubeconfigphase.CreateKubeConfigFile(kubeConfigFileName, data.KubeConfigDir(), data.Cfg())
  	}
  }
docs: // runKubeConfigFile executes kubeconfig creation logic.