Skip to content

Commit b3dad1d

Browse files
author
Frankie G-J
authored
resolves #144 (#145)
1 parent 9b65445 commit b3dad1d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cargo/jam/internal/image.go

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ func FindLatestImage(uri string) (Image, error) {
4545
if err != nil {
4646
continue
4747
}
48+
if version.Prerelease() != "" {
49+
continue
50+
}
4851

4952
versions = append(versions, version)
5053
}

cargo/jam/internal/image_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ func testImage(t *testing.T, context spec.G, it spec.S) {
4444
"0.20.1",
4545
"0.20.12",
4646
"999999",
47-
"latest"
47+
"latest",
48+
"0.20.13-rc1"
4849
]
4950
}`)
5051

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

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

0 commit comments

Comments
 (0)