Example #1
0
func consulContext(clientConfig *config.Config, containerID string) *executor.ConsulContext {
	return &executor.ConsulContext{
		ConsulConfig:   clientConfig.ConsulConfig,
		ContainerID:    containerID,
		DockerEndpoint: clientConfig.Read("docker.endpoint"),
		TLSCa:          clientConfig.Read("docker.tls.ca"),
		TLSCert:        clientConfig.Read("docker.tls.cert"),
		TLSKey:         clientConfig.Read("docker.tls.key"),
	}
}
Example #2
0
func consulContext(clientConfig *config.Config, containerID string) *executor.ConsulContext {
	cfg := consul.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"),
	}
	return &executor.ConsulContext{
		ConsulConfig:   &cfg,
		ContainerID:    containerID,
		DockerEndpoint: clientConfig.Read("docker.endpoint"),
		TLSCa:          clientConfig.Read("docker.tls.ca"),
		TLSCert:        clientConfig.Read("docker.tls.cert"),
		TLSKey:         clientConfig.Read("docker.tls.key"),
	}
}