[lxc-devel] [lxd/master] client: Ignore unresolvable addresses

stgraber on Github lxc-bot at linuxcontainers.org
Fri Oct 25 18:35:28 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191025/7e9e2c70/attachment.bin>
-------------- next part --------------
From 473fb518b10a0e76ecedfcc1d71d9746dc81cb07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 25 Oct 2019 14:35:12 -0400
Subject: [PATCH] client: Ignore unresolvable addresses
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/client/lxd.go b/client/lxd.go
index 06feece85f..02cf92b3fb 100644
--- a/client/lxd.go
+++ b/client/lxd.go
@@ -61,6 +61,10 @@ func (r *ProtocolLXD) GetConnectionInfo() (*ConnectionInfo, error) {
 
 	if r.server != nil && len(r.server.Environment.Addresses) > 0 {
 		for _, addr := range r.server.Environment.Addresses {
+			if strings.HasPrefix(addr, ":") {
+				continue
+			}
+
 			url := fmt.Sprintf("https://%s", addr)
 			if !shared.StringInSlice(url, urls) {
 				urls = append(urls, url)


More information about the lxc-devel mailing list