Consolidate IsClusterKind and IsNamespaceableKind method to avoid duplication

This commit is contained in:
Jerome Brette
2019-06-25 13:46:49 -05:00
parent 2bba0a6aa3
commit 74f5e74b89
4 changed files with 5 additions and 26 deletions

View File

@@ -62,7 +62,7 @@ const metaNamespace = "metadata/namespace"
// object itself doesn't live in a namespace).
func doIt(id resid.ResId, fs *config.FieldSpec) bool {
return fs.Path != metaNamespace ||
(fs.Path == metaNamespace && !id.IsClusterKind())
(fs.Path == metaNamespace && id.IsNamespaceableKind())
}
func (p *NamespaceTransformerPlugin) changeNamespace(

View File

@@ -63,7 +63,7 @@ const metaNamespace = "metadata/namespace"
// object itself doesn't live in a namespace).
func doIt(id resid.ResId, fs *config.FieldSpec) bool {
return fs.Path != metaNamespace ||
(fs.Path == metaNamespace && !id.IsClusterKind())
(fs.Path == metaNamespace && id.IsNamespaceableKind())
}
func (p *plugin) changeNamespace(