Skip to content

Commit

Permalink
Always prefer multiplex port if Kube Proxy endpoint is specified (#34211
Browse files Browse the repository at this point in the history
)

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
  • Loading branch information
tigrato committed Dec 4, 2023
1 parent b2be78a commit ed74828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ func (c *Config) ParseProxyHost(proxyHost string) error {

// KubeProxyHostPort returns the host and port of the Kubernetes proxy.
func (c *Config) KubeProxyHostPort() (string, int) {
if c.KubeProxyAddr != "" {
if c.KubeProxyAddr != "" && !c.TLSRoutingEnabled {
addr, err := utils.ParseAddr(c.KubeProxyAddr)
if err == nil {
return addr.Host(), addr.Port(defaults.KubeListenPort)
Expand Down
5 changes: 3 additions & 2 deletions tool/tsh/common/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,9 @@ func isKubectlConfigCommand(kubectlCommand *cobra.Command, args []string) bool {

func kubeClusterAddrFromProfile(profile *profile.Profile) string {
partialClientConfig := client.Config{
WebProxyAddr: profile.WebProxyAddr,
KubeProxyAddr: profile.KubeProxyAddr,
WebProxyAddr: profile.WebProxyAddr,
KubeProxyAddr: profile.KubeProxyAddr,
TLSRoutingEnabled: profile.TLSRoutingEnabled,
}
return partialClientConfig.KubeClusterAddr()
}
Expand Down

0 comments on commit ed74828

Please sign in to comment.