Use tar instead of archive
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Adam Štrauch 2022-07-22 19:47:59 +02:00
parent 0ea302d688
commit 37d884e665
Signed by: cx
GPG key ID: 018304FFA8988F8D

View file

@ -6,6 +6,7 @@ import (
"fmt"
"log"
"os"
"os/exec"
"path"
"strings"
"time"
@ -123,18 +124,6 @@ func (s *SnapshotProcessor) metadataForSnapshotKey(snapshotKey string) (Snapshot
// Returns key under which is the snapshot stored and/or error if there is any.
// Metadata about the snapshot are stored in extra object under metadata/ prefix.
func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (string, error) {
// Create an archive
archive := archiver.TarZstd{
Tar: &archiver.Tar{
MkdirAll: true,
ContinueOnError: true,
OverwriteExisting: false,
ImplicitTopLevelFolder: false,
},
// CompressionLevel: 6,
// SelectiveCompression: true,
}
snapshot := Snapshot{
UUID: uuid.NewV4().String(),
AppName: appName,
@ -149,7 +138,7 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
return snapshot.KeyName(s.IndexLabel), fmt.Errorf("change working directory error: %v", err)
}
err = archive.Archive([]string{"./"}, tmpSnapshotArchivePath)
err = exec.Command("/usr/bin/tar", "-acvf", tmpSnapshotArchivePath, "./").Run()
if err != nil {
return snapshot.KeyName(s.IndexLabel), fmt.Errorf("compression error: %v", err)
}