Skip to content

Commit

Permalink
Undo formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jm96441n committed Nov 21, 2023
1 parent 3ace4f1 commit 60bcaed
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions agent/consul/state/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -4965,22 +4965,19 @@ func cleanupMeshTopology(tx WriteTxn, idx uint64, service *structs.ServiceNode)

func insertGatewayServiceTopologyMapping(tx WriteTxn, idx uint64, gs *structs.GatewayService) error {
// Only ingress gateways are standalone items in the mesh topology viz
if (gs.GatewayKind != structs.ServiceKindIngressGateway) || gs.Service.Name == structs.WildcardSpecifier {
if gs.GatewayKind != structs.ServiceKindIngressGateway || gs.Service.Name == structs.WildcardSpecifier {
return nil
}

// HERE
mapping := upstreamDownstream{
Upstream: gs.Service,
Downstream: gs.Gateway,
Refs: make(map[string]struct{}),
RaftIndex: gs.RaftIndex,
}

if err := tx.Insert(tableMeshTopology, &mapping); err != nil {
return fmt.Errorf("failed inserting %s mapping: %s", tableMeshTopology, err)
}

if err := indexUpdateMaxTxn(tx, idx, tableMeshTopology); err != nil {
return fmt.Errorf("failed updating %s index: %v", tableMeshTopology, err)
}
Expand Down

0 comments on commit 60bcaed

Please sign in to comment.