mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-25 06:24:59 +00:00
Merge pull request #57457 from vfreex/fix-port-forward-ipv6
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. client-go: Fix broken TCP6 listen for port forwarding **What this PR does / why we need it**: The IPV6 loopback address `::1` is enclosed in square brackets twice, which cause a failure to listen on the TCP6 port. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: **Special notes for your reviewer**: **Release note**: ```release-note Fix an issue where port forwarding doesn't forward local TCP6 ports to the pod ``` /area ipv6 /sig cli Kubernetes-commit: a241087f9966deef6175a370da060f9623e92d94
This commit is contained in:
106
Godeps/Godeps.json
generated
106
Godeps/Godeps.json
generated
@@ -400,215 +400,215 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/testing",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
||||
"Rev": "b621949a1923cee3fce8bca9613e9a83609f0bbc"
|
||||
"Rev": "150d32b09b5966b39cb02d7945f0d1bc7b9f1a19"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
||||
|
@@ -185,7 +185,7 @@ func (pf *PortForwarder) forward() error {
|
||||
// If both listener creation fail, an error is raised.
|
||||
func (pf *PortForwarder) listenOnPort(port *ForwardedPort) error {
|
||||
errTcp4 := pf.listenOnPortAndAddress(port, "tcp4", "127.0.0.1")
|
||||
errTcp6 := pf.listenOnPortAndAddress(port, "tcp6", "[::1]")
|
||||
errTcp6 := pf.listenOnPortAndAddress(port, "tcp6", "::1")
|
||||
if errTcp4 != nil && errTcp6 != nil {
|
||||
return fmt.Errorf("All listeners failed to create with the following errors: %s, %s", errTcp4, errTcp6)
|
||||
}
|
||||
@@ -220,7 +220,7 @@ func (pf *PortForwarder) getListener(protocol string, hostname string, port *For
|
||||
}
|
||||
port.Local = uint16(localPortUInt)
|
||||
if pf.out != nil {
|
||||
fmt.Fprintf(pf.out, "Forwarding from %s:%d -> %d\n", hostname, localPortUInt, port.Remote)
|
||||
fmt.Fprintf(pf.out, "Forwarding from %s -> %d\n", net.JoinHostPort(hostname, strconv.Itoa(int(localPortUInt))), port.Remote)
|
||||
}
|
||||
|
||||
return listener, nil
|
||||
|
Reference in New Issue
Block a user