open-nomad/command/agent
Danielle Lancashire 8112177503
consul: Include port-label in service registration
It is possible to provide multiple identically named services with
different port assignments in a Nomad configuration.

We introduced a regression when migrating to stable service identifiers where
multiple services with the same name would conflict, and the last definition
would take precedence.

This commit includes the port label in the stable service identifier to
allow the previous behaviour where this was supported, for example
providing:

```hcl
service {
  name = "redis-cache"
  tags = ["global", "cache"]
  port = "db"
  check {
    name     = "alive"
    type     = "tcp"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "foo"]
  port = "foo"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "bar"]
  port = "bar"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}
```

in a nomad task definition is now completely valid. Each service
definition with the same name must still have a unique port label however.
2019-06-13 15:24:54 +02:00
..
consul consul: Include port-label in service registration 2019-06-13 15:24:54 +02:00
test-resources Add test to verify order 2015-12-04 17:12:47 -08:00
testdata agent/testdata add a configuration directory for testing 2019-06-11 16:34:04 -04:00
acl_endpoint.go Self token lookup 2017-10-13 13:12:20 -07:00
acl_endpoint_test.go spelling: bootstrap 2018-03-11 17:43:19 +00:00
agent.go client config flag to disable remote exec 2019-06-03 15:31:39 -04:00
agent_endpoint.go agent + consul 2018-09-13 10:43:40 -07:00
agent_endpoint_test.go Use in-mem rpc 2018-02-15 13:59:01 -08:00
agent_test.go agent + consul 2018-09-13 10:43:40 -07:00
alloc_endpoint.go alloc-lifecycle: Fix restart with empty body 2019-06-12 15:35:00 +02:00
alloc_endpoint_test.go allocs: Add nomad alloc signal command 2019-04-25 12:43:32 +02:00
bindata_assetfs.go Generate files for 0.9.2-rc1 release 2019-05-22 19:29:30 +00:00
command.go agent config: cleaner VAULT_ env lookup 2019-04-10 10:34:10 -05:00
command_test.go refactored config validation into a new method, modified Meta.Client 2019-01-08 15:07:36 +00:00
config.go command add comments re: defaults to LoadConfig 2019-06-11 22:35:43 -04:00
config_oss.go Allow separate enterprise config overlay 2018-03-22 13:53:08 -07:00
config_parse.go config_parse get rid of ParseConfigDefault 2019-06-11 22:00:23 -04:00
config_parse_test.go tests: parsing dir should be equivalent to parsing individual files 2019-06-12 08:19:09 -04:00
config_test.go client config flag to disable remote exec 2019-06-03 15:31:39 -04:00
deployment_endpoint.go Populate DisplayMessage in various http endpoints that return allocations, plus unit tests. 2017-11-17 14:53:26 -06:00
deployment_endpoint_test.go Populate DisplayMessage in various http endpoints that return allocations, plus unit tests. 2017-11-17 14:53:26 -06:00
eval_endpoint.go http: list results are never null 2015-09-07 10:03:10 -07:00
eval_endpoint_test.go spelling: output 2018-03-11 18:35:30 +00:00
fs_endpoint.go framer: fix early exit/truncation in framer 2018-05-02 10:46:16 -07:00
fs_endpoint_test.go tests: test via ServeMux so http codes are set 2018-10-16 16:56:55 -07:00
helpers.go client: expose task state to client 2018-10-16 16:56:55 -07:00
helpers_test.go Refactor determining the handler for a node id call 2018-02-15 13:59:02 -08:00
http.go agent: add websocket handler for nomad exec 2019-05-09 16:49:08 -04:00
http_oss.go sync 2017-10-13 14:36:02 -07:00
http_test.go fixing up raft reload tests 2018-01-17 10:29:15 -05:00
job_endpoint.go api use job.update as the default for taskgroup.update 2019-05-22 12:34:57 -04:00
job_endpoint_test.go api use job.update as the default for taskgroup.update 2019-05-22 12:34:57 -04:00
keyring.go Enable serf encryption (#1791) 2016-10-17 10:48:04 -07:00
keyring_test.go Standardize retrieving a free port into a helper package 2017-10-23 16:48:20 -07:00
log_levels.go agent: start basic logging setup 2015-08-16 13:54:49 -07:00
log_levels_test.go More parallel 2017-07-20 09:36:34 -07:00
log_writer.go Enable more linters 2017-09-26 15:26:33 -07:00
log_writer_test.go More parallel 2017-07-20 09:36:34 -07:00
metrics_endpoint.go agent + consul 2018-09-13 10:43:40 -07:00
metrics_endpoint_test.go test case for 5540 (#5590) 2019-04-30 10:31:35 -04:00
node_endpoint.go Add documentation for eligibility toggle endpoint 2018-08-24 10:50:12 -04:00
node_endpoint_test.go Use constant in test 2018-05-30 17:27:04 -05:00
operator_endpoint.go Rename to match system scheduler config. 2019-05-03 14:06:12 -05:00
operator_endpoint_test.go nomad: disable service+batch preemption by default 2019-06-04 15:54:50 -07:00
plugins.go move pluginutils -> helper/pluginutils 2019-01-22 15:50:08 -08:00
region_endpoint.go website: document regions endpoint 2015-11-24 09:38:07 -08:00
region_endpoint_test.go More parallel 2017-07-20 09:36:34 -07:00
retry_join.go agent + consul 2018-09-13 10:43:40 -07:00
retry_join_test.go agent + consul 2018-09-13 10:43:40 -07:00
search_endpoint.go Sync namespace changes 2017-09-07 17:04:21 -07:00
search_endpoint_test.go add deployments to search api 2017-08-21 15:20:55 +00:00
stats_endpoint.go Server side impl + touch ups 2018-02-15 13:59:02 -08:00
stats_endpoint_test.go Fix failing test TestClientStatusRequest 2018-05-30 15:11:54 -05:00
status_endpoint.go http: adding status APIs 2015-09-06 18:39:03 -07:00
status_endpoint_test.go More parallel 2017-07-20 09:36:34 -07:00
stub_asset.go sync 2017-09-19 10:08:23 -05:00
syslog.go goimports 2019-01-22 15:44:31 -08:00
syslog_test.go goimports 2019-01-22 15:44:31 -08:00
system_endpoint.go Added an endpoint for users to reconcile job summaries 2016-08-03 16:12:47 -07:00
system_endpoint_test.go More parallel 2017-07-20 09:36:34 -07:00
testagent.go Move logger initialization to earlier step 2019-02-21 12:41:54 -06:00
testingutils_test.go api: remove MockJob from exported functions 2019-01-18 14:51:31 -05:00