INNER CODE UNIT · Go
init
senthilrch/kube-fledged · cmd/webhook-server/main.go:32
func init() {
flag.StringVar(&certFile, "cert-file", "", "File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert).")
flag.StringVar(&keyFile, "key-file", "", "File containing the default x509 private key matching --cert-file.")
flag.IntVar(&port, "port", 443, "Secure port that the webhook server listens on")
flag.BoolVar(&initServer, "init-server", false, "True means only init tasks for the server will be performed. Server is not started")
}
func main() {
flag.Parse()
if initServer {
/*
Call function to perform init tasks:
- create CA cert and key
- create server cert and key and copy to /etc/webhook/certs
- patch validatingwebhookconfiguration with CA bundle
*/
if err := app.InitWebhookServer(); err != nil {
panic(err)