Skip to content

Commit 5a5106d

Browse files
committed
fix CI
1 parent 4dc10f9 commit 5a5106d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

pkg/webhook/example_test.go

+5-3
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

+4-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ var _ = Describe("Webhook", func() {
127127
}
128128

129129
// generate listener
130-
listener, err := tls.Listen("tcp", net.JoinHostPort(testenv.WebhookInstallOptions.LocalServingHost, strconv.Itoa(int(testenv.WebhookInstallOptions.LocalServingPort))), cfg)
130+
listener, err := tls.Listen("tcp",
131+
net.JoinHostPort(testenv.WebhookInstallOptions.LocalServingHost,
132+
strconv.Itoa(int(testenv.WebhookInstallOptions.LocalServingPort))), cfg)
131133
Expect(err).NotTo(HaveOccurred())
132134

133135
// create and register the standalone webhook
@@ -144,7 +146,7 @@ var _ = Describe("Webhook", func() {
144146
Expect(srv.Shutdown(context.Background())).NotTo(HaveOccurred())
145147
close(idleConnsClosed)
146148
}()
147-
srv.Serve(listener)
149+
_ = srv.Serve(listener)
148150
<-idleConnsClosed
149151
}()
150152

0 commit comments

Comments
 (0)