Add ability to disable proxy hostname check

This commit is contained in:
Darren Shepherd 2019-02-07 20:53:55 -07:00 committed by rafaelbreno[commit]
parent ff40fc9c69
commit e6853b378e

View File

@ -53,6 +53,8 @@ type nodeStrategy struct {
// objects.
var Strategy = nodeStrategy{legacyscheme.Scheme, names.SimpleNameGenerator}
var DisableProxyHostnameCheck = false
// NamespaceScoped is false for nodes.
func (nodeStrategy) NamespaceScoped() bool {
return false
@ -266,6 +268,9 @@ func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGet
}
func isProxyableHostname(ctx context.Context, hostname string) error {
if DisableProxyHostnameCheck {
return nil
}
resp, err := net.DefaultResolver.LookupIPAddr(ctx, hostname)
if err != nil {
return err