Fix discovering cluster wide resources with namespace (#904)

This commit is contained in:
Alexander Matyushentsev
2018-12-07 15:40:41 -08:00
committed by GitHub
parent 536c3209d2
commit 4f903ec08b
+4 -1
View File
@@ -39,9 +39,12 @@ type LiveStateCache interface {
func GetTargetObjKey(a *appv1.Application, un *unstructured.Unstructured, isNamespaced bool) kube.ResourceKey {
key := kube.GetResourceKey(un)
if isNamespaced && key.Namespace == "" {
if !isNamespaced {
key.Namespace = ""
} else if isNamespaced && key.Namespace == "" {
key.Namespace = a.Spec.Destination.Namespace
}
return key
}