The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6977

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Attempting to patch the cluster.http_address if it's not set isn't
being checked if there is an error loading the configuration or
patching the value.

Signed-off-by: Simon Richardson <simon.richard...@canonical.com>
From 933574fe287d97a1e93939ec8822a45830997295 Mon Sep 17 00:00:00 2001
From: Simon Richardson <stickup...@gmail.com>
Date: Wed, 4 Mar 2020 20:40:12 +0000
Subject: [PATCH] Missing bootstrap error check

Attempting to patch the cluster.http_address if it's not set isn't
being checked if there is an error loading the configuration or
patching the value.

Signed-off-by: Simon Richardson <simon.richard...@canonical.com>
---
 lxd/api_cluster.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lxd/api_cluster.go b/lxd/api_cluster.go
index 8829745e7d..2a668faab1 100644
--- a/lxd/api_cluster.go
+++ b/lxd/api_cluster.go
@@ -234,7 +234,7 @@ func clusterPutBootstrap(d *Daemon, req api.ClusterPut) 
response.Response {
 
        // If there's no cluster.https_address set, but core.https_address is,
        // let's default to it.
-       d.db.Transaction(func(tx *db.NodeTx) error {
+       err := d.db.Transaction(func(tx *db.NodeTx) error {
                config, err := node.ConfigLoad(tx)
                if err != nil {
                        return errors.Wrap(err, "Failed to fetch member 
configuration")
@@ -256,6 +256,9 @@ func clusterPutBootstrap(d *Daemon, req api.ClusterPut) 
response.Response {
 
                return nil
        })
+       if err != nil {
+               return response.SmartError(err)
+       }
 
        op, err := operations.OperationCreate(d.State(), "", 
operations.OperationClassTask, db.OperationClusterBootstrap, resources, nil, 
run, nil, nil)
        if err != nil {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to