Reuse helper filter in generic secret gen controller
Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
parent
b043dae149
commit
e3ea141bf3
@ -70,23 +70,16 @@ func NewOIDCProviderSecretsController(
|
|||||||
// TODO: de-dup me (jwks_writer.go).
|
// TODO: de-dup me (jwks_writer.go).
|
||||||
withInformer(
|
withInformer(
|
||||||
secretInformer,
|
secretInformer,
|
||||||
controllerlib.FilterFuncs{
|
pinnipedcontroller.SimpleFilter(isOPCControllee, func(obj metav1.Object) controllerlib.Key {
|
||||||
ParentFunc: func(obj metav1.Object) controllerlib.Key {
|
if isOPCControllee(obj) {
|
||||||
if isOPCControllee(obj) {
|
controller := metav1.GetControllerOf(obj)
|
||||||
controller := metav1.GetControllerOf(obj)
|
return controllerlib.Key{
|
||||||
return controllerlib.Key{
|
Name: controller.Name,
|
||||||
Name: controller.Name,
|
Namespace: obj.GetNamespace(),
|
||||||
Namespace: obj.GetNamespace(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return controllerlib.Key{}
|
}
|
||||||
},
|
return controllerlib.Key{}
|
||||||
AddFunc: isOPCControllee,
|
}),
|
||||||
UpdateFunc: func(oldObj, newObj metav1.Object) bool {
|
|
||||||
return isOPCControllee(oldObj) || isOPCControllee(newObj)
|
|
||||||
},
|
|
||||||
DeleteFunc: isOPCControllee,
|
|
||||||
},
|
|
||||||
controllerlib.InformerOption{},
|
controllerlib.InformerOption{},
|
||||||
),
|
),
|
||||||
// We want to be notified when anything happens to an OPC.
|
// We want to be notified when anything happens to an OPC.
|
||||||
|
Loading…
Reference in New Issue
Block a user