-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control sorting of image versions #3
Comments
Hmm interesting point. In theory I would expect We use this library to do the sorting. Maybe an issue there would be helpful to clarify the designed logic of the sort. |
package main
import (
"fmt"
"github.com/coreos/go-semver/semver"
)
func main() {
raw := []string{"0.11.0-20.g070e4a9", "0.12.0", "0.11.0"}
raw := []string{"0.11.0-20.g070e4a9", "0.12.0", "0.11.0"}
fmt.Println(fmt.Sprintf(`Unsorted Tags::%s`, raw))
var tags []*semver.Version
for _, r := range raw {
tags = append(tags, semver.New(r))
}
semver.Sort(tags)
fmt.Println(fmt.Sprintf(`Sorted Tags (oldest -> newest)::%s`, tags))
} yields:
So at least we have a way to isolate this behavior. |
opened an issue upstream: Masterminds/semver#149 |
prerelease tags are supposed to be sorted before the stable release they refer to (i.e. 0.1.0-beta < 0.1.0). So when using these as post-build suffixes, we should be using |
I am using this action to get the latest image version from the
repo2docker
repository: https://hub.docker.com/r/jupyter/repo2docker/tagsThe repo2docker team produces a new image (tag) for every git commit and tag. Currently the latest commit image is
jupyter/repo2docker:0.11.0-20.g070e4a9
and the latest git-tag image isjupyter/repo2docker:0.11.0
.From what I can tell, Semver sort is always going to return the latter (i.e.
0.11.0
) and not the latest commit tag:gha-get-docker-hub-tags/main.go
Line 72 in 4d1339c
Is this something we can control? (I want the latest commit tag)
The text was updated successfully, but these errors were encountered: