product-os / katapult

A tool for launching environment variants on different modes and targets, based on kompose format files.
Apache License 2.0
8 stars 1 forks source link

`generate` converts `boolean` and `number` typed env vars to strings #62

Open codewithcheese opened 3 years ago

codewithcheese commented 3 years ago

When using the generate command all env var values are wrapped with double quotes despite their type.

This also breaks template sections based on a boolean since true/false are converted to strings. To work around this the variable must be optional and the value "" to satisfy the false case and "any value" to satisfy the true case.

cmfcruz commented 3 years ago

To elaborate, the envfile is modified by Katapult during generate and wraps the values with quotes. This converts booleans and numbers to strings.

Sample environment.yml:

version: v1.0.0
config-store:
  envfile:
    path: environment

Sample environment file before generate:

QUERIER_REPLICAS=1
PROMTAIL_ENABLED=false
AWS_REGION="us-east-1"

Sample environment file after generate:

QUERIER_REPLICAS="1"
PROMTAIL_ENABLED="false"
AWS_REGION="us-east-1"