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

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) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 88e97effbd247c1efbca563b33288eacb02adda6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Fri, 11 Dec 2020 16:08:30 -0500
Subject: [PATCH] lxd/backup: Fix URL in lifecycle events
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/backup/backup_utils.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lxd/backup/backup_utils.go b/lxd/backup/backup_utils.go
index 3b3d39cb35..d2d2924f62 100644
--- a/lxd/backup/backup_utils.go
+++ b/lxd/backup/backup_utils.go
@@ -34,8 +34,10 @@ func TarReader(r io.ReadSeeker) (*tar.Reader, 
context.CancelFunc, error) {
 
 // Lifecycle emits a backup-specific lifecycle event.
 func Lifecycle(s *state.State, inst Instance, name string, action string, ctx 
map[string]interface{}) error {
+       _, backupName, _ := shared.InstanceGetParentAndSnapshotName(name)
+
        prefix := "instance-backup"
-       u := fmt.Sprintf("/1.0/instances/%s/backups/%s", 
url.PathEscape(inst.Name()), url.PathEscape(name))
+       u := fmt.Sprintf("/1.0/instances/%s/backups/%s", 
url.PathEscape(inst.Name()), url.PathEscape(backupName))
 
        if inst.Project() != project.Default {
                u = fmt.Sprintf("%s?project=%s", u, 
url.QueryEscape(inst.Project()))
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to