api: handle newlines in JobSubmission vars correctly (#23560)

Fixes a bug where variable values in job submissions that contained newlines
weren't encoded correctly, and thus jobs that contained them couldn't be
resumed once stopped via the UI.

Internal ref: https://hashicorp.atlassian.net/browse/NET-9966
This commit is contained in:
Piotr Kazmierczak
2024-07-12 08:04:27 +02:00
committed by GitHub
parent 75722ef93e
commit fa8ffedd74
4 changed files with 24 additions and 0 deletions

View File

@@ -908,6 +908,8 @@ func apiJobSubmissionToStructs(submission *api.JobSubmission) *structs.JobSubmis
if submission == nil {
return nil
}
submission.Canonicalize()
return &structs.JobSubmission{
Source: submission.Source,
Format: submission.Format,