519429a2de
This PR changes Nomad's wrapper around the Consul NamespaceAPI so that it will detect if the Consul Namespaces feature is enabled before making a request to the Namespaces API. Namespaces are not enabled in Consul OSS, and require a suitable license to be used with Consul ENT. Previously Nomad would check for a 404 status code when makeing a request to the Namespaces API to "detect" if Consul OSS was being used. This does not work for Consul ENT with Namespaces disabled, which returns a 500. Now we avoid requesting the namespace API altogether if Consul is detected to be the OSS sku, or if the Namespaces feature is not licensed. Since Consul can be upgraded from OSS to ENT, or a new license applied, we cache the value for 1 minute, refreshing on demand if expired. Fixes https://github.com/hashicorp/nomad-enterprise/issues/575 Note that the ticket originally describes using attributes from https://github.com/hashicorp/nomad/issues/10688. This turns out not to be possible due to a chicken-egg situation between bootstrapping the agent and setting up the consul client. Also fun: the Consul fingerprinter creates its own Consul client, because there is no [currently] no way to pass the agent's client through the fingerprint factory. |
||
---|---|---|
.. | ||
getter | ||
interfaces | ||
restarts | ||
state | ||
template | ||
testdata | ||
artifact_hook.go | ||
artifact_hook_test.go | ||
connect_native_hook.go | ||
connect_native_hook_test.go | ||
device_hook.go | ||
device_hook_test.go | ||
dispatch_hook.go | ||
dispatch_hook_test.go | ||
driver_handle.go | ||
envoy_bootstrap_hook.go | ||
envoy_bootstrap_hook_test.go | ||
envoy_version_hook.go | ||
envoy_version_hook_test.go | ||
errors.go | ||
errors_test.go | ||
lazy_handle.go | ||
lifecycle.go | ||
logmon_hook.go | ||
logmon_hook_test.go | ||
logmon_hook_unix_test.go | ||
plugin_supervisor_hook.go | ||
remotetask_hook.go | ||
script_check_hook.go | ||
script_check_hook_test.go | ||
service_hook.go | ||
service_hook_test.go | ||
sids_hook.go | ||
sids_hook_test.go | ||
stats_hook.go | ||
stats_hook_test.go | ||
task_dir_hook.go | ||
task_runner.go | ||
task_runner_getters.go | ||
task_runner_hooks.go | ||
task_runner_test.go | ||
tasklet.go | ||
tasklet_test.go | ||
template_hook.go | ||
validate_hook.go | ||
validate_hook_test.go | ||
vault_hook.go | ||
vault_hook_test.go | ||
volume_hook.go | ||
volume_hook_test.go |