...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package watcher
17
18 import (
19 "testing"
20
21 . "github.com/onsi/ginkgo"
22 . "github.com/onsi/gomega"
23 "k8s.io/client-go/rest"
24 "sigs.k8s.io/controller-runtime/pkg/envtest/printer"
25 )
26
27 func TestAPIs(t *testing.T) {
28 RegisterFailHandler(Fail)
29
30 RunSpecsWithDefaultAndCustomReporters(t,
31 "webhook config watcher",
32 []Reporter{printer.NewlineReporter{}})
33 }
34
35 func MockClusterConfig() (*rest.Config, error) {
36 return &rest.Config{
37 Host: "https://testhost:9527",
38 TLSClientConfig: rest.TLSClientConfig{},
39 BearerToken: "testToken",
40 BearerTokenFile: "/var/run/secrets/kubernetes.io/serviceaccount/token",
41 }, nil
42 }
43