Skip to content

fix: multiline cronjob validation#459

Open
jackwrfuller wants to merge 1 commit into
uselagoon:mainfrom
jackwrfuller:fix-multiline-cron
Open

fix: multiline cronjob validation#459
jackwrfuller wants to merge 1 commit into
uselagoon:mainfrom
jackwrfuller:fix-multiline-cron

Conversation

@jackwrfuller

@jackwrfuller jackwrfuller commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Successor of #441.

Closes #441
Closes #442

@jackwrfuller

Copy link
Copy Markdown
Contributor Author

@shreddedbacon Given @jnsalsa's comment here: #441 (comment), I believe this is ready for a brief review.

@shreddedbacon

Copy link
Copy Markdown
Member

@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 rocketeerbkw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

Invalid multiline cronjob validation

4 participants