-
Notifications
You must be signed in to change notification settings - Fork 3
/
root.go
42 lines (32 loc) · 1.11 KB
/
root.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
package cmd
// This file contains the root commands when starting `cedana ...`
import (
"context"
"github.com/cedana/cedana/utils"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "cedana",
Short: "simple criu dump/restore client",
Long: `
________ _______ ________ ________ ________ ________
|\ ____\|\ ___ \ |\ ___ \|\ __ \|\ ___ \|\ __ \
\ \ \___|\ \ __/|\ \ \_|\ \ \ \|\ \ \ \\ \ \ \ \|\ \
\ \ \ \ \ \_|/_\ \ \ \\ \ \ __ \ \ \\ \ \ \ __ \
\ \ \____\ \ \_|\ \ \ \_\\ \ \ \ \ \ \ \\ \ \ \ \ \ \
\ \_______\ \_______\ \_______\ \__\ \__\ \__\\ \__\ \__\ \__\
\|_______|\|_______|\|_______|\|__|\|__|\|__| \|__|\|__|\|__|
` +
"\n Instance Brokerage, Orchestration and Migration System." +
"\n Property of Cedana, Corp.",
}
func Execute(ctx context.Context) error {
logger := utils.GetLogger()
ctx = context.WithValue(ctx, "logger", logger)
if err := utils.InitConfig(); err != nil {
logger.Error().Err(err).Msg("failed to initialize config")
return err
}
rootCmd.Version = GetVersion()
return rootCmd.ExecuteContext(ctx)
}