From 4aed5ba1e216b4e4097427973a7eb726b060fecc Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 8 Nov 2016 16:21:52 -0800 Subject: [PATCH] Restore sync/atomic use for consistency --- command/agent/agent.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/agent/agent.go b/command/agent/agent.go index 043e313c1..60e7f0276 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -11,6 +11,7 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" "github.com/hashicorp/nomad/client" @@ -110,7 +111,7 @@ func (a *Agent) serverConfig() (*nomad.Config, error) { if a.config.Server.BootstrapExpect == 1 { conf.Bootstrap = true } else { - conf.BootstrapExpect = int32(a.config.Server.BootstrapExpect) + atomic.StoreInt32(&conf.BootstrapExpect, int32(a.config.Server.BootstrapExpect)) } } if a.config.DataDir != "" {