Skip to content

Commit

Permalink
[fix] : now prevents the generic syncer from continuously deleting objs
Browse files Browse the repository at this point in the history
  • Loading branch information
facchettos committed Sep 9, 2024
1 parent b379167 commit 5aca65c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/controllers/generic/export_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,18 @@ func (f *exporter) TranslateMetadata(ctx *synccontext.SyncContext, vObj client.O
func (f *exporter) objectMatches(obj client.Object) bool {
return f.selector == nil || f.selector.Matches(labels.Set(obj.GetLabels()))
}

var _ syncertypes.ObjectExcluder = &exporter{}

func (f *exporter) ExcludeVirtual(vObj client.Object) bool {
return f.excludeObject(vObj)
}

func (f *exporter) ExcludePhysical(_ client.Object) bool {
return false
}

func (f *exporter) excludeObject(obj client.Object) bool {
matches := f.selector.Matches(labels.Set(obj.GetLabels()))
return !matches
}

0 comments on commit 5aca65c

Please sign in to comment.