From 482118a2bdb7e8150e64f338e3a9e45c1399d80e Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Mon, 30 Sep 2024 09:13:38 +0200 Subject: [PATCH] fix: check for selector be nil --- pkg/controllers/generic/export_syncer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controllers/generic/export_syncer.go b/pkg/controllers/generic/export_syncer.go index 1c82802cf..8d2864ba6 100644 --- a/pkg/controllers/generic/export_syncer.go +++ b/pkg/controllers/generic/export_syncer.go @@ -319,6 +319,10 @@ func (f *exporter) ExcludePhysical(_ client.Object) bool { } func (f *exporter) excludeObject(obj client.Object) bool { + if f.selector == nil { + return false + } + matches := f.selector.Matches(labels.Set(obj.GetLabels())) return !matches }