-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.go
30 lines (23 loc) · 881 Bytes
/
controller.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
// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package state
import (
"github.com/juju/errors"
jujucontroller "github.com/juju/juju/controller"
)
const (
// controllerSettingsGlobalKey is the key for the controller and its settings.
controllerSettingsGlobalKey = "controllerSettings"
// controllerInheritedSettingsGlobalKey is the key for default settings shared across models.
controllerInheritedSettingsGlobalKey = "controllerInheritedSettings"
// controllerGlobalKey is the key for controller.
controllerGlobalKey = "c"
)
// ControllerConfig returns the config values for the controller.
func (st *State) ControllerConfig() (jujucontroller.Config, error) {
settings, err := readSettings(st, controllersC, controllerSettingsGlobalKey)
if err != nil {
return nil, errors.Trace(err)
}
return settings.Map(), nil
}