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

-json option on jobs status command #18925

Merged
merged 10 commits into from Mar 8, 2024

Conversation

geovannyAvelar
Copy link
Contributor

#16566

This modification dumps the entire job struct in JSON format. I don't know if just dumps the entire struct is the better approach, if not, i can expose specific fields.

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.

Hi @geovannyAvelar! I know this is still in draft but just a heads up that the approach you've got here is essentially what the existing nomad job inspect does. The goal described in #16566 is to have the whole command's output in some JSON-structured way, which includes a lot of ancillary information like the allocations, deployments, etc.

@geovannyAvelar
Copy link
Contributor Author

Hello @tgross! I made some changes. Now when -json option is included in nomad job status command, we output same data of nomad job status command (evals, allocations, latest deployment and summary). Please let me know if I need to change or include something. Do I need to include something different when handling periodic or parameterized jobs?

command/job_status.go Outdated Show resolved Hide resolved
command/job_status.go Show resolved Hide resolved
command/job_status.go Outdated Show resolved Hide resolved
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.

This is looking great @geovannyAvelar. To get this merged:

  • Run make cl to add a changelog entry
  • Add documentation for the new command flag in website/content/docs/commands/job/status.mdx
  • Mark the PR as ready-for-review

command/job_status.go Outdated Show resolved Hide resolved
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!

I've made a minor adjustment to the changelog entry. Once CI is green I'll get this merged for the next 1.7.x release. Thanks @geovannyAvelar!

@tgross tgross moved this from Triaging to In Progress in Nomad - Community Issues Triage Mar 8, 2024
@tgross tgross added this to the 1.7.x milestone Mar 8, 2024
@tgross tgross added type/enhancement backport/1.7.x backport to 1.7.x release line labels Mar 8, 2024
@tgross
Copy link
Member

tgross commented Mar 8, 2024

Bah, sorry @geovannyAvelar, it looks like I led you astray with the structs package, as we have a linter than prevents that import (see #13938, which I approved 🤦 ). I've fixed that up for you.

@tgross tgross merged commit 26a27bb into hashicorp:main Mar 8, 2024
19 of 20 checks passed
Nomad - Community Issues Triage automation moved this from In Progress to Done Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants