Browse Source

Remove unnecessary fetching of gateway (#20172)

The fetched gateway isn't currently used anywhere
pull/20246/head
Nathan Coleman 10 months ago committed by GitHub
parent
commit
d2e991ddfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      internal/mesh/internal/controllers/gatewayproxy/controller.go

21
internal/mesh/internal/controllers/gatewayproxy/controller.go

@ -80,27 +80,6 @@ func (r *reconciler) Reconcile(ctx context.Context, rt controller.Runtime, req c
return nil 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) proxyStateTemplate, err := dataFetcher.FetchProxyStateTemplate(ctx, req.ID)
if err != nil { if err != nil {
rt.Logger.Error("error reading proxy state template", "error", err) rt.Logger.Error("error reading proxy state template", "error", err)

Loading…
Cancel
Save