mirror of https://github.com/docker/docs.git
update libkv godeps, fixes consul multiple IPs silently discarded
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
3bb4373f9f
commit
40bad153e7
|
@ -52,7 +52,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/libkv",
|
||||
"Rev": "261ee167337a70a244e30410080685843b22e184"
|
||||
"Rev": "56d6633db7a524c74773fd6b98f02afcd0e6f27a"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/gogo/protobuf/proto",
|
||||
|
|
|
@ -2,6 +2,7 @@ package consul
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
|
@ -18,6 +19,12 @@ const (
|
|||
DefaultWatchWaitTime = 15 * time.Second
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrMultipleEndpointsUnsupported is thrown when there are
|
||||
// multiple endpoints specified for Consul
|
||||
ErrMultipleEndpointsUnsupported = errors.New("consul does not support multiple endpoints")
|
||||
)
|
||||
|
||||
// Consul is the receiver type for the
|
||||
// Store interface
|
||||
type Consul struct {
|
||||
|
@ -34,6 +41,10 @@ type consulLock struct {
|
|||
// New creates a new Consul client given a list
|
||||
// of endpoints and optional tls config
|
||||
func New(endpoints []string, options *store.Config) (store.Store, error) {
|
||||
if len(endpoints) > 1 {
|
||||
return nil, ErrMultipleEndpointsUnsupported
|
||||
}
|
||||
|
||||
s := &Consul{}
|
||||
|
||||
// Create Consul client
|
||||
|
|
|
@ -122,7 +122,7 @@ func (s *Etcd) Get(key string) (pair *store.KVPair, err error) {
|
|||
if err != nil {
|
||||
if etcdError, ok := err.(*etcd.EtcdError); ok {
|
||||
// Not a Directory or Not a file
|
||||
if etcdError.ErrorCode == 102 || etcdError.ErrorCode == 104 {
|
||||
if etcdError.ErrorCode == 100 || etcdError.ErrorCode == 102 || etcdError.ErrorCode == 104 {
|
||||
return nil, store.ErrKeyNotFound
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue