Multiline variables in configMap from rancher-compose.yml

Hi!

Have one problem when trying use variables in configMap:

environment: Kubernetes
yml-file with configMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: elk-config
data:
  kibana.yml: |-
    ${KIBANA_CONFIG}

corresponding part of rancher-compose.yml

.catalog
[skipped some]
    - variable: "KIBANA_CONFIG"
      label: "kibana.yml file used to configure Kibana container"
      required: true
      type: multiline
      default: |-
        server.host: '0.0.0.0'
        server.port: 5601
        elasticsearch.url: 'http://elasticsearch:9200'

Result:

When I launch stack I’ve got only one (first) string in configMap. What I do wrong ?

I think this doesn’t work because the leading whitespace on each line is required but not added when replacing the variable. The default turns into a 3 line string with no whitespace in front because it’s interpreted by the YAML parser. But the variable replacement is not YAML-aware in any way, it’s just doing straight up string replacement. So the result is:

apiVersion: v1
kind: ConfigMap
metadata:
  name: elk-config
data:
  kibana.yml: |-
server.host: '0.0.0.0'
server.port: 5601
elasticsearch.url: 'http://elasticsearch:9200'

Which is one line of metadata (server.host) and 2 unrelated top-level keys, which happens to accidentally be valid YAML and not explode.