mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 03:58:01 +00:00
Do not attempt to write a new TLS keyring at startup if raft is already setup (#17079)
This commit is contained in:
2
changelog/17079.txt
Normal file
2
changelog/17079.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
```release-note:bug
|
||||||
|
storage/raft: Fix error writing raft TLS keyring during follower joins
|
||||||
@@ -73,14 +73,15 @@ func (c *Core) startRaftBackend(ctx context.Context) (retErr error) {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var creating bool
|
||||||
|
var raftTLS *raft.TLSKeyring
|
||||||
|
if !raftBackend.Initialized() {
|
||||||
// Retrieve the raft TLS information
|
// Retrieve the raft TLS information
|
||||||
raftTLSEntry, err := c.barrier.Get(ctx, raftTLSStoragePath)
|
raftTLSEntry, err := c.barrier.Get(ctx, raftTLSStoragePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var creating bool
|
|
||||||
var raftTLS *raft.TLSKeyring
|
|
||||||
switch raftTLSEntry {
|
switch raftTLSEntry {
|
||||||
case nil:
|
case nil:
|
||||||
// If this is HA-only and no TLS keyring is found, that means the
|
// If this is HA-only and no TLS keyring is found, that means the
|
||||||
@@ -140,6 +141,7 @@ func (c *Core) startRaftBackend(ctx context.Context) (retErr error) {
|
|||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if retErr != nil {
|
if retErr != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user