Skip to content

Commit b1c56c8

Browse files
committed
fix: Remove SR deployment watchers
1 parent 61224ec commit b1c56c8

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

controllers/tas/trustyaiservice_controller.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ import (
2121
goerrors "errors"
2222
"time"
2323

24-
kservev1beta1 "github.com/kserve/kserve/pkg/apis/serving/v1beta1"
2524
trustyaiopendatahubiov1alpha1 "github.com/trustyai-explainability/trustyai-service-operator/api/tas/v1alpha1"
2625
"github.com/trustyai-explainability/trustyai-service-operator/controllers/utils"
2726
appsv1 "k8s.io/api/apps/v1"
2827
v1 "k8s.io/api/core/v1"
2928
"k8s.io/apimachinery/pkg/api/errors"
30-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3129
"k8s.io/apimachinery/pkg/runtime"
3230
"k8s.io/client-go/tools/record"
3331
ctrl "sigs.k8s.io/controller-runtime"
@@ -279,23 +277,6 @@ func (r *TrustyAIServiceReconciler) Reconcile(ctx context.Context, req ctrl.Requ
279277

280278
// SetupWithManager sets up the controller with the Manager.
281279
func (r *TrustyAIServiceReconciler) SetupWithManager(mgr ctrl.Manager) error {
282-
// Watch ServingRuntime objects (not managed by this controller)
283-
if err := mgr.GetFieldIndexer().IndexField(context.Background(), &appsv1.Deployment{}, ".metadata.controller", func(rawObj client.Object) []string {
284-
// Grab the deployment object and extract the owner
285-
deployment := rawObj.(*appsv1.Deployment)
286-
owner := metav1.GetControllerOf(deployment)
287-
if owner == nil {
288-
return nil
289-
}
290-
// Retain ServingRuntimes only
291-
if owner.APIVersion != kservev1beta1.APIVersion || owner.Kind != "ServingRuntime" {
292-
return nil
293-
}
294-
return []string{owner.Name}
295-
}); err != nil {
296-
return err
297-
}
298-
299280
return ctrl.NewControllerManagedBy(mgr).
300281
For(&trustyaiopendatahubiov1alpha1.TrustyAIService{}).
301282
Owns(&appsv1.Deployment{}).

0 commit comments

Comments
 (0)