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

add pass_credentials to helm source #271

Merged
merged 5 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was already a bit confused, thanks for the quick fix 😄


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