[lxc-devel] [lxd/master] Use the node ID from the nodes ID table, not the raft one

freeekanayaka on Github lxc-bot at linuxcontainers.org
Thu Nov 21 14:07:16 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191121/76f8725e/attachment.bin>
-------------- next part --------------
From 4eae445fbf871301c5187ce0062aeeb90ea8c98a Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Thu, 21 Nov 2019 14:04:55 +0000
Subject: [PATCH] Use the node ID from the nodes ID table, not the raft one

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 lxd/cluster/membership.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/cluster/membership.go b/lxd/cluster/membership.go
index b8b4456c1f..301a169dbb 100644
--- a/lxd/cluster/membership.go
+++ b/lxd/cluster/membership.go
@@ -650,7 +650,7 @@ func Promote(state *state.State, gateway *Gateway, nodes []db.RaftNode) error {
 
 	// Unlock regular access to our cluster database and add the database role.
 	err = state.Cluster.ExitExclusive(func(tx *db.ClusterTx) error {
-		err = tx.NodeAddRole(id, db.ClusterRoleDatabase)
+		err = tx.NodeAddRole(state.Cluster.GetNodeID(), db.ClusterRoleDatabase)
 		if err != nil {
 			return errors.Wrapf(err, "Failed to add database role for the node")
 		}


More information about the lxc-devel mailing list