fix(agent): render the worker block with indent so long strings keep no newline - #566
Open
agustincelentano wants to merge 1 commit into
Open
fix(agent): render the worker block with indent so long strings keep no newline#566agustincelentano wants to merge 1 commit into
agustincelentano wants to merge 1 commit into
Conversation
…no newline The template re-emitted yamlencode(worker) line by line, leaving an empty line between every two lines. yamlencode folds strings longer than ~80 characters at a space, and inside a folded double-quoted scalar an empty line is a literal newline, so a long patch command reached the chart split in two without any plan or apply error. indent() keeps the block contiguous.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
nullplatform/agent/templates/nullplatform_agent_values.tmpl.yamlrenders theworkerblock withEvery iteration emits the line plus the template's own line break, so the rendered block has an empty line between every two lines. That is harmless for short values, but
yamlencodefolds strings longer than ~80 characters at a space (YAML double-quoted folding), and inside a folded scalar an empty line is a literal newline. A worker patch such asreaches the chart as
wget -qO- https://…/v0.1.0.tar.gz\n| tar …:sh -cruns thewgetalone and fails with a syntax error on the next line. Nothing surfaces in plan or apply; the failure shows up in the worker pod. Anyworker.patchesvalue with spaces past the fold width is affected (init container commands, args, env values with text).Hit in production while mounting the scopes-networking overlay into the lambda worker via an init container.
Fix
Render the block with
indent(2, yamlencode(worker)), which keeps the encoded lines contiguous. Output for every existing case is identical except for the removed blank lines.Tests
New run
long_worker_patch_strings_survive_renderingdecodes the rendered values and asserts the long command comes back intact. It fails onmainand passes with the fix; the module suite stays at 25/25.