[lxc-devel] [lxd/master] lxd/cluster: Don't prompt for internal config keys

stgraber on Github lxc-bot at linuxcontainers.org
Sun Feb 3 12:26:00 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190203/e41ad7dd/attachment.bin>
-------------- next part --------------
From 6c9151b1307aaeb29d6a8ae1df504ee889b24cce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 3 Feb 2019 13:05:59 +0100
Subject: [PATCH] lxd/cluster: Don't prompt for internal config keys
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #5427

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/api_cluster.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lxd/api_cluster.go b/lxd/api_cluster.go
index d66ecb7d33..99aa60da53 100644
--- a/lxd/api_cluster.go
+++ b/lxd/api_cluster.go
@@ -8,6 +8,7 @@ import (
 	"os"
 	"path/filepath"
 	"strconv"
+	"strings"
 	"time"
 
 	"github.com/CanonicalLtd/go-dqlite"
@@ -118,6 +119,10 @@ func clusterGetMemberConfig(cluster *db.Cluster) ([]api.ClusterMemberConfigKey,
 
 	for pool, config := range pools {
 		for key := range config {
+			if strings.HasPrefix(key, "volatile.") {
+				continue
+			}
+
 			key := api.ClusterMemberConfigKey{
 				Entity:      "storage-pool",
 				Name:        pool,
@@ -130,6 +135,10 @@ func clusterGetMemberConfig(cluster *db.Cluster) ([]api.ClusterMemberConfigKey,
 
 	for network, config := range networks {
 		for key := range config {
+			if strings.HasPrefix(key, "volatile.") {
+				continue
+			}
+
 			key := api.ClusterMemberConfigKey{
 				Entity:      "network",
 				Name:        network,


More information about the lxc-devel mailing list