Skip to content

Commit 12bd81a

Browse files
committed
actions/overlay: Check source exists during recipe verification
If an overlay coming from the recipe directory doesn't exist, the recipe exits during execution. Let's check early if the overlay exists on the host filesystem. Signed-off-by: Christopher Obbard <[email protected]>
1 parent a95ed84 commit 12bd81a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

actions/overlay_action.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ package actions
2626

2727
import (
2828
"fmt"
29+
"os"
2930
"path"
3031

3132
"github.com/go-debos/debos"
@@ -42,6 +43,13 @@ func (overlay *OverlayAction) Verify(context *debos.DebosContext) error {
4243
if _, err := debos.RestrictedPath(context.Rootdir, overlay.Destination); err != nil {
4344
return err
4445
}
46+
47+
if len(overlay.Origin) == 0 {
48+
if _, err := os.Stat(overlay.Source); err != nil {
49+
return err
50+
}
51+
}
52+
4553
return nil
4654
}
4755

0 commit comments

Comments
 (0)