From 1d88c0e3faae9af2700b6ce4645735b4a856a887 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Wed, 18 Jan 2023 12:37:21 +0900 Subject: [PATCH] Fix predicates of paddlepaddle-controller for scheduling.volcano.sh/v1beta1 PodGroup (#1730) Signed-off-by: Yuki Iwai Signed-off-by: Yuki Iwai --- pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go b/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go index 547911d01d..ef0a4ad3d8 100644 --- a/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go +++ b/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go @@ -212,6 +212,7 @@ func (r *PaddleJobReconciler) SetupWithManager(mgr ctrl.Manager, controllerThrea }); err != nil { return err } + // skip watching podgroup if podgroup is not installed _, err = mgr.GetRESTMapper().RESTMapping(schema.GroupKind{Group: v1beta1.SchemeGroupVersion.Group, Kind: "PodGroup"}, v1beta1.SchemeGroupVersion.Version) @@ -221,9 +222,9 @@ func (r *PaddleJobReconciler) SetupWithManager(mgr ctrl.Manager, controllerThrea IsController: true, OwnerType: &kubeflowv1.PaddleJob{}, }, predicate.Funcs{ - CreateFunc: util.OnDependentCreateFunc(r.Expectations), - UpdateFunc: util.OnDependentUpdateFunc(&r.JobController), - DeleteFunc: util.OnDependentDeleteFunc(r.Expectations), + CreateFunc: util.OnDependentCreateFuncGeneric(r.Expectations), + UpdateFunc: util.OnDependentUpdateFuncGeneric(&r.JobController), + DeleteFunc: util.OnDependentDeleteFuncGeneric(r.Expectations), }); err != nil { return err }