diff --git a/daemon/daemon.go b/daemon/daemon.go index fe5e9d153e..1e91fd694c 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -1498,7 +1498,7 @@ func (daemon *Daemon) initDiscovery(config *Config) error { func (daemon *Daemon) Reload(config *Config) error { daemon.configStore.reloadLock.Lock() defer daemon.configStore.reloadLock.Unlock() - if config.IsValueSet("label") { + if config.IsValueSet("labels") { daemon.configStore.Labels = config.Labels } if config.IsValueSet("debug") { diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 382aac29e3..da6bc25d88 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -320,7 +320,7 @@ func TestDaemonReloadLabels(t *testing.T) { } valuesSets := make(map[string]interface{}) - valuesSets["label"] = "foo:baz" + valuesSets["labels"] = "foo:baz" newConfig := &Config{ CommonConfig: CommonConfig{ Labels: []string{"foo:baz"}, @@ -345,7 +345,7 @@ func TestDaemonReloadNotAffectOthers(t *testing.T) { } valuesSets := make(map[string]interface{}) - valuesSets["label"] = "foo:baz" + valuesSets["labels"] = "foo:baz" newConfig := &Config{ CommonConfig: CommonConfig{ Labels: []string{"foo:baz"},