From 02ffab4e2c5dcc72556be247dbbcfbf0a61d3f57 Mon Sep 17 00:00:00 2001 From: Craig Furman Date: Mon, 11 Feb 2019 17:38:30 +0000 Subject: [PATCH] Webhook server uses its configured host if set --- pkg/webhook/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/webhook/server.go b/pkg/webhook/server.go index 3b9f3b14e3..38daa91dd1 100644 --- a/pkg/webhook/server.go +++ b/pkg/webhook/server.go @@ -36,6 +36,10 @@ const ( // ServerOptions are options for configuring an admission webhook server. type ServerOptions struct { + // Address that the server will listen on. + // Defaults to "" - all addresses. + Host string + // Port is the port number that the server will serve. // It will be defaulted to 443 if unspecified. Port int32 @@ -153,7 +157,7 @@ func (s *Server) Start(stop <-chan struct{}) error { Certificates: []tls.Certificate{cert}, } - listener, err := tls.Listen("tcp", net.JoinHostPort("", strconv.Itoa(int(s.Port))), cfg) + listener, err := tls.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(int(s.Port))), cfg) if err != nil { return err }