-
Notifications
You must be signed in to change notification settings - Fork 710
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
Google Artifact Registry-based helm chart is not defaulting to latest version #6584
Comments
Thanks for the report @RGPosadas . Note that "4.0.0-cct-1200" is a pre-release version (see point 9 at https://semver.org/#semantic-versioning-specification-semver ) not a latest version, but I do also see you've got a version "3.1.4" which should be the latest version, rather than "3.1.3". Notes: The log "Requesting chart (latest version)" is printed when a specific version is not requested - the call actually fetches all the versions that it knows about for that repo, then we filter it according to the configurued versions in summary, so what you're seeing in that list is meant to be the latest 3 major versions with the latest 3 minor with the latest 3 patch versions. It's possible there's an issue in the filtering of that version summary in the frontend dashboard (eg. because there's a pre-release version for both 4.0.0 and 3.1.4, it's incorrectly not considering the non-pre-release 3.1.4 and choosing 3.1.3 - not sure, need to check. |
Besides, I'm noticing there is no Edit: I can replicate the issue locally: Edit2: I guess this is motivated by the fact that we are relying on the PostgreSQL sorting, which does not take into account the pre-releases... There are some pg extensions for doing so, but maybe we would have to handle this in our codebase. kubeapps/cmd/kubeapps-apis/plugins/pkg/pkgutils/pkgutils.go Lines 200 to 203 in a29e090
|
@absoludity Ah yes that's my bad as I was not clear, you are correct - I was expecting either the latest pre-release (4.0.0-cct-1200) or the latest release (3.14) to be the default chart version, instead of 3.13. @antgamdia Thank you for finding the root cause! Let me know if you need further info 🚀 |
@RGPosadas I have just sent a PR aimed at fixing it: #6588 |
Thanks Antonio. All good - I think your solution Antonio is great. Thanks! |
) ### Description of the change As described in #6584, we were returning wrong versions in some corner cases (mainly using pre-releases). It seems we were relying on `ChartVersions[0]` with the explicit assumption that it would always contain the latest version. However, this is not the case. Since the DB does not know about semver (unless we used some [extensions](/~https://github.com/theory/pg-semver)), the ORDER BY query might be wrong. This PR is replacing the occurrences of `ChartVersions[0]` in favor of a previous semver sorting. The affected operations are: `GetAvailablePackageDetail`, `GetAvailablePackageSummaries`, `GetInstalledPackageSummaries` and `GetInstalledPackageDetail`. ### Benefits The `latestVersion` returned by the API (and therefore used by the UI -as is-, we don't sort them in client-side) will be the one that has to be. ### Possible drawbacks 1. In this PR I have just tacked the Helm plugin, not the Flux one. 2. In the code we have relied on this assumption, not 100% of the side effects, if any. ### Applicable issues - fixes #6584 ### Additional information Example of a new version being properly detected:  --------- Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Thanks for the speedy work @antgamdia 🚀 |
@RGPosadas, anytime; happy to get rid of those bugs :) We don't have a release date in mind (we are finishing some work on the new |
Thanks, will play around with the latest release on our test env. |
Describe the bug
GAR repo is not showing the latest release as default.
To Reproduce
Steps to reproduce the behavior:
On

Catalog
view, it is not showing the latest releaseOn
Deploy
view, it is also not showing the latest releaseView
kubeappsapis
logs:Catalog
viewDeploy
view, note that while it is logging(latest version)
, it is actually not the correct latest versionExpected behavior
We expect the latest semver version of a chart to be the default version when deploying a release.
Desktop (please complete the following information):
Version: 2.8.0
Kubernetes version: v1.24.12-gke.1000
Config:
config.json
Plugins:
plugins.conf
The text was updated successfully, but these errors were encountered: