Maintain resources in order loaded.

This commit is contained in:
Jeffrey Regan
2019-06-03 11:22:53 -07:00
parent af57fc3ece
commit 4162dbc2d8
39 changed files with 1074 additions and 617 deletions

View File

@@ -22,6 +22,7 @@ import (
"sigs.k8s.io/kustomize/pkg/resid"
"sigs.k8s.io/kustomize/pkg/resmap"
"sigs.k8s.io/kustomize/pkg/resource"
"sigs.k8s.io/kustomize/pkg/transformers/config"
)
@@ -50,7 +51,7 @@ func TestVarRef(t *testing.T) {
fs: []config.FieldSpec{
{Gvk: cmap, Path: "data"},
},
res: resmap.ResMap{
res: resmap.FromMap(map[resid.ResId]*resource.Resource{
resid.NewResId(cmap, "cm1"): rf.FromMap(
map[string]interface{}{
"apiVersion": "v1",
@@ -63,10 +64,10 @@ func TestVarRef(t *testing.T) {
"item2": "bla",
},
}),
},
}),
},
expected: expected{
res: resmap.ResMap{
res: resmap.FromMap(map[resid.ResId]*resource.Resource{
resid.NewResId(cmap, "cm1"): rf.FromMap(
map[string]interface{}{
"apiVersion": "v1",
@@ -79,7 +80,7 @@ func TestVarRef(t *testing.T) {
"item2": "bla",
},
}),
},
}),
unused: []string{"BAR"},
},
},