From 96071cdfcb675cfb65126342a62c82b0b7b2a9a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Fri, 22 Jul 2022 19:49:37 +0200 Subject: [PATCH] Use tar to restore instead of archiver --- apps/snapshots.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/snapshots.go b/apps/snapshots.go index 873f873..9de1df9 100644 --- a/apps/snapshots.go +++ b/apps/snapshots.go @@ -11,7 +11,6 @@ import ( "strings" "time" - "github.com/mholt/archiver/v3" "github.com/rosti-cz/node-api/apps/drivers" uuid "github.com/satori/go.uuid" ) @@ -138,7 +137,7 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str return snapshot.KeyName(s.IndexLabel), fmt.Errorf("change working directory error: %v", err) } - err = exec.Command("/usr/bin/tar", "-acvf", tmpSnapshotArchivePath, "./").Run() + err = exec.Command("/usr/bin/tar", "-acf", tmpSnapshotArchivePath, "./").Run() if err != nil { return snapshot.KeyName(s.IndexLabel), fmt.Errorf("compression error: %v", err) } @@ -192,18 +191,7 @@ func (s *SnapshotProcessor) RestoreSnapshot(key string, newAppName string) error return fmt.Errorf("getting the archive from S3 error: %v", err) } - archive := archiver.TarZstd{ - Tar: &archiver.Tar{ - MkdirAll: true, - ContinueOnError: true, - OverwriteExisting: false, - ImplicitTopLevelFolder: false, - }, - // CompressionLevel: 6, - // SelectiveCompression: true, - } - - err = archive.Unarchive(tmpSnapshotArchivePath, "./") + err = exec.Command("/usr/bin/tar", "-axf", tmpSnapshotArchivePath).Run() if err != nil { return fmt.Errorf("unarchiving error: %v", err) }