Create a consulContext using a client's consul config.

This is wrong and should be the Agent's Consul Config.  This is a
step in the right direction, so committing to mark the necessary
future change.
This commit is contained in:
Sean Chittenden 2016-06-09 23:02:44 -04:00
parent f9b561b52f
commit cc6e8792e0
No known key found for this signature in database
GPG key ID: 4EBC9DC16C2E5E16

View file

@ -16,7 +16,6 @@ import (
"github.com/hashicorp/nomad/client/driver/logging"
cstructs "github.com/hashicorp/nomad/client/driver/structs"
"github.com/hashicorp/nomad/nomad/structs"
sconfig "github.com/hashicorp/nomad/nomad/structs/config"
)
// createExecutor launches an executor plugin and returns an instance of the
@ -73,20 +72,8 @@ func createLogCollector(config *plugin.ClientConfig, w io.Writer,
}
func consulContext(clientConfig *config.Config, containerID string) *executor.ConsulContext {
cfg := sconfig.ConsulConfig{
Addr: clientConfig.ReadDefault("consul.address", "127.0.0.1:8500"),
Token: clientConfig.Read("consul.token"),
Auth: clientConfig.Read("consul.auth"),
EnableSSL: clientConfig.ReadBoolDefault("consul.ssl", false),
VerifySSL: clientConfig.ReadBoolDefault("consul.verifyssl", true),
CAFile: clientConfig.Read("consul.tls_ca_file"),
CertFile: clientConfig.Read("consul.tls_cert_file"),
KeyFile: clientConfig.Read("consul.tls_key_file"),
ServerServiceName: clientConfig.ReadDefault("consul.server_service_name", "nomad"),
ClientServiceName: clientConfig.ReadDefault("consul.client_service_name", "nomad-client"),
}
return &executor.ConsulContext{
ConsulConfig: &cfg,
ConsulConfig: clientConfig.ConsulConfig,
ContainerID: containerID,
DockerEndpoint: clientConfig.Read("docker.endpoint"),
TLSCa: clientConfig.Read("docker.tls.ca"),