From cf3a12594011fb86345351df2235faf64ce52208 Mon Sep 17 00:00:00 2001 From: monopole Date: Fri, 23 Apr 2021 11:09:34 -0700 Subject: [PATCH] Add testharness mkdir function. --- api/testutils/kusttest/harnessenhanced.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/testutils/kusttest/harnessenhanced.go b/api/testutils/kusttest/harnessenhanced.go index 2a1e5fc30..a584f9a1a 100644 --- a/api/testutils/kusttest/harnessenhanced.go +++ b/api/testutils/kusttest/harnessenhanced.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "os/exec" + "path/filepath" "strings" "testing" @@ -93,6 +94,12 @@ func (th *HarnessEnhanced) GetRoot() string { return th.ldr.Root() } +func (th *HarnessEnhanced) MkDir(path string) string { + dir := filepath.Join(th.ldr.Root(), path) + th.GetFSys().Mkdir(dir) + return dir +} + func (th *HarnessEnhanced) Reset() { if th.shouldWipeLdrRoot { if !strings.HasPrefix(th.ldr.Root(), os.TempDir()) {