From a2c60220107f6cdc2f4f5556c64330bad2612f61 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 4 Apr 2019 17:27:13 -0400 Subject: [PATCH] Update kv dep --- .../hashicorp/vault-plugin-secrets-kv/upgrade.go | 12 ++++++++---- vendor/vendor.json | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-kv/upgrade.go b/vendor/github.com/hashicorp/vault-plugin-secrets-kv/upgrade.go index ddb31d58f..2d2d5bfc1 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-kv/upgrade.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-kv/upgrade.go @@ -273,6 +273,14 @@ func (b *versionedKVBackend) Upgrade(ctx context.Context, s logical.Storage) err b.Logger().Info("upgrading keys finished") + // We do this now so that we ensure it's written by the primary before + // secondaries unblock + b.l.Lock() + if _, err = b.policy(ctx, s); err != nil { + b.Logger().Error("error checking/creating policy after upgrade", "error", err) + } + b.l.Unlock() + // Write upgrade done value upgradeInfo.Done = true info, err := proto.Marshal(upgradeInfo) @@ -288,10 +296,6 @@ func (b *versionedKVBackend) Upgrade(ctx context.Context, s logical.Storage) err b.Logger().Error("writing upgrade done resulted in an error", "error", err) } - if _, err = b.policy(ctx, s); err != nil { - b.Logger().Error("error checking/creating policy after upgrade", "error", err) - } - atomic.StoreUint32(b.upgrading, 0) }() diff --git a/vendor/vendor.json b/vendor/vendor.json index 99a3b06e8..260fbedc5 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1463,10 +1463,10 @@ "revisionTime": "2019-03-20T21:33:25Z" }, { - "checksumSHA1": "A8tsACuzNEX1vbMj08xOo34gXPA=", + "checksumSHA1": "489Mmb5wg9htQYN9+IdfJZ6i378=", "path": "github.com/hashicorp/vault-plugin-secrets-kv", - "revision": "79cbd437d5729b3363170e52072d36476f6e7db7", - "revisionTime": "2019-04-04T20:53:28Z" + "revision": "4807e6564154e2b4aba2cbc8e2707e68f384c5ab", + "revisionTime": "2019-04-04T21:26:40Z" }, { "checksumSHA1": "ldkAQ1CpiAaQ9sti0qIch+UyRsI=",