Skip to content

Commit ce6e2b5

Browse files
bcrochettmshort
authored andcommitted
Fix a panic when reading annotations if the bundle is not there (openshift#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]> Upstream-repository: api Upstream-commit: 5f99430d4ec47d59daafa3b818229f0466531dea
1 parent 2e352e7 commit ce6e2b5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

staging/api/pkg/manifests/bundleloader.go

Lines changed: 4 additions & 0 deletions
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

vendor/github.com/operator-framework/api/pkg/manifests/bundleloader.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)