aboutsummaryrefslogtreecommitdiff
path: root/server/wkfs/vaultfs/vault.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-10-16 16:47:09 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-10-17 12:39:09 +0100
commita427038700c0f1c080090a8158c1a793923aa03c (patch)
tree1309e201063f16e75266e571ea1733ce5eb49ce5 /server/wkfs/vaultfs/vault.go
parentd6d54ed0bcf3b583fe681db790740cef137401d3 (diff)
Unmarshal the config using mapstructure directly.
Avoid unmarshalling into an intermediate struct. Better tests.
Diffstat (limited to 'server/wkfs/vaultfs/vault.go')
-rw-r--r--server/wkfs/vaultfs/vault.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/wkfs/vaultfs/vault.go b/server/wkfs/vaultfs/vault.go
index 6f11057..f7c1360 100644
--- a/server/wkfs/vaultfs/vault.go
+++ b/server/wkfs/vaultfs/vault.go
@@ -14,6 +14,10 @@ import (
// Register the /vault/ filesystem as a well-known filesystem.
func Register(vc *config.Vault) {
+ if vc == nil {
+ registerBrokenFS(errors.New("no vault configuration found"))
+ return
+ }
client, err := vault.NewClient(vc.Address, vc.Token)
if err != nil {
registerBrokenFS(err)