mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 10:15:22 +00:00
Merge pull request #3839 from monopole/harnessMkDir
Add testharness mkdir function.
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user