Skip to content

Commit

Permalink
chore(kuma-cp) rename mTLS configuration parameter for clarity (#2808) (
Browse files Browse the repository at this point in the history
#2816)

The service name that is passed to the `ClientSideMTLS` configurer
is the used to validate the name the upstream provides in its server
certificate. It's less confusing if we call this field `UpstreamService`.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit 7756bb3)

Co-authored-by: James Peach <james.peach@konghq.com>
  • Loading branch information
mergify[bot] and jpeach committed Sep 22, 2021
1 parent a06ae08 commit 81fb2a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions pkg/xds/envoy/clusters/configurers.go
Expand Up @@ -22,12 +22,12 @@ func CircuitBreaker(circuitBreaker *core_mesh.CircuitBreakerResource) ClusterBui
})
}

func ClientSideMTLS(ctx xds_context.Context, clientService string, tags []envoy.Tags) ClusterBuilderOpt {
func ClientSideMTLS(ctx xds_context.Context, upstreamService string, tags []envoy.Tags) ClusterBuilderOpt {
return ClusterBuilderOptFunc(func(config *ClusterBuilderConfig) {
config.AddV3(&v3.ClientSideMTLSConfigurer{
Ctx: ctx,
ClientService: clientService,
Tags: tags,
Ctx: ctx,
UpstreamService: upstreamService,
Tags: tags,
})
})
}
Expand All @@ -36,9 +36,9 @@ func ClientSideMTLS(ctx xds_context.Context, clientService string, tags []envoy.
func UnknownDestinationClientSideMTLS(ctx xds_context.Context) ClusterBuilderOpt {
return ClusterBuilderOptFunc(func(config *ClusterBuilderConfig) {
config.AddV3(&v3.ClientSideMTLSConfigurer{
Ctx: ctx,
ClientService: "*",
Tags: nil,
Ctx: ctx,
UpstreamService: "*",
Tags: nil,
})
})
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/xds/envoy/clusters/v3/client_side_mtls_configurer.go
Expand Up @@ -14,9 +14,9 @@ import (
)

type ClientSideMTLSConfigurer struct {
Ctx xds_context.Context
ClientService string
Tags []envoy.Tags
Ctx xds_context.Context
UpstreamService string
Tags []envoy.Tags
}

var _ ClusterConfigurer = &ClientSideTLSConfigurer{}
Expand Down Expand Up @@ -61,7 +61,7 @@ func (c *ClientSideMTLSConfigurer) Configure(cluster *envoy_cluster.Cluster) err
}

func (c *ClientSideMTLSConfigurer) createTransportSocket(sni string) (*envoy_core.TransportSocket, error) {
tlsContext, err := envoy_tls.CreateUpstreamTlsContext(c.Ctx, c.ClientService, sni)
tlsContext, err := envoy_tls.CreateUpstreamTlsContext(c.Ctx, c.UpstreamService, sni)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 81fb2a6

Please sign in to comment.