Start pluglib, a set of public, plugin specific functions.

This commit is contained in:
Jeffrey Regan
2019-10-14 17:52:40 -07:00
committed by jregan
parent 2fadb4dd59
commit 41a008e9a3
78 changed files with 280 additions and 329 deletions

View File

@@ -7,8 +7,9 @@ import (
"strings"
"testing"
"sigs.k8s.io/kustomize/v3/pluglib"
"sigs.k8s.io/kustomize/v3/pkg/kusttest"
"sigs.k8s.io/kustomize/v3/pkg/plugins/testenv"
)
const (
@@ -66,7 +67,7 @@ spec:
)
func TestPatchTransformerMissingFile(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(
@@ -90,7 +91,7 @@ path: patch.yaml
}
func TestPatchTransformerBadPatch(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(
@@ -114,7 +115,7 @@ patch: "thisIsNotAPatch"
}
func TestPatchTransformerMissingSelector(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(
@@ -138,7 +139,7 @@ patch: '[{"op": "add", "path": "/spec/template/spec/dnsPolicy", "value": "Cluste
}
func TestPatchTransformerBothEmptyPathAndPatch(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(
@@ -161,7 +162,7 @@ metadata:
}
func TestPatchTransformerBothNonEmptyPathAndPatch(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(
@@ -186,7 +187,7 @@ Patch: "something"
}
func TestPatchTransformerFromFiles(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(
@@ -268,7 +269,7 @@ spec:
}
func TestPatchTransformerWithInline(t *testing.T) {
tc := testenv.NewEnvForTest(t).Set()
tc := pluglib.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildGoPlugin(