mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 17:34:21 +00:00
Update pathconfigs library
implement CRD support and add unit tests Add integration test for crd support address comments
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/kubernetes-sigs/kustomize/pkg/resmap"
|
||||
"github.com/kubernetes-sigs/kustomize/pkg/resource"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
func TestPrefixNameRun(t *testing.T) {
|
||||
@@ -91,3 +92,19 @@ func TestPrefixNameRun(t *testing.T) {
|
||||
t.Fatalf("actual doesn't match expected: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddPrefixPathConfigs(t *testing.T) {
|
||||
expected := len(defaultNamePrefixPathConfigs) + 1
|
||||
|
||||
pathConfigs := []PathConfig{
|
||||
{
|
||||
GroupVersionKind: &schema.GroupVersionKind{Group: "GroupA", Kind: "KindB"},
|
||||
Path: []string{"path", "to", "a", "field"},
|
||||
CreateIfNotPresent: true,
|
||||
},
|
||||
}
|
||||
AddPrefixPathConfigs(pathConfigs...)
|
||||
if len(defaultNamePrefixPathConfigs) != expected {
|
||||
t.Fatalf("actual %v doesn't match expected: %v", len(defaultNamePrefixPathConfigs), expected)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user