Skip to content

Commit 2b3ea80

Browse files
committed
add controlled NS check in the sync to simplify other object filters
1 parent 5a36194 commit 2b3ea80

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/psalabelsyncer/podsecurity_label_sync_controller.go

+4
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ func (c *PodSecurityAdmissionLabelSynchronizationController) sync(ctx context.Co
212212
return fmt.Errorf(errFmt, qKey, err)
213213
}
214214

215+
if !isNSControlled(ns) {
216+
return nil
217+
}
218+
215219
if ns.Status.Phase == corev1.NamespaceTerminating {
216220
klog.Infof("skipping synchronizing namespace %q because it is terminating", ns.Name)
217221
return nil

0 commit comments

Comments
 (0)