Skip to content

Commit

Permalink
Fix a panic when reading annotations if the bundle is not there (#255)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bcrochet authored Aug 23, 2022
1 parent ae4da2a commit 5f99430
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/manifests/bundleloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (b *bundleLoader) LoadBundle() error {

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

0 comments on commit 5f99430

Please sign in to comment.