Open voor opened 2 years ago
Thanks @voor - it seems like the library we're using is enforcing the semver 2.0.0 BNF grammar which includes the +
as you show above, and -
(hyphens) (to designate prereleases) but not underscores.
I've updated the title to reflect what I actually need. If I remove the _vmware.1
part from the versions then sorting can proceed:
vendir tools sort-semver -v "v1.19.12-tkg.1 v1.19.12-tkg.2 v1.19.12-tkg.3-tf-v0.10.1 v1.19.16-tkg.1 v1.20.11-tkg.1-tf-v0.10.1 v1.20.14-tkg.1 v1.20.14-tkg.2 v1.20.14-tkg.4 v1.20.14-tkg.4-tf-v0.11.2 v1.20.14-tkg.5 v1.20.15-tkg.1 v1.20.8-tkg.2 v1.20.8-tkg.3 v1.21.11-tkg.1 v1.21.2-tkg.1 v1.21.2-tkg.2 v1.21.5-tkg.1-tf-v0.10.1 v1.21.8-tkg.1 v1.21.8-tkg.2 v1.21.8-tkg.4 v1.21.8-tkg.4-tf-v0.11.2 v1.21.8-tkg.5" --prerelease
I need some sort of find/replace capability on the versions prior to attempting sorting. Whether that's changing _ to +, or in my case removing a chunk of erroneous text from the versions.
What steps did you take:
What happened: Nothing is properly detected as semantic versioned.
What did you expect: Replacing
+
with_
is a common change since container tags cannot have a + in them. In fact most systems (like containerd) will actually replace the + into a _ for you.Anything else you would like to add: I don't want to solutionize here, since folks might intentionally have the
_
there and it's not meant to turn into a+
, just illustrating that in this isolated event treating the_
as a+
would fix things.Environment:
vendir --version
):0.26.0
/etc/os-release
): Fedora 35Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.