-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
80 lines (78 loc) · 2.65 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
variable "helm_release" {
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
locals {
default = {
# resource definition
helm_release = {
name = ""
namespace = "default"
repository = null
repository_key_file = null
repository_cert_file = null
repository_ca_file = null
repository_username = null
repository_password = null
devel = null
verify = null
keyring = null
timeout = null
disable_webhooks = null
reuse_values = null
reset_values = true
force_update = true
recreate_pods = null
cleanup_on_fail = true
max_history = 3
atomic = null
skip_crds = null
render_subchart_notes = null
disable_openapi_validation = null
wait = true
wait_for_jobs = null
dependency_update = null
replace = null
description = null
lint = true
create_namespace = null
values = null
set = {
name = ""
type = null
}
set_sensitive = {
name = ""
type = null
}
postrender = {
binary_path = ""
args = null
}
}
}
# compare and merge custom and default values
helm_release_values = {
for helm_release in keys(var.helm_release) :
helm_release => merge(local.default.helm_release, var.helm_release[helm_release])
}
# merge all custom and default values
helm_release = {
for helm_release in keys(var.helm_release) :
helm_release => merge(
local.helm_release_values[helm_release],
{
for config in ["postrender"] :
config => merge(local.default.helm_release[config], local.helm_release_values[helm_release][config])
},
{
for config in ["set", "set_sensitive"] :
config => {
for key in keys(lookup(var.helm_release[helm_release], config, {})) :
key => merge(local.default.helm_release[config], local.helm_release_values[helm_release][config][key])
}
}
)
}
}