MCPcopy Index your code
hub / github.com/zalando/postgres-operator / main

Function main

cmd/main.go:68–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68func main() {
69 var err error
70
71 if config.EnableJsonLogging {
72 log.SetFormatter(&log.JSONFormatter{})
73 }
74 log.SetOutput(os.Stdout)
75 log.Printf("Spilo operator %s\n", version)
76
77 sigs := make(chan os.Signal, 1)
78 stop := make(chan struct{})
79 signal.Notify(sigs, os.Interrupt, syscall.SIGTERM) // Push signals into channel
80
81 wg := &sync.WaitGroup{} // Goroutines can add themselves to this to be waited on
82
83 config.RestConfig, err = k8sutil.RestConfig(kubeConfigFile, outOfCluster)
84 if err != nil {
85 log.Fatalf("couldn't get REST config: %v", err)
86 }
87
88 config.RestConfig.QPS = float32(config.KubeQPS)
89 config.RestConfig.Burst = config.KubeBurst
90
91 c := controller.NewController(&config, "")
92
93 c.Run(stop, wg)
94
95 sig := <-sigs
96 log.Printf("Shutting down... %+v", sig)
97
98 close(stop) // Tell goroutines to stop themselves
99 wg.Wait() // Wait for all to be stopped
100}

Callers

nothing calls this directly

Calls 3

RunMethod · 0.95
RestConfigFunction · 0.92
NewControllerFunction · 0.92

Tested by

no test coverage detected