2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

tests: fix permissions error

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2023-02-28 18:10:30 +01:00
committed by Adphi
parent 0c3a736977
commit f7b4861b1d
2 changed files with 5 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ func (i DockerImage) AsRunScript(w io.Writer) error {
}
func NewImage(ctx context.Context, tag string, imageTmpPath string) (*image, error) {
if err := os.MkdirAll(imageTmpPath, perm); err != nil {
if err := os.MkdirAll(imageTmpPath, os.ModePerm); err != nil {
return nil, err
}
// save the image to a tar file to avoid loading it in memory
@@ -110,6 +110,9 @@ type image struct {
}
func (i image) Flatten(ctx context.Context, out string) error {
if err := os.MkdirAll(out, os.ModePerm); err != nil {
return err
}
tar := filepath.Join(i.dir, "img.tar")
f, err := os.Create(tar)
if err != nil {