Skip to content

Commit

Permalink
Add default values to service_account variables in variables.tf
Browse files Browse the repository at this point in the history
The service_account and service_account_overwrite_allowed parameters under the job_identity variable in variables.tf have been updated to allow default values. This should ensure more consistent behaviour across different configurations and prevent potential undefined variable errors.
  • Loading branch information
MaciekLeks committed Feb 16, 2024
1 parent 639c533 commit 6098297
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ Full contributing guidelines are covered [here](CONTRIBUTING.md).
| <a name="input_image_pull_policy"></a> [image\_pull\_policy](#input\_image\_pull\_policy) | Specify the job images pull policy: Never, IfNotPresent, Always. | `string` | `"IfNotPresent"` | no |
| <a name="input_image_pull_secrets"></a> [image\_pull\_secrets](#input\_image\_pull\_secrets) | A array of secrets that are used to authenticate Docker image pulling. | `list(string)` | `[]` | no |
| <a name="input_job_affinity"></a> [job\_affinity](#input\_job\_affinity) | Specify affinity rules that determine which node runs the job. No HCL support for this variable. Use string interpolation if needed. | `string` | `""` | no |
| <a name="input_job_identity"></a> [job\_identity](#input\_job\_identity) | Default service account job pods use to talk to Kubernetes API. | <pre>object({<br> service_account = optional(string)<br> service_account_overwrite_allowed = optional(string)<br> })</pre> | `{}` | no |
| <a name="input_job_identity"></a> [job\_identity](#input\_job\_identity) | Default service account job pods use to talk to Kubernetes API. | <pre>object({<br> service_account = optional(string, "")<br> service_account_overwrite_allowed = optional(string, "")<br> })</pre> | `{}` | no |
| <a name="input_job_pod_annotations"></a> [job\_pod\_annotations](#input\_job\_pod\_annotations) | A map of annotations to be added to each build pod created by the Runner. The value of these can include environment variables for expansion. Pod annotations can be overwritten in each build. | `map(string)` | `{}` | no |
| <a name="input_job_pod_labels"></a> [job\_pod\_labels](#input\_job\_pod\_labels) | A map of labels to be added to each build pod created by the runner. The value of these can include environment variables for expansion. | `map(string)` | `{}` | no |
| <a name="input_job_pod_node_selectors"></a> [job\_pod\_node\_selectors](#input\_job\_pod\_node\_selectors) | A map of node selectors to apply to the pods | `map(string)` | `{}` | no |
Expand Down
3 changes: 3 additions & 0 deletions config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ locals {
poll_timeout = ${var.poll.timeout}
%{~endif~}
service_account = ${var.job_identity.service_account}
service_account_overwrite_allowed=${var.job_identity.service_account_overwrite_allowed}
[runners.kubernetes.affinity]
${var.job_affinity}
[runners.kubernetes.node_selector]
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ variable "envs" {
variable "job_identity" {
description = "Default service account job pods use to talk to Kubernetes API."
type = object({
service_account = optional(string)
service_account_overwrite_allowed = optional(string)
service_account = optional(string, "")
service_account_overwrite_allowed = optional(string, "")
})
default = {}
}
Expand Down

0 comments on commit 6098297

Please sign in to comment.