Skip to content

Commit

Permalink
#164 Skip port-forwarding for UDP ports as unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarick committed Jan 19, 2021
1 parent 46d3da5 commit 90cf9da
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/fwdservice/fwdservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,17 @@ func (svcFwd *ServiceFWD) LoopPodsToForward(pods []v1.Pod, includePodNameInHost

for _, port := range svcFwd.Svc.Spec.Ports {

// Skip if pod port protocol is UDP - not supported in k8s port forwarding yet, see https://github.com/kubernetes/kubernetes/issues/47862
if port.Protocol == v1.ProtocolUDP {
log.Warnf("WARNING: Skipped Port-Forward for %s:%d to pod %s:%s - k8s port-forwarding doesn't support UDP protocol\n",
serviceHostName,
port.Port,
pod.Name,
port.TargetPort.String(),
)
continue
}

podPort = port.TargetPort.String()
localPort := strconv.Itoa(int(port.Port))

Expand Down

0 comments on commit 90cf9da

Please sign in to comment.