Skip to content
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

Add version compare lib/func #705

Open
jeffwubj opened this issue Jul 14, 2022 · 2 comments
Open

Add version compare lib/func #705

jeffwubj opened this issue Jul 14, 2022 · 2 comments
Labels
enhancement This issue is a feature request priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.

Comments

@jeffwubj
Copy link

Describe the problem/challenge you have
I managed to get K8s version and store it in a variable, want to check whether there is some handy lib that can compare version

Describe the solution you'd like
maybe a new func from version module:

def compare_version (a, b):
  // return 1 if version a > b
  // return 0 if version a <= b
  // a could be v1.23.1
  // b could be v1.22.1
enf

Anything else you would like to add:
[Additional information that will assist in solving the issue.]


Vote 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.

@jeffwubj jeffwubj added carvel triage This issue has not yet been triaged for relevance enhancement This issue is a feature request labels Jul 14, 2022
@pivotaljohn
Copy link
Contributor

A workaround (which can serve as a reference implementation):

https://github.com/pivotaljohn/tanzu-framework/blob/ac3165c8/pkg/v1/providers/ytt/lib/helpers.star#L349-L360

@pivotaljohn pivotaljohn added priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome. and removed carvel triage This issue has not yet been triaged for relevance labels Aug 26, 2022
@pivotaljohn
Copy link
Contributor

While there's some minor questions about naming and proper home of things (if someone's game, sparking a quick conversation on Slack might well resolve this), this would be a nice add to the ytt "standard library". 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a feature request priority/unprioritized-backlog Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.
Projects
Status: To Triage
Development

No branches or pull requests

2 participants