Skip to content

Commit f537b93

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 29b7a69 commit f537b93

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pkg/manifests/csv.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: packageserver
66
namespace: openshift-operator-lifecycle-manager
77
labels:
8-
olm.version: 0.0.0-7829ec69880557119c98ba10ad52cb9264e4f278
8+
olm.version: 0.0.0-a87009eda5ab6baceb10a162bd7950bbefc16cf3
99
olm.clusteroperator.name: operator-lifecycle-manager-packageserver
1010
annotations:
1111
include.release.openshift.io/self-managed-high-availability: "true"
@@ -159,7 +159,7 @@ spec:
159159
- packageserver
160160
topologyKey: "kubernetes.io/hostname"
161161
maturity: alpha
162-
version: 0.0.0-7829ec69880557119c98ba10ad52cb9264e4f278
162+
version: 0.0.0-a87009eda5ab6baceb10a162bd7950bbefc16cf3
163163
apiservicedefinitions:
164164
owned:
165165
- group: packages.operators.coreos.com

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)