Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain committed Oct 31, 2023
1 parent 01de829 commit deba3d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
6 changes: 3 additions & 3 deletions internal/xds/translator/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ func buildXdsCluster(args *xdsClusterArgs) *clusterv3.Cluster {
cluster.RespectDnsTtl = true
}

isHttp2 := false
isHTTP2 := false
for _, ds := range args.settings {
if ds.Protocol == model.GRPC {
isHttp2 = true
isHTTP2 = true
break
}
}
if isHttp2 {
if isHTTP2 {
cluster.TypedExtensionProtocolOptions = buildTypedExtensionProtocolOptions()
}

Expand Down
16 changes: 3 additions & 13 deletions internal/xds/translator/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,25 +430,15 @@ func addXdsCluster(tCtx *types.ResourceVersionTable, args *xdsClusterArgs) error
}

type xdsClusterArgs struct {
name string
settings []*ir.DestinationSetting
tSocket *corev3.TransportSocket
//protocol ProtocolType
name string
settings []*ir.DestinationSetting
tSocket *corev3.TransportSocket
endpointType EndpointType
loadBalancer *ir.LoadBalancer
}

type ProtocolType int
type EndpointType int

const (
DefaultProtocol ProtocolType = iota
TCP
UDP
HTTP
HTTP2
)

const (
DefaultEndpointType EndpointType = iota
Static
Expand Down

0 comments on commit deba3d6

Please sign in to comment.