mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #120912 from sttts/sttts-cluster-authn-filter
controller/clusterauthenticationtrust: complete event filter
This commit is contained in:
commit
ef838ca27c
@ -106,11 +106,11 @@ func NewClusterAuthenticationTrustController(requiredAuthenticationData ClusterA
|
|||||||
kubeSystemConfigMapInformer.AddEventHandler(cache.FilteringResourceEventHandler{
|
kubeSystemConfigMapInformer.AddEventHandler(cache.FilteringResourceEventHandler{
|
||||||
FilterFunc: func(obj interface{}) bool {
|
FilterFunc: func(obj interface{}) bool {
|
||||||
if cast, ok := obj.(*corev1.ConfigMap); ok {
|
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 tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok {
|
||||||
if cast, ok := tombstone.Obj.(*corev1.ConfigMap); 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
|
return true // always return true just in case. The checks are fairly cheap
|
||||||
|
Loading…
Reference in New Issue
Block a user