pulumi-kubernetes icon indicating copy to clipboard operation
pulumi-kubernetes copied to clipboard

Helm chart in custom repo not found; provider dies (instead of re-downloading it)

Open kralikba opened this issue 2 years ago • 6 comments

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

When using a Helm chart and specifying an https URL for FetchOptions.Repo, local cache removal causes errors. The issue also affects developers with an unpopulated local cache who'd like to continue working on our Pulumi config on an already-deployed stack.

  • I'm using C# on windows
  • Pulumi 3.27.0
  • Pulumi.Kubernetes 3.17.0

Steps to reproduce

  1. Create a Chart object, e.g. with
new ChartArgs()
{
  Chart = "haproxy-ingress",
  Namespace = "haproxy",
  FetchOptions = new ChartFetchArgs()
  {
    Repo = "https://haproxy-ingress.github.io/charts"
  },
  Version = "0.13.6"
}
  1. Run pulumi up. Successful. (chart gets downloaded without user intervention)
  2. Delete %LOCALAPPDATA%\Temp\helm\repository.
  3. Run pulumi preview (or up or refresh)

Expected: Last pulumi command succeeds as well. Actual: The provider fails with: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: failed to pull chart: no cached repo found. (try 'helm repo update')

kralikba avatar Mar 27 '22 19:03 kralikba

Hello, thanks for detailing your issue! Just to clarify - does the suggestion in the error help at all (try 'helm repo update')?

I'm unaware of the caching semantics in this provider; @viveklak could you advise if clearing the cache this way is expected to work as described of if there's additional local resources which should be cleared along with this cache folder?

danielrbradley avatar Apr 01 '22 13:04 danielrbradley

Yes, 'helm repo update' did help.

kralikba avatar Apr 05 '22 15:04 kralikba

Great! Will close as the issue was resolved

danielrbradley avatar Jun 01 '22 13:06 danielrbradley

Great! Will close as the issue was resolved

I would not consider this resolved. Shouldn't the provider, exactly knowing the required step, actually call it and work without manual intervention?

kralikba avatar Jul 13 '22 14:07 kralikba

I would not consider this resolved

No problem, can re-open. Appoligies for mis-understanding the issue here.

So, to ensure I understand the issue correctly as I wasn't clear as to why you'd want to delete the cache folder...

  1. Deploy the project once
  2. Checkout the project on a clean machine (e.g. a CI server)
  3. Run pulumi preview
  4. It fails because the helm chart has not been downloaded.

Does this summarise the issue?

danielrbradley avatar Jul 14 '22 08:07 danielrbradley

Thank you. Yes, this is one main use case. The other developer's machine might not even have the helm cli installed on their system, requiring one more step from them. Another case is e.g. if the Temp directory gets cleaned up as part of routine system maintenance.

kralikba avatar Jul 17 '22 13:07 kralikba