Skip to content

Commit e22233d

Browse files
maltesanderclaude
andcommitted
fix(tests): place vector_enabled conditional at column 0
The `{% if vector_enabled -%}` and `{%- endif %}` blocks had 6 leading spaces. When vector_enabled was false, jinja2's strip markers joined the leading whitespace of both blocks, putting YAMLEOF at 12 spaces in the rendered output. After the kuttl YAML block scalar strips 6 common-leading spaces, YAMLEOF ended up at 6 spaces inside the script body, but the heredoc opener is `<<'YAMLEOF'` (not `<<-`), which requires the terminator at column 0. The heredoc therefore never closed and `\$(...)` never terminated, producing `Syntax error: end of file unexpected (expecting ")")` from dash. Moving `{% if %}` and `{% endif %}` to column 0 (no strip markers) mirrors kafka-operator's 34-assert.yaml.j2 pattern and renders both branches with YAMLEOF at the correct indent. Verified: - non-vector render: 8 scripts pass against kuttl-test-fluent-mastodon - vector render heredoc parses to the 5 expected keys (jvm.config, log4j2.properties, runtime.properties, security.properties, vector.yaml) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 282b0e5 commit e22233d

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tests/templates/kuttl/smoke/53-assert.yaml.j2

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -724,10 +724,10 @@ commands:
724724
security.properties: |
725725
networkaddress.cache.negative.ttl=0
726726
networkaddress.cache.ttl=30
727-
{% if vector_enabled -%}
727+
{% if vector_enabled %}
728728
vector.yaml: |
729729
{{ vector_yaml | replace("__ROLE__", "broker") | indent(8, true) }}
730-
{%- endif %}
730+
{% endif %}
731731
YAMLEOF
732732
)
733733
actual=$(kubectl -n $NAMESPACE get cm druid-broker-default -o yaml \
@@ -830,10 +830,10 @@ commands:
830830
security.properties: |
831831
networkaddress.cache.negative.ttl=0
832832
networkaddress.cache.ttl=30
833-
{% if vector_enabled -%}
833+
{% if vector_enabled %}
834834
vector.yaml: |
835835
{{ vector_yaml | replace("__ROLE__", "coordinator") | indent(8, true) }}
836-
{%- endif %}
836+
{% endif %}
837837
YAMLEOF
838838
)
839839
actual=$(kubectl -n $NAMESPACE get cm druid-coordinator-default -o yaml \
@@ -936,10 +936,10 @@ commands:
936936
security.properties: |
937937
networkaddress.cache.negative.ttl=0
938938
networkaddress.cache.ttl=30
939-
{% if vector_enabled -%}
939+
{% if vector_enabled %}
940940
vector.yaml: |
941941
{{ vector_yaml | replace("__ROLE__", "historical") | indent(8, true) }}
942-
{%- endif %}
942+
{% endif %}
943943
YAMLEOF
944944
)
945945
actual=$(kubectl -n $NAMESPACE get cm druid-historical-default -o yaml \
@@ -1039,10 +1039,10 @@ commands:
10391039
druid.indexer.runner.javaOptsArray=["-Djavax.net.ssl.trustStore\=/stackable/truststore.p12",\ "-Djavax.net.ssl.trustStorePassword\=changeit",\ "-Djavax.net.ssl.trustStoreType\=pkcs12"]
10401040
networkaddress.cache.negative.ttl=0
10411041
networkaddress.cache.ttl=30
1042-
{% if vector_enabled -%}
1042+
{% if vector_enabled %}
10431043
vector.yaml: |
10441044
{{ vector_yaml | replace("__ROLE__", "middlemanager") | indent(8, true) }}
1045-
{%- endif %}
1045+
{% endif %}
10461046
YAMLEOF
10471047
)
10481048
actual=$(kubectl -n $NAMESPACE get cm druid-middlemanager-default -o yaml \
@@ -1140,10 +1140,10 @@ commands:
11401140
security.properties: |
11411141
networkaddress.cache.negative.ttl=0
11421142
networkaddress.cache.ttl=30
1143-
{% if vector_enabled -%}
1143+
{% if vector_enabled %}
11441144
vector.yaml: |
11451145
{{ vector_yaml | replace("__ROLE__", "router") | indent(8, true) }}
1146-
{%- endif %}
1146+
{% endif %}
11471147
YAMLEOF
11481148
)
11491149
actual=$(kubectl -n $NAMESPACE get cm druid-router-default -o yaml \

0 commit comments

Comments
 (0)