open-nomad/nomad/structs
Michael Schurter 3e50f72fad
core: merge reserved_ports into host_networks (#13651)
Fixes #13505

This fixes #13505 by treating reserved_ports like we treat a lot of jobspec settings: merging settings from more global stanzas (client.reserved.reserved_ports) "down" into more specific stanzas (client.host_networks[].reserved_ports).

As discussed in #13505 there are other options, and since it's totally broken right now we have some flexibility:

Treat overlapping reserved_ports on addresses as invalid and refuse to start agents. However, I'm not sure there's a cohesive model we want to publish right now since so much 0.9-0.12 compat code still exists! We would have to explain to folks that if their -network-interface and host_network addresses overlapped, they could only specify reserved_ports in one place or the other?! It gets ugly.
Use the global client.reserved.reserved_ports value as the default and treat host_network[].reserverd_ports as overrides. My first suggestion in the issue, but @groggemans made me realize the addresses on the agent's interface (as configured by -network-interface) may overlap with host_networks, so you'd need to remove the global reserved_ports from addresses shared with a shared network?! This seemed really confusing and subtle for users to me.
So I think "merging down" creates the most expressive yet understandable approach. I've played around with it a bit, and it doesn't seem too surprising. The only frustrating part is how difficult it is to observe the available addresses and ports on a node! However that's a job for another PR.
2022-07-12 14:40:25 -07:00
..
config
alloc.go client: fixed a problem calculating a service namespace. (#13493) 2022-06-28 09:47:28 +02:00
alloc_test.go client: fixed a problem calculating a service namespace. (#13493) 2022-06-28 09:47:28 +02:00
batch_future.go
batch_future_test.go
bitmap.go
bitmap_test.go
connect.go
connect_test.go
consul.go
consul_oss.go
consul_oss_test.go
consul_test.go
csi.go CSI: make plugin health_timeout configurable in csi_plugin stanza (#13340) 2022-06-14 10:04:16 -04:00
csi_test.go
devices.go
devices_test.go
diff.go
diff_test.go
encoding.go
errors.go api: enable selecting subset of services using rendezvous hashing 2022-06-25 10:37:37 -05:00
errors_test.go
eval.go core: allow deleting of evaluations (#13492) 2022-07-06 16:30:11 +02:00
event.go
extensions.go remove end-user algorithm selection (#13190) 2022-07-11 13:34:04 -04:00
funcs.go core: merge reserved_ports into host_networks (#13651) 2022-07-12 14:40:25 -07:00
funcs_test.go
generate.sh workload identity (#13223) 2022-07-11 13:34:05 -04:00
handlers.go
job.go
job_test.go
network.go core: merge reserved_ports into host_networks (#13651) 2022-07-12 14:40:25 -07:00
network_test.go core: merge reserved_ports into host_networks (#13651) 2022-07-12 14:40:25 -07:00
node.go
node_class.go
node_class_test.go
node_test.go
operator.go core: allow pausing and un-pausing of leader broker routine (#13045) 2022-07-06 16:13:48 +02:00
search.go Implement HTTP search API for Variables (#13257) 2022-07-11 13:34:05 -04:00
secure_variables.go SV: fixes for namespace handling (#13705) 2022-07-12 11:15:57 -04:00
secure_variables_test.go SV: CAS: Implement Check and Set for Delete and Upsert (#13429) 2022-07-11 13:34:06 -04:00
service_identities.go
service_registration.go api: enable selecting subset of services using rendezvous hashing 2022-06-25 10:37:37 -05:00
service_registration_test.go api: enable selecting subset of services using rendezvous hashing 2022-06-25 10:37:37 -05:00
services.go
services_test.go
streaming_rpc.go
structs.go core: merge reserved_ports into host_networks (#13651) 2022-07-12 14:40:25 -07:00
structs_codegen.go
structs_oss.go
structs_periodic_test.go
structs_test.go client: enforce max_kill_timeout client configuration 2022-07-06 15:29:38 -05:00
testing.go
uuid.go core: allow deleting of evaluations (#13492) 2022-07-06 16:30:11 +02:00
vault.go
volume_test.go
volumes.go