Skip to content

Commit

Permalink
Update with review feedback.
Browse files Browse the repository at this point in the history
Signed-off-by: James Peach <james.peach@konghq.com>
  • Loading branch information
jpeach committed Oct 27, 2021
1 parent ed3b9a2 commit 7905fc5
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions pkg/plugins/runtime/gateway/cluster_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ func newClusterBuilder(
switch protocol {
case core_mesh.ProtocolHTTP2, core_mesh.ProtocolGRPC:
builder.Configure(clusters.Http2())
default:
case core_mesh.ProtocolHTTP:
builder.Configure(clusters.Http())
default:
}

return builder
Expand Down Expand Up @@ -216,29 +217,23 @@ func makeRouteDestinations(table *route.Table) (map[string]route.Destination, er

func timeoutPolicyFor(dest *route.Destination) *core_mesh.TimeoutResource {
if policy, ok := dest.Policies[core_mesh.TimeoutType]; ok {
if timeout, ok := policy.(*core_mesh.TimeoutResource); ok {
return timeout
}
return policy.(*core_mesh.TimeoutResource)
}

return nil // TODO(jpeach) default timeout policy
}

func circuitBreakerPolicyFor(dest *route.Destination) *core_mesh.CircuitBreakerResource {
if policy, ok := dest.Policies[core_mesh.CircuitBreakerType]; ok {
if breaker, ok := policy.(*core_mesh.CircuitBreakerResource); ok {
return breaker
}
return policy.(*core_mesh.CircuitBreakerResource)
}

return nil // TODO(jpeach) default breaker policy
}

func healthCheckPolicyFor(dest *route.Destination) *core_mesh.HealthCheckResource {
if policy, ok := dest.Policies[core_mesh.HealthCheckType]; ok {
if checker, ok := policy.(*core_mesh.HealthCheckResource); ok {
return checker
}
return policy.(*core_mesh.HealthCheckResource)
}

return nil // TODO(jpeach) default breaker policy
Expand Down

0 comments on commit 7905fc5

Please sign in to comment.