diff --git a/cmd/helm/search/search.go b/cmd/helm/search/search.go index a24208a4b4a3001710e19114b0d73436d74c4a4a..6c4cb4aa48b4f1a492d63501b8fdce21a48d3709 100644 --- a/cmd/helm/search/search.go +++ b/cmd/helm/search/search.go @@ -146,11 +146,11 @@ func (i *Index) SearchLiteral(term string, threshold int) []*Result { term = strings.ToLower(term) buf := []*Result{} for k, v := range i.lines { - k = strings.ToLower(k) - v = strings.ToLower(v) - res := strings.Index(v, term) - if score := i.calcScore(res, v); res != -1 && score < threshold { - parts := strings.Split(k, verSep) // Remove version, if it is there. + lk := strings.ToLower(k) + lv := strings.ToLower(v) + res := strings.Index(lv, term) + if score := i.calcScore(res, lv); res != -1 && score < threshold { + parts := strings.Split(lk, verSep) // Remove version, if it is there. buf = append(buf, &Result{Name: parts[0], Score: score, Chart: i.charts[k]}) } } diff --git a/cmd/helm/search/search_test.go b/cmd/helm/search/search_test.go index 949cf7be7861b9ba29ee4a921cf8c7a9f0363c6b..574f55448a493c2915d020a8e11911c4a0f65664 100644 --- a/cmd/helm/search/search_test.go +++ b/cmd/helm/search/search_test.go @@ -91,10 +91,10 @@ var indexfileEntries = map[string]repo.ChartVersions{ }, }, { - URLs: []string{"http://example.com/charts/santa-maria-1.2.2.tgz"}, + URLs: []string{"http://example.com/charts/santa-maria-1.2.2-rc-1.tgz"}, Metadata: &chart.Metadata{ Name: "santa-maria", - Version: "1.2.2", + Version: "1.2.2-RC-1", Description: "Three boat", }, },