Skip to content

Commit

Permalink
fix: ignore inferenceserivce MWC CR for modelmesh
Browse files Browse the repository at this point in the history
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
  • Loading branch information
zdtsw committed Dec 8, 2023
1 parent 8526ce9 commit 3d09457
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/datasciencecluster/datasciencecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,13 @@ var saPredicates = predicate.Funcs{
// a workaround for 2.5 due to modelmesh-servingruntime.serving.kserve.io keeps updates
var modelMeshwebhookPredicates = predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
return e.ObjectNew.GetName() != "modelmesh-servingruntime.serving.kserve.io"
if e.ObjectNew.GetName() == "modelmesh-servingruntime.serving.kserve.io" {
return false
}
if e.ObjectNew.GetName() == "inferenceservice.serving.kserve.io" {
return false
}
return true
},
}

Expand Down Expand Up @@ -400,7 +406,7 @@ func (r *DataScienceClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
Owns(&ocbuildv1.BuildConfig{}).
Owns(&apiregistrationv1.APIService{}).
Owns(&netv1.Ingress{}).
Owns(&admv1.MutatingWebhookConfiguration{}).
Owns(&admv1.MutatingWebhookConfiguration{}, builder.WithPredicates(modelMeshwebhookPredicates)).
Owns(&admv1.ValidatingWebhookConfiguration{}, builder.WithPredicates(modelMeshwebhookPredicates)).
Owns(&corev1.ServiceAccount{}, builder.WithPredicates(saPredicates)).
Watches(&source.Kind{Type: &dsci.DSCInitialization{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterResources)).
Expand Down

0 comments on commit 3d09457

Please sign in to comment.