Skip to content

Commit

Permalink
automated commit
Browse files Browse the repository at this point in the history
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Dec 10, 2024
1 parent 8da47b8 commit d285f27
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
16 changes: 8 additions & 8 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions tflib/imagetest/helm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ terraform {
}

locals {
name = var.name != "" ? var.name : random_pet.name.id
name = var.name != "" ? var.name : random_pet.name.id
values_path = "/tmp/${local.name}-values.yaml"
}

resource "random_pet" "name" {}
Expand Down Expand Up @@ -43,6 +44,11 @@ chart=$repo_path/${var.chart}
echo "Installing chart: $chart"
# make a temporary file for the values
cat > ${local.values_path} <<EOF
${jsonencode(var.values)}
EOF
if ! helm install ${local.name} $chart \
--namespace ${var.namespace} --create-namespace \
%{if var.repo != ""}--repo ${var.repo}%{endif} \
Expand All @@ -51,7 +57,8 @@ if ! helm install ${local.name} $chart \
%{if var.wait}--wait --wait-for-jobs%{endif} \
--timeout ${var.timeout} \
%{if length(var.values_files) != 0}--values ${join(",", var.values_files)}%{endif} \
--values <(echo '${jsonencode(var.values)}'); then
%{if var.dry}--dry-run%{endif} \
--values ${local.values_path}; then
printf "\\nFailed to install helm chart\\n"
Expand Down
4 changes: 4 additions & 0 deletions tflib/imagetest/helm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ output "uninstall_cmd" {
output "release_name" {
value = local.name
}

output "values_path" {
value = local.values_path
}
5 changes: 5 additions & 0 deletions tflib/imagetest/helm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ variable "patches" {
default = []
type = list(string)
}

variable "dry" {
description = "Indicates whether Helm will be run in dry-run mode. Useful if all you want is to resolve the chart/values."
default = false
}
2 changes: 1 addition & 1 deletion tflib/publisher/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ terraform {
}
chainguard = {
source = "chainguard-dev/chainguard"
version = ">= 0.1.22"
version = ">= 0.1.24"
}
imagetest = {
source = "chainguard-dev/imagetest"
Expand Down

0 comments on commit d285f27

Please sign in to comment.