You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be causing an issue when connecting to a Kubernetes cluster running under Rancher 2.2.5 or higher, which is now checking the Origin header against the Host header. See the related issue rancher/rancher#21777 where this is failing.
For the WatchConnectionManager, the websocket request's Origin header has the port set to -1 if no port was explicitly specified in the URL.
So for a URL of https://example.com/k8s/clusters/etc, the origin header ends up as
Origin: https://example.com:-1
instead of just
Origin: https://example.com
like would be expected.
This seems to be causing an issue when connecting to a Kubernetes cluster running under Rancher 2.2.5 or higher, which is now checking the Origin header against the Host header. See the related issue rancher/rancher#21777 where this is failing.
The problem is here:
kubernetes-client/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java
Lines 147 to 151 in c175e1e
Calling
getPort()
on ajava.net.URL
object will return -1 if the port is not set, and thus we end up with a port of -1 in the origin header.I added some extra logging statements to print out the actual request headers and caught this "live":
The text was updated successfully, but these errors were encountered: