From 2eb0aad189d795c88969c3b4780f7fca357fdd8d Mon Sep 17 00:00:00 2001 From: Kevin Delgado Date: Thu, 8 Apr 2021 17:03:59 +0000 Subject: [PATCH] fix CI --- pkg/webhook/example_test.go | 8 +++++--- pkg/webhook/webhook_integration_test.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/webhook/example_test.go b/pkg/webhook/example_test.go index 0deb382324..83b7be523e 100644 --- a/pkg/webhook/example_test.go +++ b/pkg/webhook/example_test.go @@ -83,7 +83,7 @@ func Example() { // This example creates a webhook server that can be // ran without a controller manager. -func ExampleStandaloneServer() { +func ExampleStartStandalone() { // Create a webhook server hookServer := &Server{ Port: 8443, @@ -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 @@ -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) + } } diff --git a/pkg/webhook/webhook_integration_test.go b/pkg/webhook/webhook_integration_test.go index e2a1d2b3b3..51e9162d50 100644 --- a/pkg/webhook/webhook_integration_test.go +++ b/pkg/webhook/webhook_integration_test.go @@ -144,7 +144,7 @@ var _ = Describe("Webhook", func() { Expect(srv.Shutdown(context.Background())).NotTo(HaveOccurred()) close(idleConnsClosed) }() - srv.Serve(listener) + _ = srv.Serve(listener) <-idleConnsClosed }()