-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gh-476] Sanitise HCL variables before storing on job submission #24423
Conversation
4d40732
to
4d11ca7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Testing this out made me remember we have two different variable-related properties in Job submission data: Lines 978 to 984 in e206993
I think that VariableFlags are affected here, but Variables are not. I'm not sure if the bug in question could show up in that format, but wanted to mention it. ========================= All that aside, I'm also noticing some perhaps erroneous character additions. Here are screenshots showing VariableFlags and output for a job where a cli-provided multi-line variable has a command to run was:
Note the |
4d11ca7
to
677636d
Compare
…e-multi-line cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Currently Nomad only handles HCL variables with new lines, any other non alphanumeric character is left untouched and stored unescaped, which can cause errors while re starting a stopped job, particularly from the UI.
it fixes #476
Testing & Reproduction steps
Links
Contributor Checklist
changelog entry using the
make cl
command.ensure regressions will be caught.
and job configuration, please update the Nomad website documentation to reflect this. Refer to
the website README for docs guidelines. Please also consider whether the
change requires notes within the upgrade guide.
Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.