Skip to content

Commit

Permalink
Adding release name to helm chart module
Browse files Browse the repository at this point in the history
  • Loading branch information
juandiegopalomino committed May 11, 2022
1 parent c5a4c75 commit 7ea5694
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/helm_chart/helm-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"description": "Create namespace as well.",
"default": false
},
"release_name": {
"type": "string",
"description": "The name the chart installation is to have."
},
"atomic": {
"type": "boolean",
"description": "If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used.",
Expand Down
5 changes: 5 additions & 0 deletions modules/helm_chart/helm-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ inputs:
Note that you don't need to use `<repo_name>/<chart_name>` - as repo is specified separately. Just do `<chart_name>`.
If you're using a local chart, then this will be the path to the chart.
default: null
- name: release_name
user_facing: true
validator: str(required=False)
description: The name the chart installation is to have.
default: null
- name: repository
user_facing: true
validator: str(required=False)
Expand Down
5 changes: 4 additions & 1 deletion modules/helm_chart/tf_module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "helm_release" "remote_chart" {
chart = var.chart
repository = var.repository
version = var.chart_version
name = "${var.layer_name}-${var.module_name}"
name = var.release_name == null ? var.chart : var.release_name
atomic = var.atomic
cleanup_on_fail = var.cleanup_on_fail
namespace = var.namespace
Expand All @@ -13,6 +13,9 @@ resource "helm_release" "remote_chart" {
dependency_update = var.dependency_update
wait = var.wait
max_history = var.max_history
lifecycle {
ignore_changes = [name]
}
}


Expand Down
2 changes: 2 additions & 0 deletions modules/helm_chart/tf_module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ variable "dependency_update" {
variable "max_history" {
type = number
}

variable "release_name" {}

0 comments on commit 7ea5694

Please sign in to comment.