mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +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
|
var nodes []PeerNode
|
||||||
for itemClusterAddr, item := range c.clusterPeerClusterAddrsCache.Items() {
|
for itemClusterAddr, item := range c.clusterPeerClusterAddrsCache.Items() {
|
||||||
info := item.Object.(nodeHAConnectionInfo)
|
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{
|
nodes = append(nodes, PeerNode{
|
||||||
Hostname: info.nodeInfo.Hostname,
|
Hostname: hostname,
|
||||||
APIAddress: info.nodeInfo.ApiAddr,
|
APIAddress: apiAddr,
|
||||||
ClusterAddress: itemClusterAddr,
|
ClusterAddress: itemClusterAddr,
|
||||||
LastEcho: info.lastHeartbeat,
|
LastEcho: info.lastHeartbeat,
|
||||||
Version: info.version,
|
Version: info.version,
|
||||||
|
|||||||
Reference in New Issue
Block a user