Skip to content

Commit 4f838b5

Browse files
Merge pull request #6 from samcre/upgrade-helm-v2
Upgrades module to Helm v2 provider
2 parents 2d84259 + bc8ae6f commit 4f838b5

File tree

9 files changed

+54
-30
lines changed

9 files changed

+54
-30
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ end_of_line = lf
66
charset = utf-8
77
indent_style = space
88
indent_size = 4
9-
insert_final_newline = false
9+
insert_final_newline = true
1010
trim_trailing_whitespace = true
1111

1212
[*.py]

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.1.0
3+
rev: v4.0.1
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=500']
@@ -17,7 +17,7 @@ repos:
1717
- id: detect-aws-credentials
1818
args: ['--allow-missing-credentials']
1919
- repo: git://github.com/antonbabenko/pre-commit-terraform
20-
rev: v1.31.0
20+
rev: v1.50.0
2121
hooks:
2222
- id: terraform_fmt
2323
- id: terraform_docs

.terraform-docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sections:
2+
hide: [
3+
resources,
4+
data-sources,
5+
modules
6+
]
7+
8+
settings:
9+
anchor: false

.tflint.hcl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
config {
2-
deep_check = false
1+
plugin "aws" {
2+
enabled = true
3+
deep_check = false
34
ignore_module = {}
4-
varfile = []
5+
varfile = []
56
}
67

78
rule "terraform_documented_variables" {

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ module jenkins {
8686

8787
| Name | Version |
8888
|------|---------|
89-
| terraform | >= 0.12 |
90-
| helm | >= 1.1 |
89+
| terraform | >= 0.13 |
90+
| helm | >= 2.0 |
9191

9292
## Providers
9393

9494
| Name | Version |
9595
|------|---------|
96-
| helm | >= 1.1 |
96+
| helm | >= 2.0 |
9797

9898
## Inputs
9999

100100
| Name | Description | Type | Default | Required |
101101
|------|-------------|------|---------|:--------:|
102-
| app | an application to deploy | `map` | n/a | yes |
102+
| app | an application to deploy | `map(any)` | n/a | yes |
103103
| namespace | namespace where to deploy an application | `string` | n/a | yes |
104104
| repository | Helm repository | `string` | n/a | yes |
105105
| set | Value block with custom STRING values to be merged with the values yaml. | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `null` | no |
@@ -108,8 +108,9 @@ module jenkins {
108108

109109
## Outputs
110110

111-
No output.
112-
111+
| Name | Description |
112+
|------|-------------|
113+
| deployment | The state of the helm deployment |
113114
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
114115

115116
## Commands

main.tf

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
resource helm_release this {
2-
count = var.app["deploy"] ? 1 : 0
3-
namespace = var.namespace
4-
repository = var.repository
5-
name = var.app["name"]
6-
version = var.app["version"]
7-
chart = var.app["chart"]
8-
force_update = lookup(var.app, "force_update", true)
9-
wait = lookup(var.app, "wait", true)
10-
recreate_pods = lookup(var.app, "recreate_pods", true)
11-
max_history = lookup(var.app, "max_history", 0)
12-
lint = lookup(var.app, "lint", true)
13-
values = var.values
1+
resource "helm_release" "this" {
2+
count = var.app["deploy"] ? 1 : 0
3+
namespace = var.namespace
4+
repository = var.repository
5+
name = var.app["name"]
6+
version = var.app["version"]
7+
chart = var.app["chart"]
8+
force_update = lookup(var.app, "force_update", true)
9+
wait = lookup(var.app, "wait", true)
10+
recreate_pods = lookup(var.app, "recreate_pods", true)
11+
max_history = lookup(var.app, "max_history", 0)
12+
lint = lookup(var.app, "lint", true)
13+
cleanup_on_fail = lookup(var.app, "cleanup_on_fail", false)
14+
create_namespace = lookup(var.app, "create_namespace", false)
15+
disable_webhooks = lookup(var.app, "disable_webhooks", false)
16+
verify = lookup(var.app, "verify", false)
17+
reuse_values = lookup(var.app, "reuse_values", false)
18+
reset_values = lookup(var.app, "reset_values", false)
19+
atomic = lookup(var.app, "atomic", false)
20+
skip_crds = lookup(var.app, "skip_crds", false)
21+
render_subchart_notes = lookup(var.app, "render_subchart_notes", true)
22+
disable_openapi_validation = lookup(var.app, "disable_openapi_validation", false)
23+
wait_for_jobs = lookup(var.app, "wait_for_jobs", false)
24+
dependency_update = lookup(var.app, "dependency_update", false)
25+
replace = lookup(var.app, "replace", false)
26+
values = var.values
1427

1528
dynamic "set" {
1629
iterator = item

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
output "deployment" {
2-
value = helm_release.this
2+
value = var.app["deploy"] ? helm_release.this[0].metadata : []
33
description = "The state of the helm deployment"
44
}

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variable "namespace" {
55

66
variable "app" {
77
description = "an application to deploy"
8-
type = map
8+
type = map(any)
99
}
1010

1111
variable "values" {

versions.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
2-
required_version = ">= 0.12"
2+
required_version = ">= 0.13"
33

44
required_providers {
5-
helm = ">= 1.1"
5+
helm = ">= 2.0"
66
}
7-
}
7+
}

0 commit comments

Comments
 (0)