Merge pull request #130287 from marosset/windows-unit-tests-cmd-kubeadm-app-util-dryrun-fixes

Fixing k8s.io/kubernetes/cmd/kubeadm/app/util/dryrun unit tests on Windows
This commit is contained in:
Kubernetes Prow Robot 2025-02-19 18:20:26 -08:00 committed by GitHub
commit 72333a838a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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)