We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4836ec2 commit 5b1048cCopy full SHA for 5b1048c
pkg/webhook/example_test.go
@@ -24,10 +24,6 @@ import (
24
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
25
)
26
27
-var (
28
- mgr ctrl.Manager
29
-)
30
-
31
func Example() {
32
// Build webhooks
33
// These handlers could be also be implementations
@@ -48,6 +44,13 @@ func Example() {
48
44
}),
49
45
}
50
46
47
+ // Create a manager
+ // Note: GetConfigOrDie will os.Exit(1) w/o any message if no kube-config can be found
+ mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{})
+ if err != nil {
51
+ panic(err)
52
+ }
53
+
54
// Create a webhook server.
55
hookServer := &Server{
56
Port: 8443,
0 commit comments