@@ -21,13 +21,11 @@ import (
21
21
goerrors "errors"
22
22
"time"
23
23
24
- kservev1beta1 "github.com/kserve/kserve/pkg/apis/serving/v1beta1"
25
24
trustyaiopendatahubiov1alpha1 "github.com/trustyai-explainability/trustyai-service-operator/api/tas/v1alpha1"
26
25
"github.com/trustyai-explainability/trustyai-service-operator/controllers/utils"
27
26
appsv1 "k8s.io/api/apps/v1"
28
27
v1 "k8s.io/api/core/v1"
29
28
"k8s.io/apimachinery/pkg/api/errors"
30
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
31
29
"k8s.io/apimachinery/pkg/runtime"
32
30
"k8s.io/client-go/tools/record"
33
31
ctrl "sigs.k8s.io/controller-runtime"
@@ -279,23 +277,6 @@ func (r *TrustyAIServiceReconciler) Reconcile(ctx context.Context, req ctrl.Requ
279
277
280
278
// SetupWithManager sets up the controller with the Manager.
281
279
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
-
299
280
return ctrl .NewControllerManagedBy (mgr ).
300
281
For (& trustyaiopendatahubiov1alpha1.TrustyAIService {}).
301
282
Owns (& appsv1.Deployment {}).
0 commit comments