Terraform v0.11.13
data "helm_repository" "incubator" {
name = "some_chart"
url = "https://kubernetes-charts-incubator.storage.googleapis.com/"
}
data "helm_repository" "stable" {
name = "another_chart"
url = "https://kubernetes-charts.storage.googleapis.com/"
}
The repositories.yaml contains both entries.
The repositories.yaml will only contain one of the entries.
terraform applyI'm afraid I don't understand very well the issue. Can you post a more detailed example/logs? I have tf files with multiple repositories working without any apparent issue, repositories.yaml in the $HOME/.helm containing multiple entries
Sure, I'll get a simple scenario created and post some logs when I get to work here in a moment. In your scenario, have you started from a base repositories.yaml?
It does work if the repository already exists in the repositories.yaml file. The problem, for me, was when it actually needed to do an add.
@sryabkov in #163 also seems to have this issue.
Steps:
repositories.yaml (from helm init --client-only) and/or just make sure that you dont already have the repository that you've defined in your provider.Mine looks like this for this test case
apiVersion: v1
generated: "2019-04-09T18:32:00.6458817-04:00"
repositories:
- caFile: ""
cache: C:\Users\jreese\.helm\repository\cache\stable-index.yaml
certFile: ""
keyFile: ""
name: stable
password: ""
url: https://kubernetes-charts.storage.googleapis.com
username: ""
- caFile: ""
cache: C:\Users\jreese\.helm\repository\cache\local-index.yaml
certFile: ""
keyFile: ""
name: local
password: ""
url: http://127.0.0.1:8879/charts
username: ""
Here is my entire terraform config (main.tf)
provider "helm" {
version = "~> 0.9"
}
data "helm_repository" "stable" {
name = "another_chart"
url = "https://kubernetes-charts.storage.googleapis.com/"
}
data "helm_repository" "incubator" {
name = "some_chart"
url = "https://kubernetes-charts-incubator.storage.googleapis.com/"
}
terraform applyThe result will be that only one of them is added. Note that if you have the notepad doc open it might show both briefly, but it is then overwritten shortly after.
Running config

Doc asks if you want to reload, upon reloading, shows the second entry:

ANOTHER reload request:

Final state of the config after the apply finishes:

TF_LOG output
https://pastebin.com/pXjBp5q8
Thx, @jpreese, I'll try to reproduce the issue with a base repositories yaml file
Classic data race, I have the same issue, my current workaround is:
terraform apply -parallelism=1
which is, of course, doesn't scale as well, but at least is correct.
@bonifaido I guess you meant
terraform plan -parallelism=1
isn't it?
It works in both cases, I'm working around the referenced repo not found issue with this.
Thx @pdecat for providing great tests to #272
Most helpful comment
Thx, @jpreese, I'll try to reproduce the issue with a base repositories yaml file