From bcec7e6279f2ea071d726f437826fd471d2c77a4 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 15 Feb 2024 14:45:42 +0100 Subject: [PATCH] machine: ocipull do not error if downloaddir exists If users cancel the image download with CTRL-C for example then the blob dir will stay around. The next time we run the download we should just start the download again and not complain about the existing directory. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger --- pkg/machine/ocipull/pull.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/machine/ocipull/pull.go b/pkg/machine/ocipull/pull.go index 16c2d09543..e484964da7 100644 --- a/pkg/machine/ocipull/pull.go +++ b/pkg/machine/ocipull/pull.go @@ -28,10 +28,6 @@ type PullOptions struct { // Pull `imageInput` from a container registry to `sourcePath`. func Pull(ctx context.Context, imageInput types.ImageReference, localDestPath *define.VMFile, options *PullOptions) error { - if _, err := os.Stat(localDestPath.GetPath()); err == nil { - return fmt.Errorf("%q already exists", localDestPath.GetPath()) - } - destRef, err := layout.ParseReference(localDestPath.GetPath()) if err != nil { return err