[lxc-devel] [lxd/master] lxc: Re-introduce remote protocol migration

stgraber on Github lxc-bot at linuxcontainers.org
Thu Aug 10 16:24:59 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 414 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170810/d521dddd/attachment.bin>
-------------- next part --------------
From c2f1ce55c9048e80860beaf3424c5a2f8f86431f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 10 Aug 2017 12:24:01 -0400
Subject: [PATCH] lxc: Re-introduce remote protocol migration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This transitions "images:" from "lxd" to "simplestreams"

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

diff --git a/lxc/config/file.go b/lxc/config/file.go
index 716277445..c8539b1c0 100644
--- a/lxc/config/file.go
+++ b/lxc/config/file.go
@@ -38,6 +38,14 @@ func LoadConfig(path string) (*Config, error) {
 		c.Remotes[k] = v
 	}
 
+	// NOTE: Remove this once we only see a small fraction of non-simplestreams users
+	// Upgrade users to the "simplestreams" protocol
+	images, ok := c.Remotes["images"]
+	if ok && images.Protocol != ImagesRemote.Protocol && images.Addr == ImagesRemote.Addr {
+		c.Remotes["images"] = ImagesRemote
+		c.SaveConfig(path)
+	}
+
 	return &c, nil
 }
 


More information about the lxc-devel mailing list