forked from Azure/aks-app-routing-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (32 loc) · 708 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package main
import (
"flag"
"fmt"
"math/rand"
"os"
"time"
ctrl "sigs.k8s.io/controller-runtime"
"github.com/Azure/aks-app-routing-operator/pkg/config"
"github.com/Azure/aks-app-routing-operator/pkg/controller"
)
func main() {
flag.Parse()
rand.Seed(time.Now().Unix())
if err := run(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func run() error {
if err := config.Flags.Validate(); err != nil {
return err
}
rc := controller.NewRestConfig(config.Flags)
mgr, err := controller.NewManagerForRestConfig(config.Flags, rc)
if err != nil {
return err
}
return mgr.Start(ctrl.SetupSignalHandler())
}