Add some kustomization tests.

This commit is contained in:
Jeffrey Regan
2019-10-30 14:22:11 -07:00
parent ac3c53557e
commit 364a2342df
4 changed files with 101 additions and 13 deletions

View File

@@ -63,15 +63,19 @@ func NewKustTestHarnessFull(
}
func (th *KustTestHarness) MakeKustTarget() *target.KustTarget {
kt, err := target.NewKustTarget(
th.ldr, valtest_test.MakeFakeValidator(), th.rf,
transformer.NewFactoryImpl(), th.pl)
kt, err := th.MakeKustTargetOrErr()
if err != nil {
th.t.Fatalf("Unexpected construction error %v", err)
}
return kt
}
func (th *KustTestHarness) MakeKustTargetOrErr() (*target.KustTarget, error) {
return target.NewKustTarget(
th.ldr, valtest_test.MakeFakeValidator(), th.rf,
transformer.NewFactoryImpl(), th.pl)
}
func (th *KustTestHarness) WriteF(dir string, content string) {
err := th.ldr.AddFile(dir, []byte(content))
if err != nil {