diff --git a/pkg/resolution/resolver/bundle/bundle.go b/pkg/resolution/resolver/bundle/bundle.go index 6a956bf2f8f..961b5201dda 100644 --- a/pkg/resolution/resolver/bundle/bundle.go +++ b/pkg/resolution/resolver/bundle/bundle.go @@ -109,7 +109,7 @@ func GetEntry(ctx context.Context, keychain authn.Keychain, opts RequestOptions) lKind := l.Annotations[BundleAnnotationKind] lName := l.Annotations[BundleAnnotationName] - if opts.Kind == lKind && opts.EntryName == lName { + if strings.ToLower(opts.Kind) == strings.ToLower(lKind) && opts.EntryName == lName { obj, err := readTarLayer(layerMap[l.Digest.String()]) if err != nil { // This could still be a raw layer so try to read it as that instead. diff --git a/pkg/resolution/resolver/bundle/resolver_test.go b/pkg/resolution/resolver/bundle/resolver_test.go index b8b0cbc34f0..f898c68d767 100644 --- a/pkg/resolution/resolver/bundle/resolver_test.go +++ b/pkg/resolution/resolver/bundle/resolver_test.go @@ -191,6 +191,7 @@ type params struct { bundle string name string kind string + expectedKind string } func TestResolve(t *testing.T) { @@ -295,6 +296,16 @@ func TestResolve(t *testing.T) { }, imageName: "single-task", expectedStatus: internal.CreateResolutionRequestStatusWithData(taskAsYAML), + }, { + name: "single task: kind is capitalized", + args: ¶ms{ + bundle: fmt.Sprintf("%s@%s:%s", testImages["single-task"].uri, testImages["single-task"].algo, testImages["single-task"].hex), + name: "example-task", + kind: "Task", + expectedKind: "task", + }, + imageName: "single-task", + expectedStatus: internal.CreateResolutionRequestStatusWithData(taskAsYAML), }, { name: "single task: tag is included in the bundle parameter", args: ¶ms{ @@ -419,9 +430,12 @@ func TestResolve(t *testing.T) { expectedStatus.Annotations = make(map[string]string) } - if tc.args.kind != "" { + switch { + case tc.args.expectedKind != "": + expectedStatus.Annotations[ResolverAnnotationKind] = tc.args.expectedKind + case tc.args.kind != "": expectedStatus.Annotations[ResolverAnnotationKind] = tc.args.kind - } else { + default: expectedStatus.Annotations[ResolverAnnotationKind] = "task" }