-
Notifications
You must be signed in to change notification settings - Fork 16
/
main.go
32 lines (27 loc) · 1.09 KB
/
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/Lirt/velero-plugin-for-openstack/src/cinder"
"github.com/Lirt/velero-plugin-for-openstack/src/manila"
"github.com/Lirt/velero-plugin-for-openstack/src/swift"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
veleroplugin "github.com/vmware-tanzu/velero/pkg/plugin/framework"
)
func main() {
veleroplugin.NewServer().
BindFlags(pflag.CommandLine).
RegisterObjectStore("community.openstack.org/openstack", newSwiftObjectStore).
RegisterVolumeSnapshotter("community.openstack.org/openstack", newCinderBlockStore).
RegisterVolumeSnapshotter("community.openstack.org/openstack-cinder", newCinderBlockStore).
RegisterVolumeSnapshotter("community.openstack.org/openstack-manila", newManilaFSStore).
Serve()
}
func newSwiftObjectStore(logger logrus.FieldLogger) (interface{}, error) {
return swift.NewObjectStore(logger), nil
}
func newCinderBlockStore(logger logrus.FieldLogger) (interface{}, error) {
return cinder.NewBlockStore(logger), nil
}
func newManilaFSStore(logger logrus.FieldLogger) (interface{}, error) {
return manila.NewFSStore(logger), nil
}