Skip to content

Commit

Permalink
compress image tar files
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Apr 2, 2023
1 parent 29cbf86 commit 0c3e82b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion magefiles/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import (
"io"
"os"
"path/filepath"
"strings"

"github.com/google/go-containerregistry/pkg/crane"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/magefile/mage/sh"
)

func fixtureContainerImages() error {
Expand All @@ -33,7 +35,11 @@ func fixtureContainerImages() error {
if err != nil {
return err
}
if err = crane.Save(img, tag, filePath); err != nil {
tarPath := strings.TrimSuffix(filePath, ".gz")
if err = crane.Save(img, tag, tarPath); err != nil {
return err
}
if err = sh.Run("gzip", tarPath); err != nil {
return err
}
}
Expand Down

0 comments on commit 0c3e82b

Please sign in to comment.