in main.go [36:59]
func main() {
var (
certPath = flag.String("certFile", "/opt/webhook/certs/cert.pem", "path to cert.pem")
keyPath = flag.String("keyFile", "/opt/webhook/certs/key.pem", "path to key.pem")
configPath = flag.String("config", "/opt/webhook/config/webhook.yaml", "path to config.yaml")
)
flag.Parse()
cfg, err := parseConfig(*configPath)
if err != nil {
log.Fatalf("error reading config: %v", err)
}
ss := &server{
l: log.Default(),
c: cfg.Agents,
}
s := &http.Server{
Addr: ":8443",
Handler: ss,
}
log.Println("listening on :8443")
log.Fatal(s.ListenAndServeTLS(*certPath, *keyPath))
}