Skip to content

Commit

Permalink
Reconcile clustersetip in broker
Browse files Browse the repository at this point in the history
Reconcile clustersetip in BrokerReconciler

Signed-off-by: Vishal Thapar <[email protected]>
  • Loading branch information
vthapar authored and tpantelis committed Sep 30, 2024
1 parent 70b2412 commit fd4e9f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions controllers/submariner/broker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/pkg/errors"
"github.com/submariner-io/submariner-operator/api/v1alpha1"
"github.com/submariner-io/submariner-operator/pkg/crd"
"github.com/submariner-io/submariner-operator/pkg/discovery/clustersetip"
"github.com/submariner-io/submariner-operator/pkg/discovery/globalnet"
"github.com/submariner-io/submariner-operator/pkg/gateway"
"github.com/submariner-io/submariner-operator/pkg/lighthouse"
Expand Down Expand Up @@ -93,6 +94,18 @@ func (r *BrokerReconciler) Reconcile(ctx context.Context, request ctrl.Request)
return ctrl.Result{}, err //nolint:wrapcheck // Errors are already wrapped
}

// clustersetip
err = clustersetip.ValidateExistingClustersetIPNetworks(ctx, r.Client, request.Namespace)
if err != nil {
return ctrl.Result{}, err //nolint:wrapcheck // Errors are already wrapped
}

err = clustersetip.CreateConfigMap(ctx, r.Client, instance.Spec.ClustersetIPEnabled,
instance.Spec.ClustersetIPCIDRRange, 0, request.Namespace)
if err != nil {
return ctrl.Result{}, err //nolint:wrapcheck // Errors are already wrapped
}

return ctrl.Result{}, nil
}

Expand Down

0 comments on commit fd4e9f3

Please sign in to comment.