diff --git a/bindings/resolver.go b/bindings/resolver.go index 24146823..955e2303 100644 --- a/bindings/resolver.go +++ b/bindings/resolver.go @@ -101,8 +101,8 @@ func (r *Resolver) Resolve(typ string, provider string) ([]Binding, error) { var resolved []Binding for _, bind := range r.bindings { - if (strings.ToLower(bind.Type) == strings.ToLower(typ)) && - (provider == "" || strings.ToLower(bind.Provider) == strings.ToLower(provider)) { + if (strings.EqualFold(bind.Type, typ)) && + (provider == "" || strings.EqualFold(bind.Provider, provider)) { resolved = append(resolved, bind) } } diff --git a/bindings/resolver_test.go b/bindings/resolver_test.go index a710ab00..2517d0df 100644 --- a/bindings/resolver_test.go +++ b/bindings/resolver_test.go @@ -288,6 +288,7 @@ func testResolver(t *testing.T, context spec.G, it spec.S) { Expect(err).NotTo(HaveOccurred()) err = os.WriteFile(filepath.Join(bindingRoot, "bad-binding", "type"), []byte("bad-type"), 000) + Expect(err).NotTo(HaveOccurred()) _, err = resolver.Resolve("bad-type", "") Expect(err).To(MatchError(HavePrefix("loading bindings from '%s': open %s: permission denied", bindingRoot, filepath.Join(bindingRoot, "bad-binding", "type"))))