INNER CODE UNIT · Go

func

zalando/skipper · cmd/webhook/main.go:31

func (c *config) parse() {
	flag.BoolVar(&c.debug, "debug", false, "Enable debug logging")
	flag.StringVar(&c.certFile, "tls-cert-file", os.Getenv("CERT_FILE"), "File containing the certificate for HTTPS")
	flag.StringVar(&c.keyFile, "tls-key-file", os.Getenv("KEY_FILE"), "File containing the private key for HTTPS")
	flag.StringVar(&c.address, "address", defaultHTTPSAddress, "The address to listen on")
	flag.Parse()

	if (c.certFile != "" || c.keyFile != "") && !(c.certFile != "" && c.keyFile != "") {
		log.Fatal("Config parse error: both of TLS cert & key must be provided or neither (for testing )")
		return
	}

	// support non-HTTPS for local testing
	if (c.certFile == "" && c.keyFile == "") && c.address == defaultHTTPSAddress {
		c.address = defaultHTTPAddress
	}

	if c.debug {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…