proxy should fail fast if proxier is nil, rather than panic later

This commit is contained in:
James DeFelice 2014-12-15 12:56:35 -05:00
parent 5ef34bf523
commit e27b8f0df7

View File

@ -66,6 +66,9 @@ func main() {
}
loadBalancer := proxy.NewLoadBalancerRR()
proxier := proxy.NewProxier(loadBalancer, net.IP(bindAddress), iptables.New(exec.New(), protocol))
if proxier == nil {
glog.Fatalf("failed to create proxier, aborting")
}
// Wire proxier to handle changes to services
serviceConfig.RegisterHandler(proxier)
// And wire loadBalancer to handle changes to endpoints to services