From 73f57bc6336e98a252dde7b7e82ae9b3307e8f05 Mon Sep 17 00:00:00 2001
From: Anik Bhattacharjee <anikbhattacharya93@gmail.com>
Date: Wed, 18 Nov 2020 16:58:48 -0500
Subject: [PATCH] fix(opm-index-add) Throw error when a bundle is invalid

With the introduction of #503, when a bundle from the list of bundles
being added with the `opm index add` command was invalid, opm was not
throwing an error, and was building the index with the valid bundles
instead, even when the `permissive` mode was not enabled. This PR
fixes the issue.
---
 pkg/registry/input_stream.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/registry/input_stream.go b/pkg/registry/input_stream.go
index 6f8c92b13..3c4a6286e 100644
--- a/pkg/registry/input_stream.go
+++ b/pkg/registry/input_stream.go
@@ -142,7 +142,7 @@ func (r *ReplacesInputStream) Next() (*ImageInput, error) {
 				delete(r.packages, pkg)
 			}
 
-			return image, nil
+			return image, utilerrors.NewAggregate(errs)
 		}
 
 		// No viable bundle found in the package, can't parse it any further