Merge pull request #120912 from sttts/sttts-cluster-authn-filter

controller/clusterauthenticationtrust: complete event filter
This commit is contained in:
Kubernetes Prow Robot 2023-09-28 14:21:39 -07:00 committed by GitHub
commit ef838ca27c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,11 +106,11 @@ func NewClusterAuthenticationTrustController(requiredAuthenticationData ClusterA
kubeSystemConfigMapInformer.AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: func(obj interface{}) bool {
if cast, ok := obj.(*corev1.ConfigMap); ok {
return cast.Name == configMapName
return cast.Namespace == configMapNamespace && cast.Name == configMapName
}
if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok {
if cast, ok := tombstone.Obj.(*corev1.ConfigMap); ok {
return cast.Name == configMapName
return cast.Namespace == configMapNamespace && cast.Name == configMapName
}
}
return true // always return true just in case. The checks are fairly cheap