-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.go
32 lines (26 loc) · 825 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
package main
import (
"github.com/justinbarrick/backup-controller/pkg/reconcilers/pvc"
"github.com/justinbarrick/backup-controller/pkg/runtime"
latest "github.com/justinbarrick/backup-controller/pkg/webhooks/snapshot"
"log"
)
const (
webhookNamespace = "backup-controller"
webhookName = "backup-controller"
)
func main() {
runtime, err := runtime.NewRuntime(webhookName, webhookNamespace)
if err != nil {
log.Fatal("cannot create backup manager:", err)
}
if err := runtime.RegisterWebhook(&latest.LatestSnapshotMutator{}); err != nil {
log.Fatal("cannot register webhook:", err)
}
if err := runtime.RegisterController("pvc", &pvc.Reconciler{}); err != nil {
log.Fatal("cannot register pvc-runtime:", err)
}
if err := runtime.Start(); err != nil {
log.Fatal("cannot start manager:", err)
}
}