allow features option live reloadable
Signed-off-by: Anda Xu <anda.xu@docker.com> (cherry picked from commit 58a75cebdd08f3d504a5be79cc405cf33c4cbf43) Signed-off-by: Tibor Vass <tibor@docker.com> Upstream-commit: 2f94f103425985dc1677ee9a87f1161007949a45 Component: engine
This commit is contained in:
@@ -136,6 +136,11 @@ func (daemon *Daemon) HasExperimental() bool {
|
||||
return daemon.configStore != nil && daemon.configStore.Experimental
|
||||
}
|
||||
|
||||
// Features returns the features map from configStore
|
||||
func (daemon *Daemon) Features() *map[string]bool {
|
||||
return &daemon.configStore.Features
|
||||
}
|
||||
|
||||
func (daemon *Daemon) restore() error {
|
||||
containers := make(map[string]*container.Container)
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ func (daemon *Daemon) Reload(conf *config.Config) (err error) {
|
||||
daemon.reloadDebug(conf, attributes)
|
||||
daemon.reloadMaxConcurrentDownloadsAndUploads(conf, attributes)
|
||||
daemon.reloadShutdownTimeout(conf, attributes)
|
||||
daemon.reloadFeatures(conf, attributes)
|
||||
|
||||
if err := daemon.reloadClusterDiscovery(conf, attributes); err != nil {
|
||||
return err
|
||||
@@ -322,3 +323,13 @@ func (daemon *Daemon) reloadNetworkDiagnosticPort(conf *config.Config, attribute
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// reloadFeatures updates configuration with enabled/disabled features
|
||||
func (daemon *Daemon) reloadFeatures(conf *config.Config, attributes map[string]string) {
|
||||
// update corresponding configuration
|
||||
// note that we allow features option to be entirely unset
|
||||
daemon.configStore.Features = conf.Features
|
||||
|
||||
// prepare reload event attributes with updatable configurations
|
||||
attributes["features"] = fmt.Sprintf("%v", daemon.configStore.Features)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user