Update go dependencies and cleanup deprecated packages
This commit is contained in:
parent
03a1e20fde
commit
44fd79d061
1099 changed files with 75691 additions and 31913 deletions
2
vendor/k8s.io/apimachinery/pkg/util/net/BUILD
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/net/BUILD
generated
vendored
|
|
@ -15,6 +15,7 @@ go_test(
|
|||
"port_split_test.go",
|
||||
"util_test.go",
|
||||
],
|
||||
importpath = "k8s.io/apimachinery/pkg/util/net",
|
||||
library = ":go_default_library",
|
||||
deps = ["//vendor/github.com/spf13/pflag:go_default_library"],
|
||||
)
|
||||
|
|
@ -28,6 +29,7 @@ go_library(
|
|||
"port_split.go",
|
||||
"util.go",
|
||||
],
|
||||
importpath = "k8s.io/apimachinery/pkg/util/net",
|
||||
deps = [
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
"//vendor/golang.org/x/net/http2:go_default_library",
|
||||
|
|
|
|||
17
vendor/k8s.io/apimachinery/pkg/util/net/http.go
generated
vendored
17
vendor/k8s.io/apimachinery/pkg/util/net/http.go
generated
vendored
|
|
@ -256,8 +256,11 @@ func isDefault(transportProxier func(*http.Request) (*url.URL, error)) bool {
|
|||
// NewProxierWithNoProxyCIDR constructs a Proxier function that respects CIDRs in NO_PROXY and delegates if
|
||||
// no matching CIDRs are found
|
||||
func NewProxierWithNoProxyCIDR(delegate func(req *http.Request) (*url.URL, error)) func(req *http.Request) (*url.URL, error) {
|
||||
// we wrap the default method, so we only need to perform our check if the NO_PROXY envvar has a CIDR in it
|
||||
// we wrap the default method, so we only need to perform our check if the NO_PROXY (or no_proxy) envvar has a CIDR in it
|
||||
noProxyEnv := os.Getenv("NO_PROXY")
|
||||
if noProxyEnv == "" {
|
||||
noProxyEnv = os.Getenv("no_proxy")
|
||||
}
|
||||
noProxyRules := strings.Split(noProxyEnv, ",")
|
||||
|
||||
cidrs := []*net.IPNet{}
|
||||
|
|
@ -273,17 +276,7 @@ func NewProxierWithNoProxyCIDR(delegate func(req *http.Request) (*url.URL, error
|
|||
}
|
||||
|
||||
return func(req *http.Request) (*url.URL, error) {
|
||||
host := req.URL.Host
|
||||
// for some urls, the Host is already the host, not the host:port
|
||||
if net.ParseIP(host) == nil {
|
||||
var err error
|
||||
host, _, err = net.SplitHostPort(req.URL.Host)
|
||||
if err != nil {
|
||||
return delegate(req)
|
||||
}
|
||||
}
|
||||
|
||||
ip := net.ParseIP(host)
|
||||
ip := net.ParseIP(req.URL.Hostname())
|
||||
if ip == nil {
|
||||
return delegate(req)
|
||||
}
|
||||
|
|
|
|||
24
vendor/k8s.io/apimachinery/pkg/util/net/http_test.go
generated
vendored
24
vendor/k8s.io/apimachinery/pkg/util/net/http_test.go
generated
vendored
|
|
@ -172,6 +172,30 @@ func TestProxierWithNoProxyCIDR(t *testing.T) {
|
|||
url: "https://192.168.143.1:8443/api",
|
||||
expectedDelegated: false,
|
||||
},
|
||||
{
|
||||
name: "IPv6 cidr",
|
||||
noProxy: "2001:db8::/48",
|
||||
url: "https://[2001:db8::1]/api",
|
||||
expectedDelegated: false,
|
||||
},
|
||||
{
|
||||
name: "IPv6+port cidr",
|
||||
noProxy: "2001:db8::/48",
|
||||
url: "https://[2001:db8::1]:8443/api",
|
||||
expectedDelegated: false,
|
||||
},
|
||||
{
|
||||
name: "IPv6, not matching cidr",
|
||||
noProxy: "2001:db8::/48",
|
||||
url: "https://[2001:db8:1::1]/api",
|
||||
expectedDelegated: true,
|
||||
},
|
||||
{
|
||||
name: "IPv6+port, not matching cidr",
|
||||
noProxy: "2001:db8::/48",
|
||||
url: "https://[2001:db8:1::1]:8443/api",
|
||||
expectedDelegated: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testCases {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue