Skip to content

Commit

Permalink
Added watch for SMCP
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhAgniRedhat committed Aug 9, 2024
1 parent d826344 commit 41c7e73
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pkg/operator/controller/gatewayclass/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gatewayclass

import (
"context"
maistrav2 "github.com/maistra/istio-operator/pkg/apis/maistra/v2"
logf "github.com/openshift/cluster-ingress-operator/pkg/log"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
"k8s.io/client-go/tools/record"
Expand Down Expand Up @@ -68,12 +69,17 @@ func NewUnmanaged(mgr manager.Manager, config Config) (controller.Controller, er
// }}
//}

//isOurSMCP := predicate.NewPredicateFuncs(func(o client.Object) bool {
// return o.GetName() == OpenShiftDefaultGatewayClassName
//})
//if err := c.Watch(source.Kind(operatorCache, &maistrav2.ServiceMeshControlPlane{}), &handler.EnqueueRequestForObject{}, isOurSMCP); err != nil {
// return nil, err
//}
isOurSMCP := predicate.NewPredicateFuncs(func(o client.Object) bool {
return o.GetName() == OpenShiftDefaultGatewayClassName
})
if err = c.Watch(source.Kind[client.Object](operatorCache, &maistrav2.ServiceMeshControlPlane{}, &handler.EnqueueRequestForObject{}, isOurSMCP, predicate.Funcs{
CreateFunc: func(e event.CreateEvent) bool { return false },
DeleteFunc: func(e event.DeleteEvent) bool { return true },
UpdateFunc: func(e event.UpdateEvent) bool { return false },
GenericFunc: func(e event.GenericEvent) bool { return false },
})); err != nil {
return nil, err
}

//toServiceMeshSubscription := func(ctx context.Context, _ client.Object) []reconcile.Request {
// return []reconcile.Request{{
Expand Down

0 comments on commit 41c7e73

Please sign in to comment.