Skip to content

Commit

Permalink
Merge pull request #366 from meshery/revert-356-uzair
Browse files Browse the repository at this point in the history
Revert "Add support to configure broker service"
  • Loading branch information
humblenginr authored Sep 22, 2022
2 parents 6ce33e1 + 4cbc86c commit a3df5e5
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions controllers/meshsync_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ import (
"context"

"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/source"

mesheryv1alpha1 "github.com/layer5io/meshery-operator/api/v1alpha1"
brokerpackage "github.com/layer5io/meshery-operator/pkg/broker"
Expand Down Expand Up @@ -98,8 +93,6 @@ func (r *MeshSyncReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
func (r *MeshSyncReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&mesheryv1alpha1.MeshSync{}).
Watches(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForObject{}).
WithEventFilter(updatePredicate()).
Complete(r)
}

Expand Down Expand Up @@ -165,15 +158,3 @@ func (r *MeshSyncReconciler) reconcileMeshsync(ctx context.Context, enable bool,

return ctrl.Result{}, nil
}

func updatePredicate() predicate.Predicate {
return predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
val, ok := e.ObjectNew.GetLabels()["component"]
if ok && val == "broker" {
return ok
}
return !ok
},
}
}

0 comments on commit a3df5e5

Please sign in to comment.