Skip to content

Commit 6972939

Browse files
committed
Fixing k8s.io/kubernetes/cmd/kubeadm/app/util/dryrun unit tests on Windows
Signed-off-by: Mark Rossetti <[email protected]>
1 parent fbdf890 commit 6972939

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmd/kubeadm/app/util/dryrun/dryrun.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func PrintDryRunFiles(files []FileToPrint, w io.Writer) error {
7474
if len(outputFilePath) == 0 {
7575
outputFilePath = file.RealPath
7676
}
77+
outputFilePath = filepath.ToSlash(outputFilePath)
7778

7879
fmt.Fprintf(w, "[dryrun] Would write file %q with content:\n", outputFilePath)
7980
fmt.Fprintf(w, "%s", fileBytes)

cmd/kubeadm/app/util/dryrun/dryrun_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestPrintDryRunFiles(t *testing.T) {
3636
}()
3737
fileContents := "apiVersion: kubeadm.k8s.io/unknownVersion"
3838
filename := "testfile"
39-
cfgPath := filepath.Join(tmpdir, filename)
39+
cfgPath := filepath.ToSlash(filepath.Join(tmpdir, filename))
4040
err = os.WriteFile(cfgPath, []byte(fileContents), 0644)
4141
if err != nil {
4242
t.Fatalf("Couldn't write context to file: %v", err)

0 commit comments

Comments
 (0)