Location
src/cli/generator/compose.rs:602 — the render() function's env emission loop.
Problem
The env renderer uses a naive format string:
format!(" {}: \"{}\"\n", key, value)
This has three bugs:
1. Multiline values are folded into a single line
YAML double-quoted scalars fold newlines into spaces. A multiline env value like:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://git.example.com'
nginx['listen_port'] = 80
arrives at docker compose config as:
external_url 'http://git.example.com' nginx['listen_port'] = 80 ...
which is a Ruby syntax error — gitlab-ctl reconfigure never applies it.
2. Unescaped " in values
Values containing literal double quotes break the YAML scalar quoting.
3. yaml_quote already exists and is not used
yaml_quote at line 561 handles escaping but is not called on the env emission path.
Fix
Use a YAML block scalar (|) for values containing newlines, and call yaml_quote for simple values. The change is in the env emission loop in render().
Impact
Every stack with a multiline env value. Confirmed with the GitLab CE stack (GITLAB_OMNIBUS_CONFIG).
Separate issues (do not bundle)
shm_size silently dropped from generated compose
- Double-wrapped
CMD-SHELL in healthcheck (CMD-SHELL CMD-SHELL ...)
Location
src/cli/generator/compose.rs:602— therender()function's env emission loop.Problem
The env renderer uses a naive format string:
This has three bugs:
1. Multiline values are folded into a single line
YAML double-quoted scalars fold newlines into spaces. A multiline env value like:
arrives at
docker compose configas:which is a Ruby syntax error —
gitlab-ctl reconfigurenever applies it.2. Unescaped
"in valuesValues containing literal double quotes break the YAML scalar quoting.
3.
yaml_quotealready exists and is not usedyaml_quoteat line 561 handles escaping but is not called on the env emission path.Fix
Use a YAML block scalar (
|) for values containing newlines, and callyaml_quotefor simple values. The change is in the env emission loop inrender().Impact
Every stack with a multiline env value. Confirmed with the GitLab CE stack (
GITLAB_OMNIBUS_CONFIG).Separate issues (do not bundle)
shm_sizesilently dropped from generated composeCMD-SHELLin healthcheck (CMD-SHELL CMD-SHELL ...)