mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Add testharness mkdir function.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@@ -93,6 +94,12 @@ func (th *HarnessEnhanced) GetRoot() string {
|
|||||||
return th.ldr.Root()
|
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() {
|
func (th *HarnessEnhanced) Reset() {
|
||||||
if th.shouldWipeLdrRoot {
|
if th.shouldWipeLdrRoot {
|
||||||
if !strings.HasPrefix(th.ldr.Root(), os.TempDir()) {
|
if !strings.HasPrefix(th.ldr.Root(), os.TempDir()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user