open-nomad/command/agent
Tim Gross 17bd930ca9
logs: fix missing allocation logs after update to Nomad 1.5.4 (#17087)
When the server restarts for the upgrade, it loads the `structs.Job` from the
Raft snapshot/logs. The jobspec has long since been parsed, so none of the
guards around the default value are in play. The empty field value for `Enabled`
is the zero value, which is false.

This doesn't impact any running allocation because we don't replace running
allocations when either the client or server restart. But as soon as any
allocation gets rescheduled (ex. you drain all your clients during upgrades),
it'll be using the `structs.Job` that the server has, which has `Enabled =
false`, and logs will not be collected.

This changeset fixes the bug by adding a new field `Disabled` which defaults to
false (so that the zero value works), and deprecates the old field.

Fixes #17076
2023-05-04 16:01:18 -04:00
..
consul [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
event [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
host [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
monitor [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
pprof [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
test-resources [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
testdata [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
acl_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
acl_endpoint_test.go dep: update from jwt/v4 to jwt/v5 (#17062) 2023-05-03 11:17:38 -07:00
agent.go client: allow `drain_on_shutdown` configuration (#16827) 2023-04-14 15:35:32 -04:00
agent_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
agent_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
agent_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
agent_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
alloc_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
alloc_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
bindata_assetfs.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
command.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
command_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
config.go client: fix job_max_source_size client config name (#17067) 2023-05-04 13:54:51 -05:00
config_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
config_parse.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
config_parse_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
config_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
csi_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
csi_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
deployment_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
deployment_endpoint_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
eval_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
eval_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
event_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
event_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fs_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
fs_endpoint_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
helpers.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
helpers_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
http.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
http_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
http_stdlog.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
http_stdlog_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
http_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
job_endpoint.go logs: fix missing allocation logs after update to Nomad 1.5.4 (#17087) 2023-05-04 16:01:18 -04:00
job_endpoint_test.go logs: fix missing allocation logs after update to Nomad 1.5.4 (#17087) 2023-05-04 16:01:18 -04:00
keyring.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
keyring_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
keyring_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
keyring_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_file.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_file_bsd.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_file_linux.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_file_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_file_windows.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_levels.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
log_levels_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
meta_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
metrics_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
metrics_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
namespace_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
namespace_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
node_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
node_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
operator_endpoint_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plugins.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
plugins_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
region_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
region_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
retry_join.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
retry_join_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
scaling_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
scaling_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
search_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
search_endpoint_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
service_registration_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
service_registration_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
stats_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
stats_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
status_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
status_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
stub_asset.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
syslog.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
syslog_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
system_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
system_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
testagent.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
testagent_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
testingutils_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
variable_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
variable_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00