summaryrefslogtreecommitdiff
path: root/internal/pipeline
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-01-31 17:09:16 +0000
committerNick White <git@njw.name>2022-01-31 17:09:16 +0000
commit4fae7d93e0c07d5f6fc4c33db389c60d95276d01 (patch)
tree2bd9092764324b7f3927b57338ee9192fe5ec27b /internal/pipeline
parent7fe36a34e661e0ffc4d8cb98733e2f586cac9e8d (diff)
pipeline: Fail if no images are present
Diffstat (limited to 'internal/pipeline')
-rw-r--r--internal/pipeline/put.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/pipeline/put.go b/internal/pipeline/put.go
index 68ad70e..aba9e0e 100644
--- a/internal/pipeline/put.go
+++ b/internal/pipeline/put.go
@@ -51,6 +51,7 @@ func CheckImages(ctx context.Context, dir string) error {
close(checker)
}()
+ n := 0
for path := range checker {
select {
case <-ctx.Done():
@@ -70,6 +71,11 @@ func CheckImages(ctx context.Context, dir string) error {
if err != nil {
return fmt.Errorf("Decoding image %s failed: %v", path, err)
}
+ n++
+ }
+
+ if n == 0 {
+ return fmt.Errorf("No images found")
}
return nil