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