[lxc-devel] [lxd/master] api: Identify snapshots when listed
monstermunchkin on Github
lxc-bot at linuxcontainers.org
Sun Sep 16 18:49:22 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 355 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180916/2ad3d2e5/attachment.bin>
-------------- next part --------------
From 0bf73c15cc933213fd7d1aedd536966f175a8c82 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Wed, 12 Sep 2018 15:30:28 +0200
Subject: [PATCH] api: Identify snapshots when listed
Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
lxd/storage_volumes.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lxd/storage_volumes.go b/lxd/storage_volumes.go
index c849ce6618..2dad1fd0d0 100644
--- a/lxd/storage_volumes.go
+++ b/lxd/storage_volumes.go
@@ -84,6 +84,10 @@ func storagePoolVolumesGet(d *Daemon, r *http.Request) Response {
return InternalError(err)
}
volume.UsedBy = volumeUsedBy
+
+ if strings.Contains(volume.Name, "/") {
+ volume.Type = fmt.Sprintf("%s (snapshot)", volume.Type)
+ }
}
}
More information about the lxc-devel
mailing list