File: default.go

package info (click to toggle)
lxd 5.0.2%2Bgit20231211.1364ae4-9%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 25,888 kB
  • sloc: sh: 14,275; ansic: 3,112; python: 432; makefile: 265; ruby: 51; sql: 50; javascript: 9; lisp: 6
file content (81 lines) | stat: -rw-r--r-- 2,336 bytes parent folder | download
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package config

// LocalRemote is the default local remote (over the LXD unix socket).
var LocalRemote = Remote{
	Addr:   "unix://",
	Static: true,
	Public: false,
}

// ImagesRemote is the main image server (over simplestreams).
var ImagesRemote = Remote{
	Addr:     "https://images.lxd.canonical.com",
	Public:   true,
	Protocol: "simplestreams",
}

// UbuntuRemote is the Ubuntu image server (over simplestreams).
var UbuntuRemote = Remote{
	Addr:     "https://cloud-images.ubuntu.com/releases",
	Static:   true,
	Public:   true,
	Protocol: "simplestreams",
}

// UbuntuDailyRemote is the Ubuntu daily image server (over simplestreams).
var UbuntuDailyRemote = Remote{
	Addr:     "https://cloud-images.ubuntu.com/daily",
	Static:   true,
	Public:   true,
	Protocol: "simplestreams",
}

// UbuntuMinimalRemote is the Ubuntu minimal image server (over simplestreams).
var UbuntuMinimalRemote = Remote{
	Addr:     "https://cloud-images.ubuntu.com/minimal/releases/",
	Static:   true,
	Public:   true,
	Protocol: "simplestreams",
}

// UbuntuMinimalDailyRemote is the Ubuntu daily minimal image server (over simplestreams).
var UbuntuMinimalDailyRemote = Remote{
	Addr:     "https://cloud-images.ubuntu.com/minimal/daily/",
	Static:   true,
	Public:   true,
	Protocol: "simplestreams",
}

// StaticRemotes is the list of remotes which can't be removed.
var StaticRemotes = map[string]Remote{
	"local":                LocalRemote,
	"images":               ImagesRemote,
	"ubuntu":               UbuntuRemote,
	"ubuntu-daily":         UbuntuDailyRemote,
	"ubuntu-minimal":       UbuntuMinimalRemote,
	"ubuntu-minimal-daily": UbuntuMinimalDailyRemote,
}

// DefaultRemotes is the list of default remotes.
var DefaultRemotes = map[string]Remote{
	"local":                LocalRemote,
	"ubuntu":               UbuntuRemote,
	"ubuntu-daily":         UbuntuDailyRemote,
	"ubuntu-minimal":       UbuntuMinimalRemote,
	"ubuntu-minimal-daily": UbuntuMinimalDailyRemote,
}

// DefaultConfig returns the default configuration.
func DefaultConfig() *Config {
	// Duplicate remotes from DefaultRemotes.
	defaultRoutes := make(map[string]Remote, len(DefaultRemotes))
	for k, v := range DefaultRemotes {
		defaultRoutes[k] = v
	}

	return &Config{
		Remotes:       defaultRoutes,
		Aliases:       make(map[string]string),
		DefaultRemote: "local",
	}
}