mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 01:32:33 +00:00
VAULT-22569: Handle nil node info when retrieving HA peers (#24441)
* add nil check * changelog * clarify changelog
This commit is contained in:
3
changelog/24441.txt
Normal file
3
changelog/24441.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
core/ha: fix panic that can occur when an HA cluster contains an active node with version >=1.12.0 and another node with version <1.10
|
||||
```
|
||||
@@ -3961,9 +3961,17 @@ func (c *Core) GetHAPeerNodesCached() []PeerNode {
|
||||
var nodes []PeerNode
|
||||
for itemClusterAddr, item := range c.clusterPeerClusterAddrsCache.Items() {
|
||||
info := item.Object.(nodeHAConnectionInfo)
|
||||
var hostname, apiAddr string
|
||||
|
||||
// nodeInfo can be nil if there's a node with a much older version in
|
||||
// the cluster
|
||||
if info.nodeInfo != nil {
|
||||
hostname = info.nodeInfo.Hostname
|
||||
apiAddr = info.nodeInfo.ApiAddr
|
||||
}
|
||||
nodes = append(nodes, PeerNode{
|
||||
Hostname: info.nodeInfo.Hostname,
|
||||
APIAddress: info.nodeInfo.ApiAddr,
|
||||
Hostname: hostname,
|
||||
APIAddress: apiAddr,
|
||||
ClusterAddress: itemClusterAddr,
|
||||
LastEcho: info.lastHeartbeat,
|
||||
Version: info.version,
|
||||
|
||||
Reference in New Issue
Block a user