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

Fix helm remove duplicate plugins for versions >= 3.10.x #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

levtomer66
Copy link

The first string comparison (if [[ "${HELM_VERSION}" > "3.3.1" ]];) may not work as expected for versions greater than or equal to 3.10.x due to the fact that string comparison in Bash is lexicographical rather than numerical. In lexicographical comparison, each character in the string is compared one by one, which may lead to unexpected results when dealing with version numbers that have more than one digit.

For instance, in lexicographical comparison:

"3.10" is considered less than "3.2" because the comparison starts with the first character and "1" comes before "2" in the ASCII character set.
Similarly, "3.10" is considered less than "3.2.1" for the same reason.
To address this limitation, the modified code uses semantic version sorting by employing the sort -V command. This ensures that version numbers are compared based on their numeric significance rather than lexicographically. The modification is designed to handle cases where the version number includes multiple digits or subversions, such as 3.10.x, and accurately determines if the version is equal to or greater than 3.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant