Skip to content

Commit

Permalink
Add pass_credentials to argocd_application.spec.source.helm (#271)
Browse files Browse the repository at this point in the history
Co-authored-by: OneMatchFox <878612+onematchfox@users.noreply.github.com>
  • Loading branch information
duncan485 and onematchfox committed May 4, 2023
1 parent fa86a9b commit 8e40130
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions argocd/resource_argocd_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,8 @@ resource "argocd_application" "helm" {
value = "standalone"
}
pass_credentials = true
value_files = ["values.yaml"]
values = <<EOT
Expand Down
5 changes: 5 additions & 0 deletions argocd/schema_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,11 @@ func applicationSpecSchemaV4() *schema.Schema {
Description: "Whether to skip custom resource definition installation step (Helm's [--skip-crds](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/)).",
Optional: true,
},
"pass_credentials": {
Type: schema.TypeBool,
Description: "If true then adds --pass-credentials to Helm commands to pass credentials to all domains",
Optional: true,
},
},
},
},
Expand Down
15 changes: 10 additions & 5 deletions argocd/structure_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ func expandApplicationSourceHelm(in []interface{}) *application.ApplicationSourc
result.ReleaseName = v.(string)
}

if v, ok := a["pass_credentials"]; ok {
result.PassCredentials = v.(bool)
}

if parameters, ok := a["parameter"]; ok {
for _, _p := range parameters.(*schema.Set).List() {
p := _p.(map[string]interface{})
Expand Down Expand Up @@ -744,11 +748,12 @@ func flattenApplicationSourceHelm(as []*application.ApplicationSourceHelm) (
}

result = append(result, map[string]interface{}{
"parameter": parameters,
"release_name": a.ReleaseName,
"skip_crds": a.SkipCrds,
"value_files": a.ValueFiles,
"values": a.Values,
"parameter": parameters,
"release_name": a.ReleaseName,
"skip_crds": a.SkipCrds,
"value_files": a.ValueFiles,
"values": a.Values,
"pass_credentials": a.PassCredentials,
})
}
}
Expand Down
1 change: 1 addition & 0 deletions docs/resources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Optional:
Optional:

- `parameter` (Block Set) Helm parameters which are passed to the helm template command upon manifest generation. (see [below for nested schema](#nestedblock--spec--source--helm--parameter))
- `pass_credentials` (Boolean) If true then adds --pass-credentials to Helm commands to pass credentials to all domains
- `release_name` (String) Helm release name. If omitted it will use the application name.
- `skip_crds` (Boolean) Whether to skip custom resource definition installation step (Helm's [--skip-crds](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/)).
- `value_files` (List of String) List of Helm value files to use when generating a template.
Expand Down

0 comments on commit 8e40130

Please sign in to comment.