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:
Mark Rossetti 2025-02-19 12:27:34 -08:00
parent fbdf8905ea
commit 697293906a
No known key found for this signature in database
GPG Key ID: 33F9E7BD7AA6C1B0
2 changed files with 2 additions and 1 deletions

View File

@ -74,6 +74,7 @@ func PrintDryRunFiles(files []FileToPrint, w io.Writer) error {
if len(outputFilePath) == 0 {
outputFilePath = file.RealPath
}
outputFilePath = filepath.ToSlash(outputFilePath)
fmt.Fprintf(w, "[dryrun] Would write file %q with content:\n", outputFilePath)
fmt.Fprintf(w, "%s", fileBytes)

View File

@ -36,7 +36,7 @@ func TestPrintDryRunFiles(t *testing.T) {
}()
fileContents := "apiVersion: kubeadm.k8s.io/unknownVersion"
filename := "testfile"
cfgPath := filepath.Join(tmpdir, filename)
cfgPath := filepath.ToSlash(filepath.Join(tmpdir, filename))
err = os.WriteFile(cfgPath, []byte(fileContents), 0644)
if err != nil {
t.Fatalf("Couldn't write context to file: %v", err)