mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
Merge pull request #175 from Liujingfang1/crd
skip adding namespace to CustomResourceDefinitions
This commit is contained in:
@@ -50,6 +50,11 @@ var skipNamespacePathConfigs = []PathConfig{
|
||||
Kind: "ClusterRole",
|
||||
},
|
||||
},
|
||||
{
|
||||
GroupVersionKind: &schema.GroupVersionKind{
|
||||
Kind: "CustomResourceDefinition",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var _ Transformer = &namespaceTransformer{}
|
||||
|
||||
@@ -94,6 +94,14 @@ func TestNamespaceRun(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}),
|
||||
resource.NewResId(crd, "crd"): resource.NewResourceFromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apiextensions.k8s.io/v1beta1",
|
||||
"kind": "CustomResourceDefinition",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "crd",
|
||||
},
|
||||
}),
|
||||
}
|
||||
expected := resmap.ResMap{
|
||||
resource.NewResId(ns, "ns1"): resource.NewResourceFromMap(
|
||||
@@ -165,6 +173,14 @@ func TestNamespaceRun(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}),
|
||||
resource.NewResId(crd, "crd"): resource.NewResourceFromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apiextensions.k8s.io/v1beta1",
|
||||
"kind": "CustomResourceDefinition",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "crd",
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
||||
nst := NewNamespaceTransformer("test")
|
||||
|
||||
Reference in New Issue
Block a user