Skip to content

Commit 5f55ec2

Browse files
Merge pull request #459 from dinhxuanvu/defaulchan-val
Bug 1883329: Bundle validation shouldn't fail if default channel is not provided
2 parents e8dbb71 + 9872aa7 commit 5f55ec2

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pkg/lib/bundle/testdata/validate/invalid_annotations_bundle/metadata/annotations.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
annotations:
2-
operators.operatorframework.io.bundle.channel.default.v1: stable
32
operators.operatorframework.io.bundle.channels.v1: stable,beta
43
operators.operatorframework.io.bundle.manifests.v1: manifests/
54
operators.operatorframework.io.bundle.mediatype.v1: registry+v2

pkg/lib/bundle/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func validateAnnotations(mediaType string, fileAnnotations *AnnotationMetadata)
207207
validationErrors = append(validationErrors, aErr)
208208
}
209209
case ChannelDefaultLabel:
210-
if val == "" {
210+
if ok && val == "" {
211211
aErr := fmt.Errorf("Expecting annotation %q to have non-empty value", label)
212212
validationErrors = append(validationErrors, aErr)
213213
}

0 commit comments

Comments
 (0)