explicitly fail if no images are found when running remote tests

The previous implementation succeeds if no images are run. This causes
silent failures when image matchers are provided that do not match any image.
This commit is contained in:
Morgan Bauer
2020-05-26 14:08:27 -07:00
parent a79c711191
commit 58924c2de5

View File

@@ -244,6 +244,10 @@ func main() {
klog.Fatalf("Could not retrieve list of images based on image prefix %q and family %q: %v",
imageConfig.ImageRegex, imageConfig.ImageFamily, err)
}
if len(images) == 0 { // if we have no images we can't run anything
klog.Fatalf("No matching images retrieved on image prefix %q and family %q: %v",
imageConfig.ImageRegex, imageConfig.ImageFamily, err)
}
} else {
images = []string{imageConfig.Image}
}