Skip to content

Commit 5f99430

Browse files
authored
Fix a panic when reading annotations if the bundle is not there (#255)
If the bundle is not present, the current bundleLoader will panic when it gets to addChannelsFromAnnotationsFile. If the bundle is nil, addChannelsFromAnnotationsFile should not attempt to do anything so instead it just returns now. Signed-off-by: Brad P. Crochet <[email protected]> Signed-off-by: Brad P. Crochet <[email protected]>
1 parent ae4da2a commit 5f99430

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/manifests/bundleloader.go

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ func (b *bundleLoader) LoadBundle() error {
5151

5252
// Add values from the annotations when the values are not loaded
5353
func (b *bundleLoader) addChannelsFromAnnotationsFile() {
54+
if b.bundle == nil {
55+
// None of this is relevant if the bundle was not found
56+
return
57+
}
5458
// Note that they will not get load for Bundle Format directories
5559
// and PackageManifest should not have the annotationsFile. However,
5660
// the following check to ensure that channels and default channels

0 commit comments

Comments
 (0)