Skip to content

Commit 9872aa7

Browse files
committed
Bundle validation will not fail if default channel is not provided
Default channel annotation is now optional. It is only needed if there is an intention to update default channel in the index. As a result, bundle validation will allow default channel annotation to be missing. Signed-off-by: Vu Dinh <[email protected]>
1 parent e8dbb71 commit 9872aa7

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)