-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Make validate command ignore environment variables in service name #3558
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
05d52b6
Changes service name validation logic to ignore any environment varia…
f630ae3
Update documentation about validation logic for service names.
38798c8
Adding some more explanatory text around validating
800c6e3
Update validate.html.md.erb
436a5f7
Move service validation explanation doc
24f9632
Rewording for clarity
f75e4c1
Change error message to use original name for clarity, rather than th…
800f5cb
Remove documentation around service name validation
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,14 @@ and supports `go-getter` syntax. | |
On successful validation, exit code 0 will be returned, otherwise an exit code | ||
of 1 indicates an error. | ||
|
||
Service names are validated according to [RFC-1123](https://tools.ietf.org/html/rfc1123). | ||
Any environment variables in the name are ignored, because some environment variables can only | ||
be resolved at run time. Invalid characters outside of environment variable names will not pass | ||
validation. | ||
For example, if the service name is set to `my_service${NOMAD_NODE_NAME}` it will fail | ||
validation. However, if a service name is set to `myservice{NOMAD_NODE_NAME}` and the node name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
contains an invalid character, it will only be caught at run time and nomad validate will succeed. | ||
|
||
## Examples | ||
|
||
Validate a job with invalid syntax: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove from here and instead add to: https://www.nomadproject.io/docs/job-specification/service.html#name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a fan of any specific validation details on this page since then we will end up documenting validation details here and on the specific stanzas.