Skip to content

Commit

Permalink
Changed option names in lxd config.go to correspond toml/json names
Browse files Browse the repository at this point in the history
  • Loading branch information
illarion committed Jun 7, 2017
1 parent ccfb356 commit 201476f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ type LXDDiscoveryConfig struct {
LXDServerRemoteName string `toml:"lxd_server_remote_name" json:"lxd_server_remote_name"`
LXDServerRemotePassword string `toml:"lxd_server_remote_password" json:"lxd_server_remote_password"`

LXDClientConfigDirectory string `toml:"lxd_config_directory" json:"lxd_config_directory"`
LXDClientGenerateCerts bool `toml:"lxd_generate_client_certs" json:"lxd_generate_client_certs"`
LXDClientAcceptServerCert bool `toml:"lxd_accept_server_cert" json:"lxd_accept_server_cert"`
LXDConfigDirectory string `toml:"lxd_config_directory" json:"lxd_config_directory"`
LXDGenerateClientCerts bool `toml:"lxd_generate_client_certs" json:"lxd_generate_client_certs"`
LXDAcceptServerCert bool `toml:"lxd_accept_server_cert" json:"lxd_accept_server_cert"`

LXDContainerLabelKey string `toml:"lxd_container_label_key" json:"lxd_container_label_key"`
LXDContainerLabelValue string `toml:"lxd_container_label_value" json:"lxd_container_label_value"`
Expand Down
6 changes: 3 additions & 3 deletions src/discovery/lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func lxdBuildClient(cfg config.DiscoveryConfig) (*lxd.Client, error) {
if strings.HasPrefix(cfg.LXDServerAddress, "https:") {

/* Validate or generate certificates on the client side (gobetween) */
if err := lxdhelpers.ValidateClientCertificates(lxdConfig, cfg.LXDClientGenerateCerts); err != nil {
if err := lxdhelpers.ValidateClientCertificates(lxdConfig, cfg.LXDGenerateClientCerts); err != nil {
return nil, err
}

Expand All @@ -180,7 +180,7 @@ func lxdBuildClient(cfg config.DiscoveryConfig) (*lxd.Client, error) {
* But if there's an error, then gobetween will try to download the server's cert.
*/
if _, err := client.GetServerConfig(); err != nil {
if cfg.LXDClientAcceptServerCert {
if cfg.LXDAcceptServerCert {
var err error
client, err = lxdhelpers.GetRemoteCertificate(client, cfg.LXDServerRemoteName)
if err != nil {
Expand Down Expand Up @@ -236,7 +236,7 @@ func lxdBuildConfig(cfg config.DiscoveryConfig) (lxd.Config, error) {

/* Build an LXD configuration that will connect to the requested LXD server */
config := lxd.Config{
ConfigDir: cfg.LXDClientConfigDirectory,
ConfigDir: cfg.LXDConfigDirectory,
Remotes: make(map[string]lxd.RemoteConfig),
}
config.Remotes[cfg.LXDServerRemoteName] = lxd.RemoteConfig{Addr: cfg.LXDServerAddress}
Expand Down
4 changes: 2 additions & 2 deletions src/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func prepareConfig(name string, server config.Server, defaults config.Connection
server.Discovery.LXDServerRemoteName = "local"
}

if server.Discovery.LXDClientConfigDirectory == "" {
server.Discovery.LXDClientConfigDirectory = os.ExpandEnv("$HOME/.config/lxc")
if server.Discovery.LXDConfigDirectory == "" {
server.Discovery.LXDConfigDirectory = os.ExpandEnv("$HOME/.config/lxc")
}

if server.Discovery.LXDContainerInterface == "" {
Expand Down

0 comments on commit 201476f

Please sign in to comment.