From 564e9ec4f115bf448b98fcaf47403776a862127c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Mon, 1 Nov 2021 21:30:08 +0100 Subject: [PATCH] Remove .chowned file to restore ownership of files when restore from snapshot --- apps/snapshots.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/snapshots.go b/apps/snapshots.go index a98258b..c14cf36 100644 --- a/apps/snapshots.go +++ b/apps/snapshots.go @@ -224,6 +224,12 @@ func (s *SnapshotProcessor) RestoreSnapshot(key string, newAppName string) error return fmt.Errorf("removing the archive error: %v", err) } + // remove .chowned file to tell the container to setup ownership of the files again + err = os.Remove("./.chowned") + if err != nil { + return fmt.Errorf("removing .chowned error: %v", err) + } + return nil }