Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Bring exact version check logic from IndexFile.Get into registry tag …
Browse files Browse the repository at this point in the history
…check

Signed-off-by: Scott Rigby <scott@r6by.com>
  • Loading branch information
scottrigby committed Jan 12, 2022
1 parent 1a9cb93 commit bd754a0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/experimental/registry/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ func GetTagMatchingVersionOrConstraint(tags []string, versionString string) (str
// If string is empty, set wildcard constraint
constraint, _ = semver.NewConstraint("*")
} else {
// when customer input exact version, check whether have exact match
// one first
for _, v := range tags {
if versionString == v {
return v, nil
}
}

// Otherwise set constraint to the string given
var err error
constraint, err = semver.NewConstraint(versionString)
Expand Down

0 comments on commit bd754a0

Please sign in to comment.