Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: always initialize node.HostVolumes map (#24910)
The default node configuration in the client should always set an empty HostVolumes map. Otherwise callers can panic, e.g.,: goroutine 179 [running]: github.com/hashicorp/nomad/client/hostvolumemanager.UpdateVolumeMap({0x36042b0, 0xc000c62a80}, 0x0, {0xc000a802a0, 0xd}, 0xc000691940) github.com/hashicorp/nomad/client/hostvolumemanager/volume_fingerprint.go:43 +0x1b2 github.com/hashicorp/nomad/client.(*Client).batchFirstFingerprints.func1({0xc000a802a0, 0xd}, 0xc000691940) github.com/hashicorp/nomad/client/node_updater.go:54 +0xd7 github.com/hashicorp/nomad/client.(*batchNodeUpdates).batchHostVolumeUpdates(0xc000912608?, 0xc0009f2f88) github.com/hashicorp/nomad/client/node_updater.go:417 +0x152 github.com/hashicorp/nomad/client.(*Client).batchFirstFingerprints(0xc000c2d188) github.com/hashicorp/nomad/client/node_updater.go:53 +0x1c5 created by github.com/hashicorp/nomad/client.NewClient in goroutine 1 github.com/hashicorp/nomad/client/client.go:557 +0x2069 is a panic of the HVM when restarting a client that doesn't have any static host volumes, but does have a dynamic host volume.
- Loading branch information