Skip to content

Commit

Permalink
refactor: 修改查询helm chart列表去除语言化版本校验
Browse files Browse the repository at this point in the history
  • Loading branch information
11010 committed Aug 10, 2022
1 parent c318a71 commit 697608a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/utils/search_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (o *SearchRepoOptions) applyConstraint(res []*search.Result) ([]*search.Res
return res, nil
}

constraint, err := semver.NewConstraint(o.version)
_, err := semver.NewConstraint(o.version)
if err != nil {
return res, errors.Wrap(err, "an invalid version/constraint format")
}
Expand All @@ -92,12 +92,9 @@ func (o *SearchRepoOptions) applyConstraint(res []*search.Result) ([]*search.Res
if _, found := foundNames[r.Name]; found {
continue
}
v, err := semver.NewVersion(r.Chart.Version)
if err != nil || constraint.Check(v) {
data = append(data, r)
if !o.versions {
foundNames[r.Name] = true // If user hasn't requested all versions, only show the latest that matches
}
data = append(data, r)
if !o.versions {
foundNames[r.Name] = true // If user hasn't requested all versions, only show the latest that matches
}
}

Expand Down

0 comments on commit 697608a

Please sign in to comment.