mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Fix api tests on MacOS
On MacOS /var is a symlink for /private/var and we can end up having the loader having a /private/var path while the TMPDIR has a /var path which triggers a panic. Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
This commit is contained in:
@@ -102,7 +102,10 @@ func (th *HarnessEnhanced) MkDir(path string) string {
|
||||
|
||||
func (th *HarnessEnhanced) Reset() {
|
||||
if th.shouldWipeLdrRoot {
|
||||
if !strings.HasPrefix(th.ldr.Root(), os.TempDir()) {
|
||||
root, _ := filepath.EvalSymlinks(th.ldr.Root())
|
||||
tmpdir, _ := filepath.EvalSymlinks(os.TempDir())
|
||||
|
||||
if !strings.HasPrefix(root, tmpdir) {
|
||||
// sanity check.
|
||||
panic("something strange about th.ldr.Root() = " + th.ldr.Root())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user