Skip to content

Commit

Permalink
update: disable watch on CRD from kserve and modelmesh for now
Browse files Browse the repository at this point in the history
- will update with new function on CRD later

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
  • Loading branch information
zdtsw committed Dec 3, 2024
1 parent 18e148e commit 0d58907
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
6 changes: 2 additions & 4 deletions controllers/components/kserve/kserve_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
rbacv1 "k8s.io/api/rbac/v1"
extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/handler"

Expand All @@ -39,7 +38,6 @@ import (
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/actions/security"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/actions/updatestatus"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/clusterrole"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/crd"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/hash"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/resources"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/reconciler"
Expand Down Expand Up @@ -88,8 +86,8 @@ func (s *componentHandler) NewComponentReconciler(ctx context.Context, mgr ctrl.
// - a predicate that check for generation change for Delete/Updates events
// for to objects that have the label components.opendatahub.io/managed-by
// set to the current owner
//
Watches(&extv1.CustomResourceDefinition{}, reconciler.WithPredicates(crd.ServingCRD())).
// TODO: uncomment below watch on CRD
// Watches(&extv1.CustomResourceDefinition{}).

// operands - dynamically watched
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
rbacv1 "k8s.io/api/rbac/v1"
extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
ctrl "sigs.k8s.io/controller-runtime"

componentsv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1"
Expand All @@ -36,7 +35,6 @@ import (
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/actions/security"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/actions/updatestatus"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/clusterrole"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/crd"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/predicates/resources"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/controller/reconciler"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/metadata/labels"
Expand Down Expand Up @@ -66,7 +64,8 @@ func (s *componentHandler) NewComponentReconciler(ctx context.Context, mgr ctrl.
Owns(&rbacv1.RoleBinding{}).
Owns(&rbacv1.ClusterRoleBinding{}).
Owns(&appsv1.Deployment{}, reconciler.WithPredicates(resources.NewDeploymentPredicate())).
Watches(&extv1.CustomResourceDefinition{}, reconciler.WithPredicates(crd.ServingCRD())). // call ForLabel() + new predicates
// TODO: uncomment below watch on CRD
// Watches(&extv1.CustomResourceDefinition{}).
// Add ModelMeshServing specific actions
WithAction(initialize).
WithAction(devFlags).
Expand Down
14 changes: 0 additions & 14 deletions pkg/controller/predicates/crd/crd.go

This file was deleted.

0 comments on commit 0d58907

Please sign in to comment.