mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Fixing k8s.io/kubernetes/cmd/kubeadm/app/util/dryrun unit tests on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
This commit is contained in:
parent
fbdf8905ea
commit
697293906a
@ -74,6 +74,7 @@ func PrintDryRunFiles(files []FileToPrint, w io.Writer) error {
|
|||||||
if len(outputFilePath) == 0 {
|
if len(outputFilePath) == 0 {
|
||||||
outputFilePath = file.RealPath
|
outputFilePath = file.RealPath
|
||||||
}
|
}
|
||||||
|
outputFilePath = filepath.ToSlash(outputFilePath)
|
||||||
|
|
||||||
fmt.Fprintf(w, "[dryrun] Would write file %q with content:\n", outputFilePath)
|
fmt.Fprintf(w, "[dryrun] Would write file %q with content:\n", outputFilePath)
|
||||||
fmt.Fprintf(w, "%s", fileBytes)
|
fmt.Fprintf(w, "%s", fileBytes)
|
||||||
|
@ -36,7 +36,7 @@ func TestPrintDryRunFiles(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
fileContents := "apiVersion: kubeadm.k8s.io/unknownVersion"
|
fileContents := "apiVersion: kubeadm.k8s.io/unknownVersion"
|
||||||
filename := "testfile"
|
filename := "testfile"
|
||||||
cfgPath := filepath.Join(tmpdir, filename)
|
cfgPath := filepath.ToSlash(filepath.Join(tmpdir, filename))
|
||||||
err = os.WriteFile(cfgPath, []byte(fileContents), 0644)
|
err = os.WriteFile(cfgPath, []byte(fileContents), 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Couldn't write context to file: %v", err)
|
t.Fatalf("Couldn't write context to file: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user