Skip to content

Commit

Permalink
Merge pull request #322 from craigfurman/webhook-server-use-host
Browse files Browse the repository at this point in the history
🐛 Webhook server uses its configured host if set
  • Loading branch information
k8s-ci-robot committed Feb 15, 2019
2 parents c84fba8 + 02ffab4 commit 02cc4d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 02cc4d9

Please sign in to comment.