The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/5481
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: Thomas Hipp <thomas.h...@canonical.com>
From 3b96180082594fbcdf9d66658b9ed31e00de972a Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Mon, 11 Feb 2019 09:33:52 +0100 Subject: [PATCH] lxd: Fix snapshot expiry for scheduled snapshots Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- lxd/container.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lxd/container.go b/lxd/container.go index 066d959169..1a04aa1874 100644 --- a/lxd/container.go +++ b/lxd/container.go @@ -1635,6 +1635,12 @@ func autoCreateContainerSnapshots(ctx context.Context, d *Daemon, containers []c snapshotName = fmt.Sprintf("%s%s%s", c.Name(), shared.SnapshotDelimiter, snapshotName) + expiry, err := shared.GetSnapshotExpiry(time.Now(), c.LocalConfig()["snapshots.expiry"]) + if err != nil { + logger.Error("Error getting expiry date", log.Ctx{"err": err, "container": c}) + return + } + args := db.ContainerArgs{ Architecture: c.Architecture(), Config: c.LocalConfig(), @@ -1645,6 +1651,7 @@ func autoCreateContainerSnapshots(ctx context.Context, d *Daemon, containers []c Profiles: c.Profiles(), Project: c.Project(), Stateful: false, + ExpiryDate: expiry, } _, err = containerCreateAsSnapshot(d.State(), args, c)
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel