Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConfigSchema = config.Schema{
"core.https_address": {},
"maas.machine": {},
}
ConfigSchema defines available server configuration keys.
Functions ¶
func DetermineRaftNode ¶
DetermineRaftNode figures out what raft node ID and address we have, if any.
This decision is based on the values of the core.https_address config key and on the rows in the raft_nodes table, both stored in the node-level SQLite database.
The following rules are applied:
- If no core.https_address config key is set, this is a non-clustered node and the returned RaftNode will have ID 1 but no address, to signal that the node should setup an in-memory raft cluster where the node itself is the only member and leader.
- If core.https_address config key is set, but there is no row in the raft_nodes table, this is a non-clustered node as well, and same behavior as the previous case applies.
- If core.https_address config key is set and there is at least one row in the raft_nodes table, then this node is considered a raft node if core.https_address matches one of the rows in raft_nodes. In that case, the matching db.RaftNode row is returned, otherwise nil.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds node-local configuration values for a certain LXD instance.
func ConfigLoad ¶
ConfigLoad loads a new Config object with the current node-local configuration values fetched from the database. An optional list of config value triggers can be passed, each config key must have at most one trigger.
func (*Config) Dump ¶
Dump current configuration keys and their values. Keys with values matching their defaults are omitted.
func (*Config) HTTPSAddress ¶
HTTPSAddress returns the address and port this LXD node should expose its API to, if any.
func (*Config) MAASMachine ¶
MAASMachine returns the MAAS machine this instance is associated with, if any.