Refactor crd package to depend on transformerconfig

This commit is contained in:
Jingfang Liu
2018-09-27 10:39:29 -07:00
parent 20fa90a137
commit 7ab710889c
20 changed files with 204 additions and 217 deletions

View File

@@ -562,23 +562,3 @@ func TestAnnotationsRun(t *testing.T) {
t.Fatalf("actual doesn't match expected: %v", err)
}
}
func TestAddPathConfigs(t *testing.T) {
aexpected := len(defaultAnnotationsPathConfigs) + 1
lexpected := len(defaultLabelsPathConfigs) + 1
pathConfigs := []PathConfig{
{
GroupVersionKind: &gvk.Gvk{Group: "GroupA", Kind: "KindB"},
Path: []string{"path", "to", "a", "field"},
CreateIfNotPresent: true,
},
}
AddLabelsPathConfigs(pathConfigs...)
AddAnnotationsPathConfigs(pathConfigs[0])
if len(defaultAnnotationsPathConfigs) != aexpected {
t.Fatalf("actual %v doesn't match expected: %v", len(defaultAnnotationsPathConfigs), aexpected)
}
if len(defaultLabelsPathConfigs) != lexpected {
t.Fatalf("actual %v doesn't match expected: %v", len(defaultLabelsPathConfigs), lexpected)
}
}