Commit f94c57ac authored by Avesh Agarwal's avatar Avesh Agarwal

If ForceUserspaceProxy is true, check for iptables based proxy

should not be performed.
parent 0f1525ce
......@@ -168,12 +168,17 @@ func (s *ProxyServer) Run(_ []string) error {
var proxier proxy.ProxyProvider
var endpointsHandler config.EndpointsConfigHandler
// guaranteed false on error, error only necessary for debugging
shouldUseIptables, err := iptables.ShouldUseIptablesProxier()
if err != nil {
glog.Errorf("Can't determine whether to use iptables or userspace, using userspace proxier: %v", err)
shouldUseIptables := false
if !s.ForceUserspaceProxy {
var err error
// guaranteed false on error, error only necessary for debugging
shouldUseIptables, err = iptables.ShouldUseIptablesProxier()
if err != nil {
glog.Errorf("Can't determine whether to use iptables proxy, using userspace proxier: %v", err)
}
}
if !s.ForceUserspaceProxy && shouldUseIptables {
if shouldUseIptables {
glog.V(2).Info("Using iptables Proxier.")
execer := exec.New()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment