Skip to content

Commit

Permalink
Fix kv
Browse files Browse the repository at this point in the history
Signed-off-by: Emile Vauge <emile@vauge.com>
  • Loading branch information
emilevauge committed Sep 20, 2016
1 parent 7a49a21 commit 482d1fd
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions provider/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,6 @@ func (provider *Kv) watchKv(configurationChan chan<- types.ConfigMessage, prefix

func (provider *Kv) provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error {
provider.Constraints = append(provider.Constraints, constraints...)
storeConfig := &store.Config{
ConnectionTimeout: 30 * time.Second,
Bucket: "traefik",
}

if provider.TLS != nil {
caPool := x509.NewCertPool()

if provider.TLS.CA != "" {
ca, err := ioutil.ReadFile(provider.TLS.CA)

if err != nil {
return fmt.Errorf("Failed to read CA. %s", err)
}

caPool.AppendCertsFromPEM(ca)
}

cert, err := tls.LoadX509KeyPair(provider.TLS.Cert, provider.TLS.Key)

if err != nil {
return fmt.Errorf("Failed to load TLS keypair: %v", err)
}

storeConfig.TLS = &tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caPool,
InsecureSkipVerify: provider.TLS.InsecureSkipVerify,
}
}

operation := func() error {
if _, err := provider.kvclient.Exists("qmslkjdfmqlskdjfmqlksjazçueznbvbwzlkajzebvkwjdcqmlsfj"); err != nil {
return fmt.Errorf("Failed to test KV store connection: %v", err)
Expand Down

0 comments on commit 482d1fd

Please sign in to comment.