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

check and return error from parsing var-files #10569

Merged
merged 2 commits into from
May 12, 2021

Conversation

drewbailey
Copy link
Contributor

@drewbailey drewbailey commented May 12, 2021

Fixes a cli panic when submitting a job with -var-file that does not exist.

I'm not sure if we want to return an generic error or include the hcl2 diagnostics error as well.

→ nomad job plan -var-file=does-no-exist.hcl https://raw.githubusercontent.com/hashicorp/demo-nomad-101/master/lab-2/http-echo.nomad
Error getting job struct: Failed to parse using HCL 2. Use the HCL 1 parser with `nomad run -hcl1`, or address the following issues:
unable to parse var file: <nil>: Failed to read file; failed to read "does-no-exist.hcl": open does-no-exist.hcl: no such file or directory

fixes: #10567

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM.

RC1 hasn't been cut yet so let's get this added to the changelog for 1.1.0, too.

@tgross tgross added this to the 1.1.0 milestone May 12, 2021
@drewbailey
Copy link
Contributor Author

failed ci test is unrelated, merging

@drewbailey drewbailey merged commit 4be7897 into main May 12, 2021
@drewbailey drewbailey deleted the hcl2/check-for-parse-error branch May 12, 2021 13:09
drewbailey added a commit that referenced this pull request May 12, 2021
* check and return error from parsing var-files

* changelog entry for 1.1.0 and 1.0.5
schmichael pushed a commit that referenced this pull request May 14, 2021
* check and return error from parsing var-files

* changelog entry for 1.1.0 and 1.0.5
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nomad cli panic runtime error if var file does not exist
2 participants