mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
Start pluglib, a set of public, plugin specific functions.
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
|
||||
"sigs.k8s.io/kustomize/v3/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/resmap"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/types"
|
||||
"sigs.k8s.io/yaml"
|
||||
@@ -39,9 +38,8 @@ spec:
|
||||
app: dev
|
||||
`
|
||||
|
||||
func (p *plugin) Config(
|
||||
_ ifc.Loader, rf *resmap.Factory, config []byte) error {
|
||||
p.rf = rf
|
||||
func (p *plugin) Config(h *resmap.PluginHelpers, config []byte) error {
|
||||
p.rf = h.ResmapFactory()
|
||||
return yaml.Unmarshal(config, p)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,13 @@ package main_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/v3/pluglib"
|
||||
|
||||
"sigs.k8s.io/kustomize/v3/pkg/kusttest"
|
||||
"sigs.k8s.io/kustomize/v3/pkg/plugins/testenv"
|
||||
)
|
||||
|
||||
func TestSomeServiceGeneratorPlugin(t *testing.T) {
|
||||
tc := testenv.NewEnvForTest(t).Set()
|
||||
tc := pluglib.NewEnvForTest(t).Set()
|
||||
defer tc.Reset()
|
||||
|
||||
tc.BuildGoPlugin(
|
||||
|
||||
Reference in New Issue
Block a user