Skip to content

Commit 39309dd

Browse files
committed
fix CI
1 parent 4dc10f9 commit 39309dd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/webhook/example_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func Example() {
8383

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

146146
// Run your handler
147-
http.ListenAndServe(port, mux)
147+
if err := http.ListenAndServe(port, mux); err != nil {
148+
panic(err)
149+
}
148150

149151
}

pkg/webhook/webhook_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ var _ = Describe("Webhook", func() {
144144
Expect(srv.Shutdown(context.Background())).NotTo(HaveOccurred())
145145
close(idleConnsClosed)
146146
}()
147-
srv.Serve(listener)
147+
_ = srv.Serve(listener)
148148
<-idleConnsClosed
149149
}()
150150

0 commit comments

Comments
 (0)