Skip to content

Commit 8e40130

Browse files
Add pass_credentials to argocd_application.spec.source.helm (#271)
Co-authored-by: OneMatchFox <[email protected]>
1 parent fa86a9b commit 8e40130

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

argocd/resource_argocd_application_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,8 @@ resource "argocd_application" "helm" {
11271127
value = "standalone"
11281128
}
11291129
1130+
pass_credentials = true
1131+
11301132
value_files = ["values.yaml"]
11311133
11321134
values = <<EOT

argocd/schema_application.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,11 @@ func applicationSpecSchemaV4() *schema.Schema {
13501350
Description: "Whether to skip custom resource definition installation step (Helm's [--skip-crds](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/)).",
13511351
Optional: true,
13521352
},
1353+
"pass_credentials": {
1354+
Type: schema.TypeBool,
1355+
Description: "If true then adds --pass-credentials to Helm commands to pass credentials to all domains",
1356+
Optional: true,
1357+
},
13531358
},
13541359
},
13551360
},

argocd/structure_application.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ func expandApplicationSourceHelm(in []interface{}) *application.ApplicationSourc
272272
result.ReleaseName = v.(string)
273273
}
274274

275+
if v, ok := a["pass_credentials"]; ok {
276+
result.PassCredentials = v.(bool)
277+
}
278+
275279
if parameters, ok := a["parameter"]; ok {
276280
for _, _p := range parameters.(*schema.Set).List() {
277281
p := _p.(map[string]interface{})
@@ -744,11 +748,12 @@ func flattenApplicationSourceHelm(as []*application.ApplicationSourceHelm) (
744748
}
745749

746750
result = append(result, map[string]interface{}{
747-
"parameter": parameters,
748-
"release_name": a.ReleaseName,
749-
"skip_crds": a.SkipCrds,
750-
"value_files": a.ValueFiles,
751-
"values": a.Values,
751+
"parameter": parameters,
752+
"release_name": a.ReleaseName,
753+
"skip_crds": a.SkipCrds,
754+
"value_files": a.ValueFiles,
755+
"values": a.Values,
756+
"pass_credentials": a.PassCredentials,
752757
})
753758
}
754759
}

docs/resources/application.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ Optional:
258258
Optional:
259259

260260
- `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))
261+
- `pass_credentials` (Boolean) If true then adds --pass-credentials to Helm commands to pass credentials to all domains
261262
- `release_name` (String) Helm release name. If omitted it will use the application name.
262263
- `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/)).
263264
- `value_files` (List of String) List of Helm value files to use when generating a template.

0 commit comments

Comments
 (0)