open-nomad/nomad
Tim Gross f61f801e77
provide RPCContext to all RPC handlers (#15430)
Upcoming work to instrument the rate of RPC requests by consumer (and eventually
rate limit) requires that we thread the `RPCContext` through all RPC
handlers so that we can access the underlying connection. This changeset adds
the context to everywhere we intend to initially support it and intentionally
excludes streaming RPCs and client RPCs.

To improve the ergonomics of adding the context everywhere its needed and to
clarify the requirements of dynamic vs static handlers, I've also done a good
bit of refactoring here:

* canonicalized the RPC handler fields so they're as close to identical as
  possible without introducing unused fields (i.e. I didn't add loggers if the
  handler doesn't use them already).
* canonicalized the imports in the handler files.
* added a `NewExampleEndpoint` function for each handler that ensures we're
  constructing the handlers with the required arguments.
* reordered the registration in server.go to match the order of the files (to
  make it easier to see if we've missed one), and added a bunch of commentary
  there as to what the difference between static and dynamic handlers is.
2022-12-01 10:05:15 -05:00
..
deploymentwatcher cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
drainer cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
mock acl: sso auth method RPC endpoints (#15221) 2022-11-21 10:15:39 +01:00
state scheduler: create placements for non-register MRD (#15325) 2022-11-25 12:45:34 -05:00
stream event stream: ensure token expiry is correctly checked for subs. 2022-10-27 13:08:05 -04:00
structs acl: sso auth methods RPC/API/CLI should return created or updated objects (#15410) 2022-11-29 07:36:36 +01:00
volumewatcher volumewatcher: prevent panic on nil volume (#15101) 2022-11-01 16:53:10 -04:00
acl.go Merge branch 'main' into f-gh-13120-sso-umbrella-merged-main 2022-08-25 12:14:29 +01:00
acl_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
acl_endpoint_test.go acl: sso auth methods RPC/API/CLI should return created or updated objects (#15410) 2022-11-29 07:36:36 +01:00
acl_test.go deps: update set and test (#14680) 2022-09-26 08:28:03 -05:00
alloc_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
alloc_endpoint_test.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
autopilot.go autopilot: include only servers from the same region (#15290) 2022-11-17 12:09:36 -05:00
autopilot_oss.go migrate autopilot implementation to raft-autopilot (#14441) 2022-09-01 14:27:10 -04:00
autopilot_test.go autopilot: include only servers from the same region (#15290) 2022-11-17 12:09:36 -05:00
blocked_evals.go cleanup: remove more copies of min/max from helper 2022-08-24 09:56:15 -05:00
blocked_evals_stats.go metrics: even classless blocked evals get metrics 2022-07-15 14:12:44 -05:00
blocked_evals_stats_test.go metrics: even classless blocked evals get metrics 2022-07-15 14:12:44 -05:00
blocked_evals_system.go
blocked_evals_test.go
client_agent_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
client_agent_endpoint_test.go Data race fixes in tests and a new semgrep rule (#14594) 2022-09-15 10:35:08 -07:00
client_alloc_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
client_alloc_endpoint_test.go Data race fixes in tests and a new semgrep rule (#14594) 2022-09-15 10:35:08 -07:00
client_csi_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
client_csi_endpoint_test.go client: fix data races in config handling (#14139) 2022-08-18 16:32:04 -07:00
client_fs_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
client_fs_endpoint_test.go
client_rpc.go
client_rpc_test.go
client_stats_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
client_stats_endpoint_test.go
config.go sso: add ACL auth-method HTTP API CRUD endpoints (#15338) 2022-11-23 09:38:02 +01:00
consul.go consul: Removed unused ConsulUsage.Kinds. (#11303) 2022-09-22 10:07:14 -05:00
consul_oss_test.go consul: Removed unused ConsulUsage.Kinds. (#11303) 2022-09-22 10:07:14 -05:00
consul_policy.go
consul_policy_oss_test.go
consul_policy_test.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
consul_test.go
core_sched.go variables: limit rekey eval to half the nack timeout (#15102) 2022-11-01 16:50:50 -04:00
core_sched_test.go keyring: safely handle missing keys and restore GC (#15092) 2022-11-01 15:00:50 -04:00
csi_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
csi_endpoint_test.go CSI: ensure initial unpublish state is checkpointed (#14675) 2022-09-27 08:43:45 -04:00
deployment_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
deployment_endpoint_test.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
deployment_watcher_shims.go
drainer_int_test.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
drainer_shims.go
encrypter.go keyring: update handle to state inside replication loop (#15227) 2022-11-17 08:40:12 -05:00
encrypter_test.go keyring: update handle to state inside replication loop (#15227) 2022-11-17 08:40:12 -05:00
endpoints_oss.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
eval_broker.go eval broker: shed all but one blocked eval per job after ack (#14621) 2022-11-16 16:10:11 -05:00
eval_broker_test.go eval broker: shed all but one blocked eval per job after ack (#14621) 2022-11-16 16:10:11 -05:00
eval_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
eval_endpoint_test.go eval delete: move batching of deletes into RPC handler and state (#15117) 2022-11-14 14:08:13 -05:00
event_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
event_endpoint_test.go event stream: ensure token expiry is correctly checked for subs. 2022-10-27 13:08:05 -04:00
fsm.go scheduler: create placements for non-register MRD (#15325) 2022-11-25 12:45:34 -05:00
fsm_oss.go
fsm_registry_oss.go
fsm_test.go acl: sso auth method RPC endpoints (#15221) 2022-11-21 10:15:39 +01:00
heartbeat.go
heartbeat_test.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
job_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
job_endpoint_hook_connect.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
job_endpoint_hook_connect_test.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
job_endpoint_hook_expose_check.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
job_endpoint_hook_expose_check_test.go build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
job_endpoint_hook_vault.go cleanup more helper updates (#14638) 2022-09-21 14:53:25 -05:00
job_endpoint_hook_vault_oss.go
job_endpoint_hooks.go servicedisco: implicit constraint for nomad v1.4 when using nsd checks (#14868) 2022-10-11 08:21:42 -05:00
job_endpoint_hooks_test.go servicedisco: implicit constraint for nomad v1.4 when using nsd checks (#14868) 2022-10-11 08:21:42 -05:00
job_endpoint_oss.go scheduler: create placements for non-register MRD (#15325) 2022-11-25 12:45:34 -05:00
job_endpoint_oss_test.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
job_endpoint_test.go [ui] Adds meta to job list stub and displays a pack logo on the jobs index (#14833) 2022-11-02 16:58:24 -04:00
job_endpoint_validators.go
job_endpoint_validators_test.go allocrunner: refactor task coordinator (#14009) 2022-08-22 18:38:49 -04:00
keyring_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
keyring_endpoint_test.go keyring: use nanos for CreateTime in key metadata (#13849) 2022-07-20 14:46:57 -04:00
leader.go acl: replicate auth-methods from federated cluster leaders. (#15366) 2022-11-28 09:20:24 +01:00
leader_oss.go
leader_test.go acl: replicate auth-methods from federated cluster leaders. (#15366) 2022-11-28 09:20:24 +01:00
merge.go
namespace_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
namespace_endpoint_test.go
node_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
node_endpoint_test.go Update alloc after reconnect and enforece client heartbeat order (#15068) 2022-11-04 16:25:11 -04:00
operator_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
operator_endpoint_test.go
periodic.go make version checks specific to region (1.4.x) (#14912) 2022-10-17 16:23:51 -04:00
periodic_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
periodic_endpoint_test.go
periodic_test.go
plan_apply.go keyring: safely handle missing keys and restore GC (#15092) 2022-11-01 15:00:50 -04:00
plan_apply_node_tracker.go Track plan rejection history and automatically mark clients as ineligible (#13421) 2022-07-12 18:40:20 -04:00
plan_apply_node_tracker_test.go Track plan rejection history and automatically mark clients as ineligible (#13421) 2022-07-12 18:40:20 -04:00
plan_apply_oss.go
plan_apply_pool.go
plan_apply_pool_test.go
plan_apply_test.go fix panic from keyring raft entries being written during upgrade (#14821) 2022-10-06 12:47:02 -04:00
plan_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
plan_endpoint_test.go
plan_normalization_test.go
plan_queue.go Add missing timer reset (#15134) 2022-11-03 18:57:57 -04:00
plan_queue_test.go
raft_rpc.go
regions_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
regions_endpoint_test.go
rpc.go
rpc_test.go
scaling_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
scaling_endpoint_test.go
search_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
search_endpoint_oss.go rename SecureVariables to Variables throughout 2022-08-26 16:06:24 -04:00
search_endpoint_test.go
serf.go migrate autopilot implementation to raft-autopilot (#14441) 2022-09-01 14:27:10 -04:00
serf_test.go ci: fix TestNomad_BootstrapExpect_NonVoter test (#14407) 2022-08-30 16:32:54 -04:00
server.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
server_setup.go core: move LicenseConfig to shared file (#14247) 2022-08-23 13:44:10 -07:00
server_setup_oss.go migrate autopilot implementation to raft-autopilot (#14441) 2022-09-01 14:27:10 -04:00
server_test.go vault: detect namespace change in config reload (#14298) 2022-08-24 17:03:29 -04:00
service_registration_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
service_registration_endpoint_test.go deps: update set and test (#14680) 2022-09-26 08:28:03 -05:00
stats_fetcher.go migrate autopilot implementation to raft-autopilot (#14441) 2022-09-01 14:27:10 -04:00
stats_fetcher_test.go test: fix concurrent map access in TestStatsFetcher (#14496) 2022-09-08 10:41:15 -04:00
status_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
status_endpoint_test.go
system_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
system_endpoint_test.go
testing.go keystore serialization (#13106) 2022-07-11 13:34:04 -04:00
testing_oss.go
timetable.go
timetable_test.go
util.go make version checks specific to region (1.4.x) (#14912) 2022-10-17 16:23:51 -04:00
util_test.go make version checks specific to region (1.4.x) (#14912) 2022-10-17 16:23:51 -04:00
variables_endpoint.go provide RPCContext to all RPC handlers (#15430) 2022-12-01 10:05:15 -05:00
variables_endpoint_test.go keyring: safely handle missing keys and restore GC (#15092) 2022-11-01 15:00:50 -04:00
vault.go cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
vault_test.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
vault_testing.go vault: detect namespace change in config reload (#14298) 2022-08-24 17:03:29 -04:00
worker.go make version checks specific to region (1.4.x) (#14912) 2022-10-17 16:23:51 -04:00
worker_string_schedulerworkerstatus.go
worker_string_workerstatus.go
worker_test.go eval broker: shed all but one blocked eval per job after ack (#14621) 2022-11-16 16:10:11 -05:00