-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmain.go
More file actions
30 lines (25 loc) · 819 Bytes
/
main.go
File metadata and controls
30 lines (25 loc) · 819 Bytes
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
package main
import (
"github.com/openshift/hypershift-oadp-plugin/pkg/core"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
)
func configureLogger(logger logrus.FieldLogger) logrus.FieldLogger {
return logger.WithFields(
logrus.Fields{
"type": "hcp-plugin",
},
)
}
func main() {
framework.NewServer().
RegisterBackupItemAction("hypershift-oadp-plugin/backup-item-action", newHCPBackupPlugin).
RegisterRestoreItemAction("hypershift-oadp-plugin/restore-item-action", newHCPRestorePlugin).
Serve()
}
func newHCPBackupPlugin(logger logrus.FieldLogger) (interface{}, error) {
return core.NewBackupPlugin(configureLogger(logger))
}
func newHCPRestorePlugin(logger logrus.FieldLogger) (interface{}, error) {
return core.NewRestorePlugin(configureLogger(logger))
}