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: Allow user to specify dest filename for nomad init #6520

Merged
merged 5 commits into from
Dec 19, 2019

Conversation

angrycub
Copy link
Contributor

This PR simplifies the user experience of using nomad init to create job skeletons by allowing them to specify the job file name as an optional positional argument to the command.

command/job_init.go Outdated Show resolved Hide resolved
Co-Authored-By: Michael Schurter <[email protected]>
Copy link
Contributor

@notnoop notnoop left a comment

Choose a reason for hiding this comment

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

I would suggest accepting as an option (e.g. nomad init -o example.nomad) rather than a positional argument, given that init already takes an option, --short.

@schmichael
Copy link
Member

Since init always creates a file I think a positional argument is fine. It makes it nicely mirror nomad run which is the likely next command to be run:

nomad init foo.nomad
nomad run foo.nomad

-short and -connect modify the file, so I think flags are the right representation for them.

@shantanugadgil
Copy link
Contributor

Just to "pile on" the enhancements ... how about an option for each of the type of tasks as well.

Most of the time I want to quickly experiment with raw_exec and have to gut and fillet the default docker job file. 🐟 😸

This is mostly due to the fact that the real "in-use" raw_exec files have moved on and now have way too much "sensitive" information! 😄

@schmichael
Copy link
Member

Most of the time I want to quickly experiment with raw_exec and have to gut and fillet the default docker job file. fish smile_cat

This is mostly due to the fact that the real "in-use" raw_exec files have moved on and now have way too much "sensitive" information! smile
-- @shantanugadgil

Yes! I think a lot of us do that frequently, so the desire is definitely there. We've discussed making it templatable or maybe converting to HCLv2 could open up some options, but we've never landed on an exact approach. Mind opening a new issue with (1) your desired features and (2) any thoughts you on implementation?

@angrycub angrycub changed the title Allow user to specify dest filename for nomad init cli: Allow user to specify dest filename for nomad init Dec 19, 2019
@angrycub angrycub merged commit 0ff7c64 into master Dec 19, 2019
@angrycub angrycub deleted the f-allow-init-name branch December 19, 2019 19:59
@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 Jan 23, 2023
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.

4 participants