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 dcd9510
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 (s *exporter) ExcludeVirtual(vObj client.Object) bool {

Check failure on line 313 in pkg/controllers/generic/export_syncer.go

View workflow job for this annotation

GitHub Actions / lint

receiver-naming: receiver name s should be consistent with previous receiver name f for exporter (revive)
return s.excludeObject(vObj)
}

func (s *exporter) ExcludePhysical(pObj client.Object) bool {

Check failure on line 317 in pkg/controllers/generic/export_syncer.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'pObj' seems to be unused, consider removing or renaming it as _ (revive)
return false
}

func (s *exporter) excludeObject(obj client.Object) bool {

Check failure on line 321 in pkg/controllers/generic/export_syncer.go

View workflow job for this annotation

GitHub Actions / lint

receiver-naming: receiver name s should be consistent with previous receiver name f for exporter (revive)
matches := s.selector.Matches(labels.Set(obj.GetLabels()))
return !matches
}

0 comments on commit dcd9510

Please sign in to comment.