Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[signalio] cannot set SIGNALILO_ICINGA_INSECURE_TLS via helm #466

Open
chripf opened this issue Mar 22, 2023 · 1 comment
Open

[signalio] cannot set SIGNALILO_ICINGA_INSECURE_TLS via helm #466

chripf opened this issue Mar 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@chripf
Copy link

chripf commented Mar 22, 2023

Describe the bug

Using a block like

  set {
    name = "extraEnvVars[0].name"
    value = "SIGNALILO_ICINGA_INSECURE_TLS"
  }
  set {
    name = "extraEnvVars[0].value"
    value = true     
  }

I want to set the given value.
This is not working unfortunately, resulting in error:
...ReadString: expects " or n, but found t, ...

Additional context

Seems to be related to helm/helm#4262

Expected behavior

Provide a way to set the SIGNALILO_ICINGA_INSECURE_TLS value via helm.

Environment (please complete the following information):

  • Chart: latest
  • Helm: v3.11.2
  • Kubernetes API: v1.22
  • Distribution: K3s
@chripf chripf added the bug Something isn't working label Mar 22, 2023
@chripf chripf changed the title [chart-name] SUMMARY [signalio] cannot set SIGNALILO_ICINGA_INSECURE_TLS via helm Mar 22, 2023
@simu
Copy link
Member

simu commented Apr 20, 2023

Hi,

I assume your snippet is part of a Terraform configuration which uses https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release?

After some experimenting and googling, I've found hashicorp/terraform-provider-helm#838 (comment). As discussed in that comment, explicitly specifying type = "string" for the 2nd set block allows terraform apply to succeed for me.

Test config:

# main.tf
terraform {
  required_providers {
    helm = {
      source = "hashicorp/helm"
      version = "2.9.0"
    }
  }
}

provider "helm" {
  # Configuration options
}

resource "helm_release" "signalilo" {
  name       = "signalilo"
  repository = "https://charts.appuio.ch"
  chart      = "signalilo"

  values = [
    "${file("values.yaml")}"
  ]

  set {
    name  = "extraEnvVars[0].name"
    value = "SIGNALILO_ICINGA_INSECURE_TLS"
  }
  set {
    name  = "extraEnvVars[0].value"
    value = "true"
    type  = "string"
  }
}
# values.yaml
config:
  uuid: 9ec06d59-aa0c-4434-b5e2-1aeaf93cd925
  icinga_hostname: signalilo_signalilo_test
  icinga_url: https://<redacted>:5665
  icinga_username: signalilo_signalilo_test
  icinga_password: <redacted>
  alertmanager_bearer_token: aaaaaa

Terraform output (Terraform v1.4.2, deploying to K8s 1.25.2/kind 0.16.0):

$ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # helm_release.signalilo will be created
  + resource "helm_release" "signalilo" {
      + atomic                     = false
      + chart                      = "signalilo"
      + cleanup_on_fail            = false
      + create_namespace           = false
      + dependency_update          = false
      + disable_crd_hooks          = false
      + disable_openapi_validation = false
      + disable_webhooks           = false
      + force_update               = false
      + id                         = (known after apply)
      + lint                       = false
      + manifest                   = (known after apply)
      + max_history                = 0
      + metadata                   = (known after apply)
      + name                       = "signalilo"
      + namespace                  = "default"
      + pass_credentials           = false
      + recreate_pods              = false
      + render_subchart_notes      = true
      + replace                    = false
      + repository                 = "https://charts.appuio.ch"
      + reset_values               = false
      + reuse_values               = false
      + skip_crds                  = false
      + status                     = "deployed"
      + timeout                    = 300
      + values                     = [
          + <<-EOT
                config:
                  uuid: 9ec06d59-aa0c-4434-b5e2-1aeaf93cd925
                  icinga_hostname: signalilo_signalilo_test
                  icinga_url: https:/<redacted>:5665
                  icinga_username: signalilo_signalilo_test
                  icinga_password: <redacted>
                  alertmanager_bearer_token: aaaaaa
            EOT,
        ]
      + verify                     = false
      + version                    = "0.12.0"
      + wait                       = true
      + wait_for_jobs              = false

      + set {
          + name  = "extraEnvVars[0].name"
          + value = "SIGNALILO_ICINGA_INSECURE_TLS"
        }
      + set {
          + name  = "extraEnvVars[0].value"
          + type  = "string"
          + value = "true"
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

helm_release.signalilo: Creating...
helm_release.signalilo: Creation complete after 5s [id=signalilo]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants