open-nomad/client/allocrunner
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
..
interfaces [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
state [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
tasklifecycle [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
taskrunner logs: fix missing allocation logs after update to Nomad 1.5.4 (#17087) 2023-05-04 16:01:18 -04:00
alloc_runner.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
alloc_runner_hooks.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
alloc_runner_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
alloc_runner_unix_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
allocdir_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
cgroup_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
checks_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
checks_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
config.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_grpc_sock_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_grpc_sock_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_http_sock_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_http_sock_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
csi_hook.go Merge pull request #16836 from hashicorp/compliance/add-headers 2023-04-10 16:32:03 -07:00
csi_hook_test.go Merge pull request #16836 from hashicorp/compliance/add-headers 2023-04-10 16:32:03 -07:00
group_service_hook.go services: un-mark group services as deregistered if restart hook runs (#16905) 2023-04-24 14:24:51 -05:00
group_service_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
health_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
health_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
migrate_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
network_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
network_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
network_manager_linux.go allocrunner: prevent panic on network manager (#16921) 2023-04-18 13:39:13 -07:00
network_manager_linux_test.go allocrunner: prevent panic on network manager (#16921) 2023-04-18 13:39:13 -07:00
network_manager_nonlinux.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_bridge_linux.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_bridge_linux_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_cni.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_cni_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
testing.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
upstream_allocs_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00