Skip to content

Commit 02ffab4

Browse files
committed
Webhook server uses its configured host if set
1 parent c84fba8 commit 02ffab4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/webhook/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const (
3636

3737
// ServerOptions are options for configuring an admission webhook server.
3838
type ServerOptions struct {
39+
// Address that the server will listen on.
40+
// Defaults to "" - all addresses.
41+
Host string
42+
3943
// Port is the port number that the server will serve.
4044
// It will be defaulted to 443 if unspecified.
4145
Port int32
@@ -153,7 +157,7 @@ func (s *Server) Start(stop <-chan struct{}) error {
153157
Certificates: []tls.Certificate{cert},
154158
}
155159

156-
listener, err := tls.Listen("tcp", net.JoinHostPort("", strconv.Itoa(int(s.Port))), cfg)
160+
listener, err := tls.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(int(s.Port))), cfg)
157161
if err != nil {
158162
return err
159163
}

0 commit comments

Comments
 (0)