mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 17:34:21 +00:00
add namespace to id when create resmap from files
This commit is contained in:
@@ -45,6 +45,11 @@ metadata:
|
||||
---
|
||||
# some comment
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dply2
|
||||
namespace: test
|
||||
---
|
||||
`
|
||||
|
||||
@@ -68,12 +73,21 @@ metadata:
|
||||
"name": "dply2",
|
||||
},
|
||||
}),
|
||||
resid.NewResIdWithPrefixNamespace(deploy, "dply2", "", "test"): rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "dply2",
|
||||
"namespace": "test",
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
||||
m, _ := rmF.FromFiles(
|
||||
l, []string{"/home/seans/project/deployment.yaml"})
|
||||
if len(m) != 2 {
|
||||
t.Fatalf("%#v should contain 2 appResource, but got %d", m, len(m))
|
||||
if len(m) != 3 {
|
||||
t.Fatalf("%#v should contain 3 appResource, but got %d", m, len(m))
|
||||
}
|
||||
|
||||
if err := expected.ErrorIfNotEqual(m); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user