Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindelgado committed Apr 8, 2021
1 parent 4dc10f9 commit 5a5106d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pkg/webhook/example_test.go
Expand Up @@ -83,7 +83,7 @@ func Example() {

// This example creates a webhook server that can be
// ran without a controller manager.
func ExampleStandaloneServer() {
func ExampleServer_StartStandalone() {
// Create a webhook server
hookServer := &Server{
Port: 8443,
Expand All @@ -105,7 +105,7 @@ func ExampleStandaloneServer() {
// and runs it on a vanilla go HTTP server to demonstrate
// how you could run a webhook on an existing server
// without a controller manager.
func ExampleArbitraryHTTPServer() {
func ExampleStandaloneWebhook() {
// Assume you have an existing HTTP server at your disposal
// configured as desired (e.g. with TLS).
// For this example just create a basic http.ServeMux
Expand Down Expand Up @@ -144,6 +144,8 @@ func ExampleArbitraryHTTPServer() {
mux.Handle("/validating", validatingHookHandler)

// Run your handler
http.ListenAndServe(port, mux)
if err := http.ListenAndServe(port, mux); err != nil {
panic(err)
}

}
6 changes: 4 additions & 2 deletions pkg/webhook/webhook_integration_test.go
Expand Up @@ -127,7 +127,9 @@ var _ = Describe("Webhook", func() {
}

// generate listener
listener, err := tls.Listen("tcp", net.JoinHostPort(testenv.WebhookInstallOptions.LocalServingHost, strconv.Itoa(int(testenv.WebhookInstallOptions.LocalServingPort))), cfg)
listener, err := tls.Listen("tcp",
net.JoinHostPort(testenv.WebhookInstallOptions.LocalServingHost,
strconv.Itoa(int(testenv.WebhookInstallOptions.LocalServingPort))), cfg)
Expect(err).NotTo(HaveOccurred())

// create and register the standalone webhook
Expand All @@ -144,7 +146,7 @@ var _ = Describe("Webhook", func() {
Expect(srv.Shutdown(context.Background())).NotTo(HaveOccurred())
close(idleConnsClosed)
}()
srv.Serve(listener)
_ = srv.Serve(listener)
<-idleConnsClosed
}()

Expand Down

0 comments on commit 5a5106d

Please sign in to comment.