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

Chart Repository refresh does not actually refresh the chart repo #7668

Closed
jamesongithub opened this issue Feb 11, 2022 · 12 comments · Fixed by #7672
Closed

Chart Repository refresh does not actually refresh the chart repo #7668

jamesongithub opened this issue Feb 11, 2022 · 12 comments · Fixed by #7672
Assignees
Milestone

Comments

@jamesongithub
Copy link
Contributor

jamesongithub commented Feb 11, 2022

Rancher Server Setup

  • Rancher version: v2.6.3
  • Installation option (Docker install/Helm Chart):
    • If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc):
  • Proxy/Cert Details:

Information about the Cluster

  • Kubernetes version: 1.21.7
  • Cluster Type (Local/Downstream): local on AKS
    • If downstream, what type of cluster? (Custom/Imported or specify provider for Hosted/Infrastructure Provider):

User Information

  • What is the role of the user logged in? (Admin/Cluster Owner/Cluster Member/Project Owner/Project Member/Custom) Admin
    • If custom, define the set of permissions:

Describe the bug

The refresh button

image

image

does not actually sync the latest changes from the repo to rancher.

To Reproduce

  1. create github repo with apps/marketplace rancher chart plus questions.yaml
  2. create a branch on the repo
  3. add repo url to rancher as a git repo pointing to branch
  4. install chart
  5. make a change to the chart and/or questions.yaml in the github repo branch
  6. refresh the repo in rancher
  7. attempt to deploy chart again

Result
Chart is deployed with old version

Expected Result

Chart to be deployed with latest changes on the branch after a refresh

Screenshots

Additional context

The only way is the create a new repo on rancher with a different name. Deleting and creating a repo with the same name does not fix the issue, you still have the old, cached version of the chart.

Is there even a automated periodic refresh at all?

@jamesongithub jamesongithub changed the title Chart Repository refresh does not work Chart Repository refresh does not actually refresh the chart repo Feb 11, 2022
@stale
Copy link

stale bot commented Apr 14, 2022

This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 60 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions.

@stale stale bot added the status/stale label Apr 14, 2022
@jamesongithub
Copy link
Contributor Author

bump

@gaktive
Copy link
Member

gaktive commented Apr 26, 2022

Checking how much of this is UI related. If so, will transfer to rancher/dashboard.

@codyrancher codyrancher removed their assignment Apr 26, 2022
@codyrancher
Copy link
Contributor

From my tests it looks like it's backend.

If all I do is refresh after the repo has been updated I see the request get made and the repo status cycles through until it gets back to active.

If you clone a repo and give it a new name and refresh the updates show up. It makes me think that the backend is caching something based on the repo name.

@gaktive
Copy link
Member

gaktive commented Apr 27, 2022

@Jono-SUSE-Rancher or @MKlimuszka I'll allow you to find a backend engineer to look into this.

@sadhugit
Copy link

End-user complaints(noticed) a similar issue in 2.6.3 :
When updating the helm chart in our gitlab (and changing version/appVersion in Chart.yaml), the clicking on "Refresh" for the repository defined into Rancher, the helm chart definition is not updated into Rancher (and we can not "Update installed application") If we "clone" the repository with another name, the helm chart is updated, but only into the "new" Repository (so not the one of the installed App). If we delete an old repository, then we re-clone the repository with the same old name we just erased, we still get the old helm chart (remaining in cache) and not the new one fetched from our gitlab repository How to refresh repositories (or clean repository cache) ? Please note that other public repositories seems to be correctly updated

@vynguyenchantal
Copy link

I'm using the same Rancher version: v2.6.3 and Kubernetes version: 1.21.7.

We store our charts in S3 and Harbor. I'm encountering a slightly different problem. When I select a chart to install, I expect to see the latest/new version (11160.1.48) but it does not show under the Chart Versions.

image

I also found 2 workarounds.

Workaround rancher/rancher#1: I have to do it in the EXACT order:
Step 1: Apps & Marketplace>Repositories - Refresh chart-repo
image

Step 2: Apps & Marketplace>Charts - Refresh chart-repo.
image

Workaround rancher/rancher#2: Apps & Marketplace>Charts - Refresh chart-repo TWICE
image

In my case, I need to automate (script) refreshing repo/chart.

Going for workaround rancher/rancher#2, I use Developer Tools to capture the URL and request and response. I notice the request looks similar to the response.

diff req.json res.json
26c26
<               "generation": 64,
---
>               "generation": 65,
95c95
<               "resourceVersion": "2255833",
---
>               "resourceVersion": "2255874",
98,100c98,100
<                       "message": "Resource is current",
<                       "name": "active",
<                       "transitioning": false
---
>                       "message": "ClusterRepo generation is 65, but latest observed generation is 64",
>                       "name": "in-progress",
>                       "transitioning": true

I use SoapUI and curl commands to mimic what Rancher UI does.

  1. GET hitting /k8s/clusters/c-vdq2k/v1/catalog.cattle.io.clusterrepos/chart-repo
  2. PUT hitting /k8s/clusters/c-vdq2k/v1/catalog.cattle.io.clusterrepos/chart-repo (using the response from GET as the request). The response from the PUT looks identical as the request (the generation value does NOT increase by 1). The PUT doesn't seem to truly refresh the chart-repo.
  3. GET /k8s/clusters/c-vdq2k/v1/catalog.cattle.io.clusterrepos/chart-repo?link=index to confirm the new version is there

In Rancher UI, I select a chart to install, the latest/new version does not show under the Chart Versions.

Any help is greatly appreciated!

@seawenc
Copy link

seawenc commented Nov 21, 2022

I tried the latest version:v2.6.9, this problem is still found,
how to fix it,when to fix it? If not fixed, v2.6.x will not work for me

@seawenc
Copy link

seawenc commented Nov 24, 2022

@Jono-SUSE-Rancher or @MKlimuszka I'll allow you to find a backend engineer to look into this.

When will this bug be fixed? My work is blocked by this bug
@Jono-SUSE-Rancher @gaktive

@codyrancher
Copy link
Contributor

I worked on this issue with @pennyscissors. It turned out that this actually was a front end issue. The catalog.cattle.io.clusterrepos resource is fetched and cached differently from other resources. There isn't a subscription to updates for this resource (seems like there can't be). If we force a refresh of the resource on appropriate pages we see the new chart and things behave as expected.

@codyrancher codyrancher transferred this issue from rancher/rancher Dec 9, 2022
@codyrancher codyrancher self-assigned this Dec 9, 2022
codyrancher added a commit to codyrancher/dashboard that referenced this issue Dec 9, 2022
…updated

The catalog.cattle.io.clusterrepos/{repo} resource doesn't subscribe to updates. We now force a full request in the areas where it's appropriate to do so.

fixes rancher#7668
@gaktive gaktive added this to the v2.7.next1 milestone Dec 9, 2022
@catherineluse
Copy link
Contributor

Related tech debt issue #7963

@zube zube bot closed this as completed Apr 3, 2023
@AndrewHoffmanQA
Copy link

retest passed, moving to done

tested on:
local
rancher- 2.7.2-rc8
k8-v1.25.6

testing efforts taken:

  • stood up a rancher instance
  • created a fork of charts
  • created a local clone
  • installed chart fork as a repository to rancher
  • installed UI plugin
  • on cloned local, updated chart
  • ran proper helmcharts to create the tgz of the updated chart
  • published commit to fork
  • on rancher, confirmed the change to UI plugin was visible in the yaml values
  • on rancher, confirmed the repository commit hash updated to reflect the new change that was pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment