-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlxd.go
55 lines (50 loc) · 1.15 KB
/
lxd.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
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import (
"os"
"github.com/jtopjian/limbo/lib"
"github.com/urfave/cli"
)
var lxdFlags = []cli.Flag{
cli.StringFlag{
Name: "lxd-config-directory",
Usage: "LXD Config Directory.",
Value: os.ExpandEnv("$HOME/.config/lxc"),
},
cli.StringFlag{
Name: "name",
Usage: "Name of the LXD resource.",
},
cli.StringFlag{
Name: "type",
Usage: "Type of LXD resource (container, image).",
Value: "container",
},
cli.BoolFlag{
Name: "stop",
Usage: "Stop the LXD container if it's running.",
},
cli.StringSliceFlag{
Name: "property",
Usage: "key=value properties for the new image. Can be repeated.",
},
cli.StringSliceFlag{
Name: "alias",
Usage: "aliases for the new image. Can be repeated.",
},
cli.StringFlag{
Name: "compression",
Usage: "Type of compression to use (bzip2, gzip, lzma, xz, or none).",
Value: "gzip",
},
cli.StringFlag{
Name: "tmpdir",
Usage: "Local temporary directory to store LXD resources.",
Value: "/tmp",
},
}
func newLXDConfig(configDirectory string) (lib.LXDConfig, error) {
lxdConfig := lib.LXDConfig{
ConfigDirectory: configDirectory,
}
return lib.NewLXDConfig(lxdConfig)
}