From 39c344c1c17947274625f22239865644498b62f2 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Thu, 2 Jan 2025 17:37:51 +0100 Subject: [PATCH] fix: exclude import by other vclusters (#2365) (cherry picked from commit e10489776677130e9e75da1a590ff4f0f156e079) --- pkg/mappings/generic/mapper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/mappings/generic/mapper.go b/pkg/mappings/generic/mapper.go index 4ad1d23144..240939a73e 100644 --- a/pkg/mappings/generic/mapper.go +++ b/pkg/mappings/generic/mapper.go @@ -108,6 +108,12 @@ func TryToTranslateBackByAnnotations(ctx *synccontext.SyncContext, req types.Nam return types.NamespacedName{} } + // exclude objects that are from other vClusters + markerLabel := pObj.GetLabels()[translate.MarkerLabel] + if markerLabel != "" && markerLabel != translate.VClusterName { + return types.NamespacedName{} + } + // make sure kind matches gvk, ok := pAnnotations[translate.KindAnnotation] if ok && objectGvk.String() != gvk {