diff --git a/libnetwork/internal/kvstore/boltdb/boltdb.go b/libnetwork/internal/kvstore/boltdb/boltdb.go index a2f8e1f87d..a9213f1090 100644 --- a/libnetwork/internal/kvstore/boltdb/boltdb.go +++ b/libnetwork/internal/kvstore/boltdb/boltdb.go @@ -21,8 +21,6 @@ var ( ErrBoltBucketNotFound = errors.New("boltdb bucket doesn't exist") // ErrBoltBucketOptionMissing is thrown when boltBcuket config option is missing ErrBoltBucketOptionMissing = errors.New("boltBucket config option missing") - // ErrBoltAPIUnsupported is thrown when an APIs unsupported by BoltDB backend is called - ErrBoltAPIUnsupported = errors.New("API not supported by BoltDB backend") ) //BoltDB type implements the Store interface @@ -313,15 +311,15 @@ func (b *BoltDB) DeleteTree(keyPrefix string) error { // NewLock has to implemented at the library level since its not supported by BoltDB func (b *BoltDB) NewLock(key string, options *store.LockOptions) (store.Locker, error) { - return nil, ErrBoltAPIUnsupported + return nil, store.ErrCallNotSupported } // Watch has to implemented at the library level since its not supported by BoltDB func (b *BoltDB) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error) { - return nil, ErrBoltAPIUnsupported + return nil, store.ErrCallNotSupported } // WatchTree has to implemented at the library level since its not supported by BoltDB func (b *BoltDB) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error) { - return nil, ErrBoltAPIUnsupported + return nil, store.ErrCallNotSupported } diff --git a/libnetwork/internal/kvstore/kvstore.go b/libnetwork/internal/kvstore/kvstore.go index 1efeb8e44a..06889e5468 100644 --- a/libnetwork/internal/kvstore/kvstore.go +++ b/libnetwork/internal/kvstore/kvstore.go @@ -21,10 +21,10 @@ const ( ) var ( - // ErrNotSupported is thrown when the backend k/v store is not supported by libkv - ErrNotSupported = errors.New("Backend storage not supported yet, please choose one of") - // ErrNotImplemented is thrown when a method is not implemented by the current backend - ErrNotImplemented = errors.New("Call not implemented in current backend") + // ErrBackendNotSupported is thrown when the backend k/v store is not supported by libkv + ErrBackendNotSupported = errors.New("Backend storage not supported yet, please choose one of") + // ErrCallNotSupported is thrown when a method is not implemented/supported by the current backend + ErrCallNotSupported = errors.New("The current call is not supported with this backend") // ErrNotReachable is thrown when the API cannot be reached for issuing common store operations ErrNotReachable = errors.New("Api not reachable") // ErrCannotLock is thrown when there is an error acquiring a lock on a key diff --git a/libnetwork/internal/kvstore/kvstore_manage.go b/libnetwork/internal/kvstore/kvstore_manage.go index 7b3d0584ba..579728807e 100644 --- a/libnetwork/internal/kvstore/kvstore_manage.go +++ b/libnetwork/internal/kvstore/kvstore_manage.go @@ -92,7 +92,7 @@ func NewStore(backend store.Backend, addrs []string, options *store.Config) (sto return init(addrs, options) } - return nil, fmt.Errorf("%s %s", store.ErrNotSupported.Error(), supportedBackend) + return nil, fmt.Errorf("%s %s", store.ErrBackendNotSupported.Error(), supportedBackend) } // AddStore adds a new store backend to libkv