Skip to content
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

cli: fix panic on job plan when -diff=false #16944

Merged
merged 2 commits into from
Apr 21, 2023
Merged

Conversation

lgfa29
Copy link
Contributor

@lgfa29 lgfa29 commented Apr 20, 2023

PR #14492 introduced a new check to return 0 when the nomad job plan command returns a diff of type None.

But the -diff CLI flag was also being used to control whether the plan request should return the diff of not instead of just controlling if the diff was printed.

This means that when -diff=false is set the response does not include any diff information, and so the new check panics.

This commit fixes the problem by always requesting a diff and using the -diff only for controlling output, as it's currently documented.

Closes #16939

PR #14492 introduced a new check to return 0 when the `nomad job plan`
command returns a diff of type `None`.

But the `-diff` CLI flag was also being used to control whether the plan
request should return the diff of not instead of just controlling if the
diff was printed.

This means that when `-diff=false` is set the response does not include
any diff information, and so the new check panics.

This commit fixes the problem by always requesting a diff and using the
`-diff` only for controlling output, as it's currently documented.
@lgfa29 lgfa29 added backport/1.4.x backport to 1.4.x release line backport/1.5.x backport to 1.5.x release line and removed backport/1.4.x backport to 1.4.x release line labels Apr 20, 2023
@lgfa29 lgfa29 requested review from schmichael and tgross April 20, 2023 16:30
@lgfa29
Copy link
Contributor Author

lgfa29 commented Apr 20, 2023

#14492 mentions that the change will be released in the next 1.4 patch release, but the change wasn't actually backported so it only came out in 1.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIGSEGV on nomad plan
2 participants