瀏覽代碼

Add warning about deprecated "cluster" options to "docker info"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 年之前
父節點
當前提交
a5538c06f9
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      daemon/info.go

+ 11 - 2
daemon/info.go

@@ -63,8 +63,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 		Labels:             daemon.configStore.Labels,
 		ExperimentalBuild:  daemon.configStore.Experimental,
 		ServerVersion:      dockerversion.Version,
-		ClusterStore:       daemon.configStore.ClusterStore,
-		ClusterAdvertise:   daemon.configStore.ClusterAdvertise,
 		HTTPProxy:          maskCredentials(getEnvAny("HTTP_PROXY", "http_proxy")),
 		HTTPSProxy:         maskCredentials(getEnvAny("HTTPS_PROXY", "https_proxy")),
 		NoProxy:            getEnvAny("NO_PROXY", "no_proxy"),
@@ -72,6 +70,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 		Isolation:          daemon.defaultIsolation,
 	}
 
+	daemon.fillClusterInfo(v)
 	daemon.fillAPIInfo(v)
 	// Retrieve platform specific info
 	daemon.fillPlatformInfo(v, sysInfo)
@@ -127,6 +126,16 @@ func (daemon *Daemon) SystemVersion() types.Version {
 	return v
 }
 
+func (daemon *Daemon) fillClusterInfo(v *types.Info) {
+	v.ClusterAdvertise = daemon.configStore.ClusterAdvertise
+	v.ClusterStore = daemon.configStore.ClusterStore
+
+	if v.ClusterAdvertise != "" || v.ClusterStore != "" {
+		v.Warnings = append(v.Warnings, `WARNING: node discovery and overlay networks with an external k/v store (cluster-advertise,
+         cluster-store, cluster-store-opt) are deprecated and will be removed in a future release.`)
+	}
+}
+
 func (daemon *Daemon) fillDriverInfo(v *types.Info) {
 	var ds [][2]string
 	drivers := ""