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

[.tgz Chart URL] Error: could not download chart: no cached repo found #1475

Open
mateustanaka opened this issue Sep 3, 2024 · 2 comments
Open
Assignees
Labels

Comments

@mateustanaka
Copy link

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: 1.4.5
Provider version: 2.12.1
Kubernetes version: 1.29.5
Helm version (asdf): 3.11.0 and 2.14.2

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "k8s_config" {
  name                = "k8s-config"
  namespace           = "default"
  chart               = "https://nexus.company.com.br/repository/myrepo/K8sConfig-1.2.0.tgz"
  repository_username = var.username
  repository_password = var.password

  values = [
    file("values/K8sConfig/values.yaml")
  ]
}

Panic Output

helm_release.k8s_config: Creating...
2024-09-02T11:51:25.437-0300 [ERROR] provider.terraform-provider-helm_v2.12.1_x5: Response contains error diagnostic: diagnostic_detail= diagnostic_summary="could not download chart: no cached repo found. (try 'helm repo update'): open /home/user/.cache/helm/repository/other-helm-repo-index.yaml: no such file or directory" tf_proto_version=5.4 tf_provider_addr=provider tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_severity=ERROR tf_req_id=37d9fb27-d72d-421c-bae6-043c6866ae9b tf_resource_type=helm_release timestamp=2024-09-02T11:51:25.437-0300
2024-09-02T11:51:25.437-0300 [ERROR] vertex "helm_release.k8s_config" error: could not download chart: no cached repo found. (try 'helm repo update'): open /home/user/.cache/helm/repository/other-helm-repo-index.yaml: no such file or directory
╷
│ Error: could not download chart: no cached repo found. (try 'helm repo update'): open /home/user/.cache/helm/repository/other-helm-repo-index.yaml: no such file or directory
│ 
│   with helm_release.k8s_config,
│   on main.tf line 23, in resource "helm_release" "k8s_config":
│   23: resource "helm_release" "k8s_config" {

Steps to Reproduce

  1. Use an absolute URL to the .tgz of the Chart from a private Registry
  2. Set env var ASDF_HELM_VERSION=3.11.0 to force use helm 3 in Azure Pipeline terraform task
  3. terraform apply

Expected Behavior

Apply performed and helm release installed successfully from private my registry using an absolute URL to the .tgz of the Chart.

Actual Behavior

Error: could not download chart: no cached repo found

Is there a way to force helm repo update via terraform? Should we peform it even using .tgz url instead of chart repository?

@arybolovlev
Copy link
Contributor

Hi @mateustanaka,

I wasn't able to reproduce this issue. Have you tried to download the chart with curl? Does it work with your username and password in the above Terraform code snippet?

Thanks.

@mateustanaka
Copy link
Author

Hi @mateustanaka,

I wasn't able to reproduce this issue. Have you tried to download the chart with curl? Does it work with your username and password in the above Terraform code snippet?

Thanks.

Yes @arybolovlev the URL and credentials are correct. Even using the .tgz URL, it is necessary to perform the helm repo update? Would be nice to have a property in helm_release to set true and terraform do automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants