pulumi-kubernetes icon indicating copy to clipboard operation
pulumi-kubernetes copied to clipboard

HelmRelease causes a line break on long values

Open ChristianRaoulis opened this issue 8 months ago • 1 comments

What happened?

I'm trying to add some prometheus rules to my rabbitmq bitnami helm chart and pulumi seems to add a \n on a point where it causes an unterminated quoted string error on pulumi up

Example

const rabbitMQ = new HelmRelease("rabbitmq", {
   chart:          "rabbitmq",
   version:        "14.1.2",
   repositoryOpts: {
      repo: "https://charts.bitnami.com/bitnami",
   },
   values:         {
      metrics: {
         enabled:        true,
         prometheusRule: {
            enabled:   true,
            rules:     [
               {
                  alert:       "RabbitmqInstancesDifferentVersions",
                  expr:        'count(count(rabbitmq_build_info) by (rabbitmq_version)) > 1',
                  for:         '60m',
                  labels:      {
                     severity: "warning",
                  },
                  annotations: {
                     summary:     'RabbitMQ instances running different versions (instance {{ "{{ $labels.instance }}" }})', // <-- this get's converted to "RabbitMQ instances running different versions (instance {{ \"{{ $labels.instance\n      }}\" }})"
                     description: 'Running different version of RabbitMQ in the same cluster, can lead to failure.\n   VALUE = {{ "{{ $value }}" }}\n LABELS = {{ "{{ $labels }}" }}',
                  },
               },
            ],
         },
      },
   },
});

Output of pulumi about

CLI          
Version      3.107.0
Go Version   go1.22.0
Go Compiler  gc

Plugins
NAME          VERSION
command       0.11.1
keycloak      5.3.2
kubernetes    4.13.1
mongodbatlas  3.16.0
nodejs        unknown
postgresql    3.11.1
random        4.16.2

Host     
OS       Microsoft Windows 11 Enterprise
Version  10.0.22631 Build 22631
Arch     x86_64

This project is written in nodejs: executable='C:\Users\A92615470\AppData\Local\pnpm\node.exe' version='v20.14.0'

Additional context

// In my arg 
RabbitMQ instances running different versions (instance {{ "{{ $labels.instance }}" }})
// In values.yaml
RabbitMQ instances running different versions (instance {{ "{{ $labels.instance\n      }}" }})

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

ChristianRaoulis avatar Jun 14 '24 15:06 ChristianRaoulis