Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/kube/proxy/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,22 @@ func (f *Forwarder) removeKubeDetails(name string) {
// KubeProxy services or remote clusters are automatically forwarded to
// the final destination.
func (f *Forwarder) isLocalKubeCluster(sess *clusterSession) bool {
return !sess.authContext.teleportCluster.isRemote && f.cfg.KubeServiceType == KubeService
switch f.cfg.KubeServiceType {
case KubeService:
// Kubernetes service is always local.
return true
case LegacyProxyService:
// remote clusters are always forwarded to the final destination.
if sess.authContext.teleportCluster.isRemote {
return false
}
// Legacy proxy service is local only if the kube cluster name matches
// with clusters served by this agent.
_, err := f.findKubeDetailsByClusterName(sess.authContext.kubeClusterName)
return err == nil
default:
return false
}
}

// listPods forwards the pod list request to the target server, captures
Expand Down