mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-23 22:26:49 +00:00
Only decorate namespace for namespaced resources (#462)
Signed-off-by: zhujian <jiazhu@redhat.com>
This commit is contained in:
@@ -46,9 +46,10 @@ func (d *namespaceDecorator) decorate(obj *unstructured.Unstructured) (*unstruct
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
// set namespace for all manifests, if the manifest is cluster scoped, namespace will be ignored when
|
||||
// being applied.
|
||||
obj.SetNamespace(d.installNamespace)
|
||||
// If obj has no namespace set, we do not mutate namespace assuming it is cluster scoped.
|
||||
if len(obj.GetNamespace()) > 0 {
|
||||
obj.SetNamespace(d.installNamespace)
|
||||
}
|
||||
|
||||
paths, ok := d.paths[obj.GetKind()]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user