Skip to content

Commit

Permalink
skip adding namespace to CustomResourceDefinitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Liujingfang1 committed Jul 17, 2018
1 parent 30ed50e commit 81f246e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/transformers/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ var skipNamespacePathConfigs = []PathConfig{
Kind: "ClusterRole",
},
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "CustomResourceDefinition",
},
},
}

var _ Transformer = &namespaceTransformer{}
Expand Down
16 changes: 16 additions & 0 deletions pkg/transformers/namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 81f246e

Please sign in to comment.