@@ -52,7 +52,7 @@ def validate_upstream_host(_host, errors, allow_protected_ns, protected_kube_nam
5252
5353 if host in restricted :
5454 errors .append ("service upstream is invalid (e1)" )
55- elif host .endswith ('svc' ):
55+ elif host .endswith ('. svc' ):
5656 partials = host .split ('.' )
5757 # get the namespace, and make sure it is not in the protected_kube_namespaces list
5858 if len (partials ) != 3 :
@@ -61,7 +61,7 @@ def validate_upstream_host(_host, errors, allow_protected_ns, protected_kube_nam
6161 errors .append ("service upstream is invalid (e3)" )
6262 elif do_validate_upstreams and (partials [1 ] in perm_upstreams ) is False :
6363 errors .append ("service upstream is invalid (e6)" )
64- elif host .endswith ('svc.cluster.local' ):
64+ elif host .endswith ('. svc.cluster.local' ):
6565 partials = host .split ('.' )
6666 # get the namespace, and make sure it is not in the protected_kube_namespaces list
6767 if len (partials ) != 5 :
@@ -70,5 +70,5 @@ def validate_upstream_host(_host, errors, allow_protected_ns, protected_kube_nam
7070 errors .append ("service upstream is invalid (e5)" )
7171 elif do_validate_upstreams and (partials [1 ] in perm_upstreams ) is False :
7272 errors .append ("service upstream is invalid (e6)" )
73- elif do_validate_upstreams :
73+ elif do_validate_upstreams and ( host in perm_upstreams ) is False :
7474 errors .append ("service upstream is invalid (e6)" )
0 commit comments