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

Kubeapps not handling semver 2.0 tags (+w.x.y-z) #1220

Closed
kandeshvari opened this issue Oct 14, 2019 · 4 comments
Closed

Kubeapps not handling semver 2.0 tags (+w.x.y-z) #1220

kandeshvari opened this issue Oct 14, 2019 · 4 comments

Comments

@kandeshvari
Copy link
Contributor

kandeshvari commented Oct 14, 2019

I use semver tags in chart versions like 0.1.14+2.1.0-5

It seems like kubeapps can't process semver tag (https://semver.org/#spec-item-10) properly and it leads to two bugs:

  1. I can not upgrade existing release. Dashboard shows page with combo "choose helm repo" and redirects to login page when I choose any option. So I can't upgrade release at all.
  2. There is no green label "updates available" on the release card when new version exists.

When I use versions for that chart without tag - all is ok.

@absoludity
Copy link
Contributor

Thanks @kandeshvari . It appears to be a definite bug. Triaging and renaming to get it fixed ASAP. Let me know if it's something you'd like to work on, otherwise it'll get picked up when we have bandwidth. Thanks again for creating the issue!

@absoludity absoludity changed the title Is kubeapps semver 2.0 compatible? Kubeapps not handling semver 2.0 tags (+w.x.y-z) Oct 14, 2019
@kandeshvari
Copy link
Contributor Author

@absoludity sure, why not :) But I need some advice where to start from?

@andresmgot
Copy link
Contributor

It appears that you have hit two different bugs. First, you are seeing the "Choose helm repo" form because the request to automatically retrieve the repo for your application will look something like:

http://kubeapps.local/api/chartsvc/v1/charts?name=mariadb&version=0.1.14+2.1.0-5&appversion=10.3.18

As you can see, the version is in the query of the request. The problem is that the symbol + means "space" when it's present in a query parameter so it's resolved to version=0.1.14 2.1.0-5 and the system is not able to find a chart with that version. We would need to escape that character using the method encodeURIComponent for the version (and probably the appversion too).

That code is here:

https://github.com/kubeapps/kubeapps/blob/master/dashboard/src/shared/Chart.ts#L51

But we would need to probably fix the encoding in these URLs too:

https://github.com/kubeapps/kubeapps/blob/master/dashboard/src/shared/url.ts#L22

Then, the second bug is that, when checking if a chart belongs to a repository (that's what happens when you select a registry), we are directly accessing the URL of the chartsvc without auth:

https://github.com/kubeapps/kubeapps/blob/master/dashboard/src/actions/repos.ts#L217

We changed that route to ensure authentication, that's why the server returns a Not Authorized response and you are logged out. To fix that, you can change the call to axios to the Chart method that attaches the proper auth info:

     try {
-      await axios.get(url.api.charts.listVersions(`${repo}/${chartName}`));
+      Chart.fetchChartVersions(`${repo}/${chartName}`);
       dispatch(receiveRepo(appRepository));
       return true;
     } catch (e) {

I hope that's information enough for you to check if that solves your issue! If you need instructions of how to setup a dev enviroment we have some docs here:

https://github.com/kubeapps/kubeapps/blob/master/docs/developer/dashboard.md

@kandeshvari
Copy link
Contributor Author

Thank you! I'll work on it.

kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 18, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 18, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 19, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 19, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 19, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 19, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 19, 2019
kandeshvari added a commit to kandeshvari/kubeapps that referenced this issue Oct 22, 2019
andresmgot pushed a commit that referenced this issue Oct 22, 2019
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

No branches or pull requests

3 participants