From 1d90ecc31da08ff40a0d29d4748aaf3ecb70b9bd Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 27 Mar 2020 17:57:16 -0400 Subject: [PATCH] Remove unused token parameter --- agent/xds/clusters.go | 10 +++++----- agent/xds/endpoints.go | 10 +++++----- agent/xds/listeners.go | 4 ++-- agent/xds/routes.go | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/agent/xds/clusters.go b/agent/xds/clusters.go index afa22a0e20..3ff767e462 100644 --- a/agent/xds/clusters.go +++ b/agent/xds/clusters.go @@ -22,16 +22,16 @@ import ( ) // clustersFromSnapshot returns the xDS API representation of the "clusters" in the snapshot. -func (s *Server) clustersFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) clustersFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, _ string) ([]proto.Message, error) { if cfgSnap == nil { return nil, errors.New("nil config given") } switch cfgSnap.Kind { case structs.ServiceKindConnectProxy: - return s.clustersFromSnapshotConnectProxy(cfgSnap, token) + return s.clustersFromSnapshotConnectProxy(cfgSnap) case structs.ServiceKindMeshGateway: - return s.clustersFromSnapshotMeshGateway(cfgSnap, token) + return s.clustersFromSnapshotMeshGateway(cfgSnap) default: return nil, fmt.Errorf("Invalid service kind: %v", cfgSnap.Kind) } @@ -39,7 +39,7 @@ func (s *Server) clustersFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token st // clustersFromSnapshot returns the xDS API representation of the "clusters" // (upstreams) in the snapshot. -func (s *Server) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) { // TODO(rb): this sizing is a low bound. clusters := make([]proto.Message, 0, len(cfgSnap.Proxy.Upstreams)+1) @@ -112,7 +112,7 @@ func makeExposeClusterName(destinationPort int) string { // clustersFromSnapshotMeshGateway returns the xDS API representation of the "clusters" // for a mesh gateway. This will include 1 cluster per remote datacenter as well as // 1 cluster for each service subset. -func (s *Server) clustersFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) clustersFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) { datacenters := cfgSnap.MeshGateway.Datacenters() // 1 cluster per remote dc + 1 cluster per local service (this is a lower bound - all subset specific clusters will be appended) diff --git a/agent/xds/endpoints.go b/agent/xds/endpoints.go index 63491e7548..2752209856 100644 --- a/agent/xds/endpoints.go +++ b/agent/xds/endpoints.go @@ -22,16 +22,16 @@ const ( ) // endpointsFromSnapshot returns the xDS API representation of the "endpoints" -func (s *Server) endpointsFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) endpointsFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, _ string) ([]proto.Message, error) { if cfgSnap == nil { return nil, errors.New("nil config given") } switch cfgSnap.Kind { case structs.ServiceKindConnectProxy: - return s.endpointsFromSnapshotConnectProxy(cfgSnap, token) + return s.endpointsFromSnapshotConnectProxy(cfgSnap) case structs.ServiceKindMeshGateway: - return s.endpointsFromSnapshotMeshGateway(cfgSnap, token) + return s.endpointsFromSnapshotMeshGateway(cfgSnap) default: return nil, fmt.Errorf("Invalid service kind: %v", cfgSnap.Kind) } @@ -39,7 +39,7 @@ func (s *Server) endpointsFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token s // endpointsFromSnapshotConnectProxy returns the xDS API representation of the "endpoints" // (upstream instances) in the snapshot. -func (s *Server) endpointsFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) endpointsFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) { resources := make([]proto.Message, 0, len(cfgSnap.ConnectProxy.PreparedQueryEndpoints)+len(cfgSnap.ConnectProxy.WatchedUpstreamEndpoints)) @@ -170,7 +170,7 @@ func (s *Server) filterSubsetEndpoints(subset *structs.ServiceResolverSubset, en return endpoints, nil } -func (s *Server) endpointsFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) endpointsFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) { datacenters := cfgSnap.MeshGateway.Datacenters() resources := make([]proto.Message, 0, len(datacenters)+len(cfgSnap.MeshGateway.ServiceGroups)) diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index dbca837d69..6baf941c80 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -39,7 +39,7 @@ func (s *Server) listenersFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token s case structs.ServiceKindConnectProxy: return s.listenersFromSnapshotConnectProxy(cfgSnap, token) case structs.ServiceKindMeshGateway: - return s.listenersFromSnapshotMeshGateway(cfgSnap, token) + return s.listenersFromSnapshotMeshGateway(cfgSnap) default: return nil, fmt.Errorf("Invalid service kind: %v", cfgSnap.Kind) } @@ -180,7 +180,7 @@ func parseCheckPath(check structs.CheckType) (structs.ExposePath, error) { } // listenersFromSnapshotMeshGateway returns the "listener" for a mesh-gateway service -func (s *Server) listenersFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func (s *Server) listenersFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) { cfg, err := ParseGatewayConfig(cfgSnap.Proxy.Config) if err != nil { // Don't hard fail on a config typo, just warn. The parse func returns diff --git a/agent/xds/routes.go b/agent/xds/routes.go index 5384a6f301..23f9a6d37a 100644 --- a/agent/xds/routes.go +++ b/agent/xds/routes.go @@ -15,14 +15,14 @@ import ( // routesFromSnapshot returns the xDS API representation of the "routes" in the // snapshot. -func routesFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func routesFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, _ string) ([]proto.Message, error) { if cfgSnap == nil { return nil, errors.New("nil config given") } switch cfgSnap.Kind { case structs.ServiceKindConnectProxy: - return routesFromSnapshotConnectProxy(cfgSnap, token) + return routesFromSnapshotConnectProxy(cfgSnap) default: return nil, fmt.Errorf("Invalid service kind: %v", cfgSnap.Kind) } @@ -30,7 +30,7 @@ func routesFromSnapshot(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto // routesFromSnapshotConnectProxy returns the xDS API representation of the // "routes" in the snapshot. -func routesFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot, token string) ([]proto.Message, error) { +func routesFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) { if cfgSnap == nil { return nil, errors.New("nil config given") }