[lxc-devel] [lxd/master] lxc/remote: Tweak remote list

stgraber on Github lxc-bot at linuxcontainers.org
Sun Feb 17 02:37:05 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/20190216/949ac5fb/attachment.bin>
-------------- next part --------------
From 817f196eb9c5ffdd5cf00160fd1b2bdda9547f1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 16 Feb 2019 21:36:38 -0500
Subject: [PATCH] lxc/remote: Tweak remote list
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>
---
 lxc/remote.go | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lxc/remote.go b/lxc/remote.go
index ebaa3d2007..6bc6417103 100644
--- a/lxc/remote.go
+++ b/lxc/remote.go
@@ -452,8 +452,19 @@ func (c *cmdRemoteList) Run(cmd *cobra.Command, args []string) error {
 		if rc.Protocol == "" {
 			rc.Protocol = "lxd"
 		}
-		if rc.AuthType == "" && !rc.Public {
-			rc.AuthType = "tls"
+
+		if rc.AuthType == "" {
+			if strings.HasPrefix(rc.Addr, "unix:") {
+				rc.AuthType = "file access"
+			} else if rc.Protocol == "simplestreams" {
+				rc.AuthType = "none"
+			} else {
+				rc.AuthType = "tls"
+			}
+		}
+
+		if rc.AuthType == "candid" && rc.Domain != "" {
+			rc.AuthType = fmt.Sprintf("%s (%s)", rc.AuthType, rc.Domain)
 		}
 
 		strName := name


More information about the lxc-devel mailing list