From 02cdf5f81597e9bfb150eb70d0d15864ab106f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Wed, 13 Dec 2023 17:45:17 +0100 Subject: [PATCH] Fix archive path --- glue/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/glue/main.go b/glue/main.go index 02bb9a5..3861205 100644 --- a/glue/main.go +++ b/glue/main.go @@ -8,6 +8,7 @@ import ( "net/http" "os" "os/exec" + "path" "strings" "time" @@ -220,8 +221,10 @@ func (p *Processor) volumeFromURL(url string, container *docker.Container) error } // Download the archive + archivePath := path.Join(volumePath, "archive.tar.zst") + log.Printf("%s: downloading archive from %s\n", container.App.Name, url) - f, err := os.Create(volumePath + "/archive.tar.zst") + f, err := os.Create(archivePath) if err != nil { return fmt.Errorf("failed to create archive file: %v", err) } @@ -243,7 +246,7 @@ func (p *Processor) volumeFromURL(url string, container *docker.Container) error log.Printf("%s: extracting archive\n", container.App.Name) // Call tar xf archive.tar.zst -C /volume - cmd := exec.Command("tar", "-xf", "archive.tar.zst", "-C", volumePath) + cmd := exec.Command("tar", "-xf", archivePath, "-C", volumePath) err = cmd.Run() if err != nil { log.Printf("%s: failed to extract archive: %v", container.App.Name, err)