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

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) ===
This transitions "images:" from "lxd" to "simplestreams"

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From c2f1ce55c9048e80860beaf3424c5a2f8f86431f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@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 <stgra...@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
 }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to