Skip to content

Commit

Permalink
Remove unnecessary fetching of gateway (hashicorp#20172)
Browse files Browse the repository at this point in the history
The fetched gateway isn't currently used anywhere
  • Loading branch information
nathancoleman authored Jan 17, 2024
1 parent 4d20e54 commit d2e991d
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions internal/mesh/internal/controllers/gatewayproxy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,6 @@ func (r *reconciler) Reconcile(ctx context.Context, rt controller.Runtime, req c
return nil
}

// TODO NET-7014 Determine what gateway controls this workload
// For now, we cheat by knowing the MeshGateway's name, type + tenancy ahead of time
gatewayID := &pbresource.ID{
Name: "mesh-gateway",
Type: pbmesh.MeshGatewayType,
Tenancy: resource.DefaultPartitionedTenancy(),
}

// Check if the gateway exists.
gateway, err := dataFetcher.FetchMeshGateway(ctx, gatewayID)
if err != nil {
rt.Logger.Error("error reading the associated gateway", "error", err)
return err
}
if gateway == nil {
// If gateway has been deleted, then return as ProxyStateTemplate should be
// cleaned up by the garbage collector because of the owner reference.
rt.Logger.Trace("gateway doesn't exist; skipping reconciliation", "gateway", gatewayID)
return nil
}

proxyStateTemplate, err := dataFetcher.FetchProxyStateTemplate(ctx, req.ID)
if err != nil {
rt.Logger.Error("error reading proxy state template", "error", err)
Expand Down

0 comments on commit d2e991d

Please sign in to comment.