You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helm 3 uses the XDG base dir specification and this is very nice. The specification states that $XDG_CACHE_HOME dir contains "user specific non-essential data files". To my surprise what is not stated is that cache dir can be cleaned up by user at any time. All caches (should) work like this.
In Helm 3.0.1, the cache dir is used for plugins and repositories and these per XDG can disappear at any time. I think plugins and repositories should be kept in $XDG_DATA_HOME.
New plugins and repositories are downloaded to $XDG_DATA_HOME/helm/unpacked-plugins and $XDG_DATA_HOME/helm/repositories.
$XDG_CACHE_HOME is no longer used for plugins management. The symbolic links to $XDG_CACHE_HOME/helm/plugins continue to work.
$XDG_CACHE_HOME/helm/repository is virtually merged with $XDG_DATA_HOME/helm/repositories when list of repositories is needed. There is deprecation warning each time virtual merge happens. Helm 3.1.0 removes any use of $XDG_CACHE_HOME, including virtual merging.
Thanks for bringing this up. I think you are right that we need to make sure Helm handles cache deletion properly.
In Helm 3.0.1, the cache dir is used for plugins and repositories and these per XDG can disappear at any time. I think plugins and repositories should be kept in $XDG_DATA_HOME.
To my knowledge, the information for repositories that is stored in the cache can be recreated. I haven't tried but I believe that if I delete the cache and then try to work with repositories, helm will indicate the repository *-index.yaml file is missing and it will direct the user to do a helm repo update. This sounds ok to me. When a user willingly deletes their cache they should expect some minor impacts.
I'm not sure what info about plugins is stored in the cache. How will the user be impacted with respect to plugins if the cache is removed? Can all data be recreated reasonably easily?
@okulev would you be able to try it out and report how helm behaves after a cache delete?
I was wrong about ~/.cache/helm/repository. After deleting this directory, helm repo list still shows repositories. helm search repo doesn't work though and explicitly suggests that helm repo update should be run. Repositories cache should updated automatically when it is missing. Deleting a cache should not affect user experience except the additional time for automatic restoring of cache.
After deleting ~/.cache/helm/plugins, plugins disappear from helm plugin list. Either plugins should be moved to $XDG_DATA_HOME (I recommend this), or like repos a list should be kept in ~/.config so that plugins re re-downloaded when needed. IMHO The latter is acceptable only if plugins are automatically downloaded when they are missing from ~/.cache.
Repositories cache should be updated automatically when it is missing. Deleting a cache should not affect user experience except the additional time for automatic restoring of cache.
If helm suggests that helm repo update should be run instead of running it automatically, it may be a design decision. I don't have the answer to that. Hopefully another maintainer can shed some light.
After deleting ~/.cache/helm/plugins, plugins disappear from helm plugin list.
I can see this too. It affects plugins downloaded from the internet but not plugins installed from a local repo. Interestingly, the list of plugins is already stored in $XDG_DATA_HOME/helm/plugins but they are symbolic links to the cache, where the plugin has been extracted.
Either plugins should be moved to $XDG_DATA_HOME (I recommend this), or like repos a list should be kept in ~/.config so that plugins re re-downloaded when needed. IMHO The latter is acceptable only if plugins are automatically downloaded when they are missing from ~/.cache.
I agree that loosing plugins when deleting the cache seems excessive.
It would be good to know if there is a reason behind plugins being extracted in the cache?
Your suggested solutions do sound reasonable. Or maybe we can make helm plugin update work in a similar fashion as helm repo update and reload the plugins? This would require the list of plugins to accept symlinks that don't point to anything.
I've noticed this a while ago and am surprised that there is no progress or regarding this issue.
It is fairly common to have $XDG_CACHE_HOME mounted as tmpfs due to various performance benefits. This path is also not meant to hold any data that is relevent or should require user interaction to be recreated.
As already mentioned in this issue, the content could disappear any second without prior notice without having significant impact on running applications.
I would go even that far to say that repositories should not be stored in cache as long as Helm can't restore the data without user interactions. Especially long-running applications that use Helm can suffer from this.
Will keep an eye on this issue and would really appreciate it if a maintainer could have a look at this.
Edit:
Also setting HELM_REPOSITORY_CACHE doesn't seem to work. Files still go to XDG_CACHE_HOME.
No, I don't think so. It still requires you to bend your XDG_* env vars, which is not a good idea as it might break other applications that rely on those vars.
Activity
okulev commentedon Dec 11, 2019
More info can be found in https://askubuntu.com/a/681177
okulev commentedon Dec 12, 2019
Here is a plan for migration:
$XDG_DATA_HOME/helm/unpacked-pluginsand$XDG_DATA_HOME/helm/repositories.$XDG_CACHE_HOMEis no longer used for plugins management. The symbolic links to$XDG_CACHE_HOME/helm/pluginscontinue to work.$XDG_CACHE_HOME/helm/repositoryis virtually merged with$XDG_DATA_HOME/helm/repositorieswhen list of repositories is needed. There is deprecation warning each time virtual merge happens. Helm 3.1.0 removes any use of$XDG_CACHE_HOME, including virtual merging.marckhouzam commentedon Dec 12, 2019
Thanks for bringing this up. I think you are right that we need to make sure Helm handles cache deletion properly.
To my knowledge, the information for repositories that is stored in the cache can be recreated. I haven't tried but I believe that if I delete the cache and then try to work with repositories, helm will indicate the repository *-index.yaml file is missing and it will direct the user to do a
helm repo update. This sounds ok to me. When a user willingly deletes their cache they should expect some minor impacts.I'm not sure what info about plugins is stored in the cache. How will the user be impacted with respect to plugins if the cache is removed? Can all data be recreated reasonably easily?
@okulev would you be able to try it out and report how helm behaves after a cache delete?
okulev commentedon Dec 16, 2019
I was wrong about
~/.cache/helm/repository. After deleting this directory,helm repo liststill shows repositories.helm search repodoesn't work though and explicitly suggests thathelm repo updateshould be run. Repositories cache should updated automatically when it is missing. Deleting a cache should not affect user experience except the additional time for automatic restoring of cache.After deleting
~/.cache/helm/plugins, plugins disappear fromhelm plugin list. Either plugins should be moved to$XDG_DATA_HOME(I recommend this), or like repos a list should be kept in~/.configso that plugins re re-downloaded when needed. IMHO The latter is acceptable only if plugins are automatically downloaded when they are missing from~/.cache.marckhouzam commentedon Dec 17, 2019
If helm suggests that
helm repo updateshould be run instead of running it automatically, it may be a design decision. I don't have the answer to that. Hopefully another maintainer can shed some light.I can see this too. It affects plugins downloaded from the internet but not plugins installed from a local repo. Interestingly, the list of plugins is already stored in
$XDG_DATA_HOME/helm/pluginsbut they are symbolic links to the cache, where the plugin has been extracted.I agree that loosing plugins when deleting the cache seems excessive.
It would be good to know if there is a reason behind plugins being extracted in the cache?
Your suggested solutions do sound reasonable. Or maybe we can make
helm plugin updatework in a similar fashion ashelm repo updateand reload the plugins? This would require the list of plugins to accept symlinks that don't point to anything.ml- commentedon Apr 15, 2020
I've noticed this a while ago and am surprised that there is no progress or regarding this issue.
It is fairly common to have
$XDG_CACHE_HOMEmounted as tmpfs due to various performance benefits. This path is also not meant to hold any data that is relevent or should require user interaction to be recreated.As already mentioned in this issue, the content could disappear any second without prior notice without having significant impact on running applications.
I would go even that far to say that repositories should not be stored in cache as long as Helm can't restore the data without user interactions. Especially long-running applications that use Helm can suffer from this.
Will keep an eye on this issue and would really appreciate it if a maintainer could have a look at this.
Edit:
Also setting
HELM_REPOSITORY_CACHEdoesn't seem to work. Files still go toXDG_CACHE_HOME.jdolitsky commentedon Apr 15, 2020
Would this be fixed with #7529 ?
ml- commentedon Apr 15, 2020
No, I don't think so. It still requires you to bend your
XDG_*env vars, which is not a good idea as it might break other applications that rely on those vars.fix(pkg/plugin): copy plugins directly to the data directory
fix(pkg/plugin): copy plugins directly to the data directory
fix(pkg/plugin): copy plugins directly to the data directory
fix(pkg/plugin): copy plugins directly to the data directory (#7962)
Feat/oci dependencies (#1)
fix(pkg/plugin): copy plugins directly to the data directory (helm#7962)
fix(pkg/plugin): copy plugins directly to the data directory (#7962)
fix(pkg/plugin): copy plugins directly to the data directory (helm#7962)