Skip to content

fix: quote rendered env values in app store templates - #187

Merged
hsluoyz merged 1 commit into
casosorg:masterfrom
WuShang-d:fix/template-env-quotes
Oct 31, 2026
Merged

hsluoyz merged 1 commit into
casosorg:masterfrom
WuShang-d:fix/template-env-quotes

Conversation

@WuShang-d

@WuShang-d WuShang-d commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An app-store template that renders an env value to a bare YAML number or boolean, for example a chart shipping SESSION_LIFETIME as value: 12000 or a TLS flag as value: false, hands the apiserver a number or bool where env[].value must be a string, so the workload is rejected and never created.

apply now walks each rendered document and turns env values that came out as numbers or booleans back into strings before sending them, so such templates install without the chart having to quote every value.

Verification

  • go build ./..., go vet ./...
  • Exercised quoteEnvValues on a rendered Deployment manifest: env values 8080 (float), 2 (int64) and true (bool) each became the equivalent string, and already-string values were untouched.
  • On a casos install with a real Linux worker node, installed the sealos catalog template liebianbao (it ships numeric env values such as SESSION_LIFETIME: 12000 and REDIS_CACHE_DB: 1, plus boolean ones) before and after this change. Before: the StatefulSet is rejected with json: cannot unmarshal bool into Go struct field EnvVar.spec.template.spec.containers.env.value of type string and no workload is created. After: the StatefulSet is created and its pod is scheduled; the template's remaining install problems are its own unsupported parts (a cert-manager Issuer/Certificate and a mongodb provider casos has no engine for) and are untouched by this change.

@hsluoyz
hsluoyz merged commit 753c2ad into casosorg:master Oct 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants