Make kusttestharness shareable.

This commit is contained in:
Jeffrey Regan
2019-05-07 14:18:35 -07:00
parent 8c5d4128e0
commit bcc7412ef2
23 changed files with 389 additions and 343 deletions

View File

@@ -18,11 +18,13 @@ package target_test
import (
"testing"
"sigs.k8s.io/kustomize/pkg/kusttest"
)
func TestNamespacedGenerator(t *testing.T) {
th := NewKustTestHarness(t, "/app")
th.writeK("/app", `
th := kusttest_test.NewKustTestHarness(t, "/app")
th.WriteK("/app", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
@@ -45,11 +47,11 @@ secretGenerator:
literals:
- password.txt=anotherSecret
`)
m, err := th.makeKustTarget().MakeCustomizedResMap()
m, err := th.MakeKustTarget().MakeCustomizedResMap()
if err != nil {
t.Fatalf("Err: %v", err)
}
th.assertActualEqualsExpected(m, `
th.AssertActualEqualsExpected(m, `
apiVersion: v1
data:
altGreeting: Good Morning from non-default namespace!