Skip to content

Commit

Permalink
Merge pull request #3766 from hashicorp/b-example-service-name
Browse files Browse the repository at this point in the history
Make example service name make sense
  • Loading branch information
schmichael authored Jan 19, 2018
2 parents 3b95662 + 94e6b9c commit 7fe2993
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions api/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func TestJobs_Canonicalize(t *testing.T) {
},
Services: []*Service{
{
Name: "global-redis-check",
Name: "redis-cache",
Tags: []string{"global", "cache"},
PortLabel: "db",
Checks: []ServiceCheck{
Expand Down Expand Up @@ -368,7 +368,7 @@ func TestJobs_Canonicalize(t *testing.T) {
},
Services: []*Service{
{
Name: "global-redis-check",
Name: "redis-cache",
Tags: []string{"global", "cache"},
PortLabel: "db",
AddressMode: "auto",
Expand Down
2 changes: 1 addition & 1 deletion command/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ job "example" {
# https://www.nomadproject.io/docs/job-specification/service.html
#
service {
name = "global-redis-check"
name = "redis-cache"
tags = ["global", "cache"]
port = "db"
check {
Expand Down
4 changes: 2 additions & 2 deletions ui/mirage/factories/job-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ function generateDiff(version) {
{
Annotations: null,
Name: 'Name',
New: 'global-redis-check',
Old: 'global-redis-check',
New: 'redis-cache',
Old: 'redis-cache',
Type: 'None',
},
{
Expand Down
2 changes: 1 addition & 1 deletion website/source/api/allocations.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ $ curl \
"Env": null,
"Services": [
{
"Name": "global-redis-check",
"Name": "redis-cache",
"PortLabel": "db",
"Tags": [
"global",
Expand Down
4 changes: 2 additions & 2 deletions website/source/api/jobs.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The table below shows this endpoint's support for
},
"Services": [{
"Id": "",
"Name": "global-redis-check",
"Name": "redis-cache",
"Tags": [
"global",
"cache"
Expand Down Expand Up @@ -519,7 +519,7 @@ $ curl \
"Env": null,
"Services": [
{
"Name": "global-redis-check",
"Name": "redis-cache",
"PortLabel": "db",
"Tags": [
"global",
Expand Down
2 changes: 1 addition & 1 deletion website/source/api/json-jobs.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Below is the JSON representation of the job outputted by `$ nomad init`:
},
"Services": [{
"Id": "",
"Name": "global-redis-check",
"Name": "redis-cache",
"Tags": [
"global",
"cache"
Expand Down
2 changes: 1 addition & 1 deletion website/source/api/nodes.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ $ curl \
"Env": null,
"Services": [
{
"Name": "global-redis-check",
"Name": "redis-cache",
"PortLabel": "db",
"AddressMode": "auto",
"Tags": [
Expand Down
13 changes: 7 additions & 6 deletions website/source/docs/job-specification/service.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ does not automatically enable service discovery.
define multiple checks for the service. At this time, Nomad supports the
`script`<sup><small>1</small></sup>, `http` and `tcp` checks.

- `name` `(string: "<job>-<group>-<task>")` - Specifies the name of this
service. If not supplied, this will default to the name of the job, group, and
task concatenated together with a dash, like `"docs-example-server"`. Each
service must have a unique name within the cluster. Names must adhere to
[RFC-1123 §2.1](https://tools.ietf.org/html/rfc1123#section-2) and are limited
to alphanumeric and hyphen characters (i.e. `[a-z0-9\-]`), and be less than 64
- `name` `(string: "<job>-<group>-<task>")` - Specifies the name this service
will be advertised as in Consul. If not supplied, this will default to the
name of the job, group, and task concatenated together with a dash, like
`"docs-example-server"`. Each service must have a unique name within the
cluster. Names must adhere to [RFC-1123
§2.1](https://tools.ietf.org/html/rfc1123#section-2) and are limited to
alphanumeric and hyphen characters (i.e. `[a-z0-9\-]`), and be less than 64
characters in length.

In addition to the standard [Nomad interpolation][interpolation], the
Expand Down

0 comments on commit 7fe2993

Please sign in to comment.