Skip to content

Commit

Permalink
resolves #144 (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankie G-J authored Mar 29, 2021
1 parent 9b65445 commit b3dad1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cargo/jam/internal/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func FindLatestImage(uri string) (Image, error) {
if err != nil {
continue
}
if version.Prerelease() != "" {
continue
}

versions = append(versions, version)
}
Expand Down
5 changes: 3 additions & 2 deletions cargo/jam/internal/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func testImage(t *testing.T, context spec.G, it spec.S) {
"0.20.1",
"0.20.12",
"999999",
"latest"
"latest",
"0.20.13-rc1"
]
}`)

Expand Down Expand Up @@ -80,7 +81,7 @@ func testImage(t *testing.T, context spec.G, it spec.S) {
Expect(os.RemoveAll(dockerConfig)).To(Succeed())
})

it("returns the latest semver tag for the given image uri", func() {
it("returns the latest non-prerelease semver tag for the given image uri", func() {
image, err := internal.FindLatestImage(fmt.Sprintf("%s/some-org/some-repo:latest", strings.TrimPrefix(server.URL, "http://")))
Expect(err).NotTo(HaveOccurred())
Expect(image).To(Equal(internal.Image{
Expand Down

0 comments on commit b3dad1d

Please sign in to comment.