@@ -28,7 +28,6 @@ import (
28
28
"k8s.io/apimachinery/pkg/runtime/serializer"
29
29
30
30
ctrl "sigs.k8s.io/controller-runtime"
31
- "sigs.k8s.io/controller-runtime/pkg/client"
32
31
"sigs.k8s.io/controller-runtime/pkg/log/zap"
33
32
34
33
"github.com/kyma-project/runtime-watcher/skr/internal"
@@ -68,14 +67,6 @@ func main() {
68
67
}
69
68
logger .Info ("Server config successfully parsed: " + config .PrettyPrint ())
70
69
71
- restConfig := ctrl .GetConfigOrDie ()
72
- restClient , err := client .New (restConfig , client.Options {})
73
- if err != nil {
74
- logger .Error (err , "rest client could not be determined for skr-webhook" )
75
- return
76
- }
77
- logger .Info ("REST client initialized" )
78
-
79
70
decoder := serializer .NewCodecFactory (runtime .NewScheme ()).UniversalDeserializer ()
80
71
requestParser := requestparser .NewRequestParser (decoder )
81
72
metrics := watchermetrics .NewMetrics ()
@@ -95,7 +86,7 @@ func main() {
95
86
}()
96
87
logger .Info ("Metrics server started" )
97
88
98
- handler := internal .NewHandler (restClient , logger , config , * requestParser , * metrics )
89
+ handler := internal .NewHandler (logger , config , * requestParser , * metrics )
99
90
http .HandleFunc ("/validate/" , handler .Handle )
100
91
server := http.Server {
101
92
Addr : fmt .Sprintf (":%d" , config .Port ),
0 commit comments