fix kubeconfig write on windows (#626, @dragonflylee)

pull/601/head^2
蜻蜓特派员 3 years ago committed by GitHub
parent e98ff9a964
commit f648e381a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pkg/client/kubeconfig.go

@ -27,7 +27,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"time"
"github.com/rancher/k3d/v4/pkg/runtimes"
@ -81,8 +81,8 @@ func KubeconfigGetWrite(ctx context.Context, runtime runtimes.Runtime, cluster *
log.Debugf("Output path '%s' doesn't exist, trying to create it...", output)
// create directory path
if err := os.MkdirAll(path.Dir(output), 0755); err != nil {
log.Errorf("Failed to create output directory '%s'", path.Dir(output))
if err := os.MkdirAll(filepath.Dir(output), 0755); err != nil {
log.Errorf("Failed to create output directory '%s'", filepath.Dir(output))
return output, err
}

Loading…
Cancel
Save