fix: multiline cronjob validation#459
Conversation
|
@shreddedbacon Given @jnsalsa's comment here: #441 (comment), I believe this is ready for a brief review. |
Can you update branch to latest main too please |
rocketeerbkw
left a comment
There was a problem hiding this comment.
Functionally correct. My nitpicks are just my opinion, not required to be addressed.
| command | ||
|
|
||
| - name: block scalar folded clipped | ||
| - name: block scalar folded clipped blank newline |
There was a problem hiding this comment.
clipped blank newline is redundant because clipped already means blank newline
Link to definitions is at the top of this file:
The default,
clip, puts a single newline at the end of the string.
| //if inpod || (cronjob.InPod != nil && *cronjob.InPod) { | ||
| if *cronjob.InPod { | ||
| cmd := cronjob.Command | ||
| // Safely accommodate cronjobs with trailing whitespace due to yaml `>` syntax |
There was a problem hiding this comment.
This kind of comment is explaining they why of a change, not the why of the code, and IMO it is better placed in a commit message instead of code.
Why does this code have a TrimSpace? To match the validator which trims trailing whitespace. <-- code comment
Why did we change to add TrimSpace here? Because yaml > has a trailing space that was caught in validator but not here. <-- git commit message
f50baa4 to
4d3563e
Compare
Successor of #441.
Closes #441
Closes #442