Skip to content

Commit

Permalink
default eds code
Browse files Browse the repository at this point in the history
  • Loading branch information
therealak12 committed Apr 30, 2024
1 parent 47b0094 commit 7b52cb9
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 51 deletions.
4 changes: 0 additions & 4 deletions internal/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,6 @@ type Route struct {

// The stat_prefix to set on envoy route
StatPrefix *string

// The operation name of tracing spans reported for this request
// Check https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-msg-config-route-v3-decorator
TracingOperationName string
}

// HasPathPrefix returns whether this route has a PrefixPathCondition.
Expand Down
4 changes: 0 additions & 4 deletions internal/dag/gatewayapi_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2186,8 +2186,6 @@ func (p *GatewayAPIProcessor) clusterRoutes(
route.StatPrefix = ref.To(fmt.Sprintf("%s_%s", namespace, name))
}

route.TracingOperationName = mc.path.String()

routes = append(routes, route)
}

Expand Down Expand Up @@ -2260,8 +2258,6 @@ func (p *GatewayAPIProcessor) redirectRoutes(
route.StatPrefix = ref.To(fmt.Sprintf("%s_%s", namespace, name))
}

route.TracingOperationName = mc.path.String()

routes = append(routes, route)
}

Expand Down
5 changes: 0 additions & 5 deletions internal/dag/httpproxy_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,11 +863,6 @@ func (p *HTTPProxyProcessor) computeRoutes(
r.StatPrefix = ref.To(fmt.Sprintf("%s_httpproxy_%s_path_%s", proxy.Namespace, proxy.Name, path))
}

r.TracingOperationName = "/"
if len(route.Conditions) > 0 && route.Conditions[0].Prefix != "" {
r.TracingOperationName = route.Conditions[0].Prefix
}

// If the enclosing root proxy enabled authorization,
// enable it on the route and propagate defaults
// downwards.
Expand Down
2 changes: 0 additions & 2 deletions internal/dag/ingress_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ func (p *IngressProcessor) route(ingress *networking_v1.Ingress, host string, pa
r.StatPrefix = ref.To(fmt.Sprintf("%s_%s", ingress.Namespace, ingress.Name))
}

r.TracingOperationName = path

switch pathType {
case networking_v1.PathTypePrefix:
prefixMatchType := PrefixMatchSegment
Expand Down
37 changes: 2 additions & 35 deletions internal/envoy/v3/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package v3
import (
"net"
"time"

Check failure on line 18 in internal/envoy/v3/cluster.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 18 in internal/envoy/v3/cluster.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)
"strings"

envoy_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
Expand All @@ -30,8 +31,6 @@ import (
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/wrapperspb"
"k8s.io/apimachinery/pkg/types"
"strings"
endpointv3 "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3"
)

func clusterDefaults() *envoy_cluster_v3.Cluster {
Expand Down Expand Up @@ -198,39 +197,7 @@ func ExtensionCluster(ext *dag.ExtensionCluster) *envoy_cluster_v3.Cluster {
}
cluster.TypedExtensionProtocolOptions = protocolOptions(httpVersion, ext.ClusterTimeoutPolicy.IdleConnectionTimeout, nil)

if !strings.Contains(ext.Name, "zipkin") {
return cluster
}
//else {
// cluster.Name = "172.16.60.14:9411"
// cluster.EdsClusterConfig.ServiceName = "172.16.60.14:9411"
// return cluster
//}

return &envoy_cluster_v3.Cluster{
Name: ext.Name,
ClusterDiscoveryType: ClusterDiscoveryType(envoy_cluster_v3.Cluster_STRICT_DNS),
LbPolicy: envoy_cluster_v3.Cluster_ROUND_ROBIN,
LoadAssignment: &endpointv3.ClusterLoadAssignment{
ClusterName: ext.Name,
Endpoints: []*endpointv3.LocalityLbEndpoints{{
LbEndpoints: []*endpointv3.LbEndpoint{
LBEndpoint(&envoy_core_v3.Address{
Address: &envoy_core_v3.Address_SocketAddress{
SocketAddress: &envoy_core_v3.SocketAddress{
Protocol: envoy_core_v3.SocketAddress_TCP,
Ipv4Compat: true,
Address: "172.16.60.14",
PortSpecifier: &envoy_core_v3.SocketAddress_PortValue{
PortValue: 9411,
},
},
},
}),
},
}},
},
}
return cluster
}

// DNSNameCluster builds a envoy_cluster_v3.Cluster for the given *dag.DNSNameCluster.
Expand Down
1 change: 0 additions & 1 deletion internal/envoy/v3/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func buildRoute(dagRoute *dag.Route, vhostName string, secure bool) *envoy_route
Match: RouteMatch(dagRoute),
Metadata: getRouteMetadata(dagRoute),
Decorator: &envoy_route_v3.Decorator{
//Operation: dagRoute.TracingOperationName,
Operation: dagRoute.Name,
Propagate: wrapperspb.Bool(true),
},
Expand Down

0 comments on commit 7b52cb9

Please sign in to comment.