Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhAgniRedhat committed Aug 9, 2024
1 parent 45d7586 commit d826344
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkg/operator/controller/gatewayclass/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package gatewayclass
import (
"context"
logf "github.com/openshift/cluster-ingress-operator/pkg/log"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
"k8s.io/client-go/tools/record"
"sigs.k8s.io/controller-runtime/pkg/event"

gatewayapiv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

Expand Down Expand Up @@ -79,17 +81,17 @@ func NewUnmanaged(mgr manager.Manager, config Config) (controller.Controller, er
// }}
//}

//isServiceMeshSubscription := predicate.NewPredicateFuncs(func(o client.Object) bool {
// return o.GetName() == "servicemeshoperator" && o.GetNamespace() == "openshift-operators"
//})
//if err := c.Watch(source.Kind(operatorCache, &operatorsv1alpha1.Subscription{}), &handler.EnqueueRequestForObject{}, 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
//}
isServiceMeshSubscription := predicate.NewPredicateFuncs(func(o client.Object) bool {
return o.GetName() == "servicemeshoperator" && o.GetNamespace() == "openshift-operators"
})
if err = c.Watch(source.Kind[client.Object](operatorCache, &operatorsv1alpha1.Subscription{}, &handler.EnqueueRequestForObject{}, isServiceMeshSubscription, 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
}

return c, nil
}
Expand Down

0 comments on commit d826344

Please sign in to comment.