Skip to content

Commit

Permalink
Debug local EP
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis committed Jul 16, 2024
1 parent 690f3d9 commit b136a07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controllers/datastoresyncer/datastoresyncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,19 @@ func (d *DatastoreSyncer) shouldSyncRemoteEndpoint(obj runtime.Object, _ int,
func (d *DatastoreSyncer) ensureExclusiveEndpoint(ctx context.Context, syncer *broker.Syncer) error {
logger.Info("Ensuring we are the only endpoint active for this cluster")

logger.Info("******Local EP: %s", d.localEndpoint.Spec())

endpoints := syncer.ListLocalResources(&submarinerv1.Endpoint{})
for i := range endpoints {
existing := endpoints[i].(*submarinerv1.Endpoint)
if existing.Spec.ClusterID != d.localCluster.Spec.ClusterID {
continue
}

logger.Info("******Found existing local EP: %s", resource.ToJSON(existing.Spec))

if existing.Spec.Equals(d.localEndpoint.Spec()) {
logger.Info("******NOT deleting existing EP")
continue
}

Expand Down

0 comments on commit b136a07

Please sign in to comment.