mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-21 14:32:03 +00:00
Cut more ties to k8sdeps
Add tests for all the plugins.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/pkg/kusttest"
|
||||
"sigs.k8s.io/kustomize/plugin"
|
||||
)
|
||||
|
||||
func TestStringPrefixerPlugin(t *testing.T) {
|
||||
tc := plugin.NewEnvForTest(t).Set()
|
||||
defer tc.Reset()
|
||||
|
||||
tc.BuildGoPlugin(
|
||||
"someteam.example.com", "v1", "StringPrefixer")
|
||||
th := kusttest_test.NewKustTestPluginHarness(t, "/app")
|
||||
|
||||
m := th.LoadAndRunTransformer(`
|
||||
apiVersion: someteam.example.com/v1
|
||||
kind: StringPrefixer
|
||||
metadata:
|
||||
name: wowsa
|
||||
`,
|
||||
`apiVersion: apps/v1
|
||||
kind: MeatBall
|
||||
metadata:
|
||||
name: meatball
|
||||
`)
|
||||
|
||||
th.AssertActualEqualsExpected(m, `
|
||||
apiVersion: apps/v1
|
||||
kind: MeatBall
|
||||
metadata:
|
||||
name: wowsa-meatball
|
||||
`)
|
||||
}
|
||||
Reference in New Issue
Block a user