mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Move demandDirectoryRoot into kyaml/filesys (#4677)
* Move demandDirectoryRoot into kyaml/filesys * Make root directory platform-agnostic Support windows root directory. Dogfood own error package. * Use cleaner windows support implementation * Address feedback * Address feedback x2 * Re-apply go.sum changes to avoid CI errors
This commit is contained in:
20
kyaml/filesys/fsondisk_test_windows.go
Normal file
20
kyaml/filesys/fsondisk_test_windows.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2022 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package filesys
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func getOSRoot(t *testing.T) string {
|
||||
t.Helper()
|
||||
|
||||
sysDir, err := windows.GetSystemDirectory()
|
||||
require.NoError(t, err)
|
||||
return filepath.VolumeName(sysDir) + `\`
|
||||
}
|
||||
Reference in New Issue
Block a user