func main()

in cmd/netd/main.go [35:68]


func main() {
	config := options.NewNetdConfig()
	config.AddFlags(pflag.CommandLine)
	pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
	pflag.Parse()
	glog.Infof("netd version: %s", version.Version)
	pflag.CommandLine.VisitAll(func(f *pflag.Flag) {
		glog.Infof("FLAG: --%s=%q", f.Name, f.Value)
	})

	nc := netconf.NewNetworkConfigController(config.EnablePolicyRouting, config.EnableSourceValidMark, config.ExcludeDNS, config.ReconcileInterval)

	stopCh := make(chan struct{})

	var wg sync.WaitGroup
	wg.Add(1)

	glog.Infof("Starting netd")
	go nc.Run(stopCh, &wg)

	err := metrics.StartCollector()
	if err != nil {
		glog.Errorf("Could not start metrics collector: %v", err)
	}

	ch := make(chan os.Signal, 1)
	signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
	<-ch

	glog.Infof("Shutting down netd ...")
	close(stopCh)

	wg.Wait()
}