From 7d4eab554379524c2421a7ecd3319d1d087d1de2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 12 Sep 2017 12:43:34 +0200 Subject: [PATCH] Remove deprecated --enable-api-cors flag The `--enable-api-cors` flag was deprecated in f3dd2db4ff7de1399a49af928cd3eae4fccf8764, and marked for removal in docker 17.09 through 85f92ef3590b386ea17e3948262725a2d3ce4db5. This patch removes the deprecated flag. Signed-off-by: Sebastiaan van Stijn --- api/server/server.go | 1 - cmd/dockerd/config_unix.go | 2 -- cmd/dockerd/daemon.go | 3 +-- daemon/config/config.go | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/api/server/server.go b/api/server/server.go index 7ba8a6ce39..bf3774bba0 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -23,7 +23,6 @@ const versionMatcher = "/v{version:[0-9.]+}" // Config provides the configuration for the API server type Config struct { Logging bool - EnableCors bool CorsHeaders string Version string SocketGroup string diff --git a/cmd/dockerd/config_unix.go b/cmd/dockerd/config_unix.go index 148fa87459..ad27a46726 100644 --- a/cmd/dockerd/config_unix.go +++ b/cmd/dockerd/config_unix.go @@ -33,8 +33,6 @@ func installConfigFlags(conf *config.Config, flags *pflag.FlagSet) { flags.StringVar(&conf.BridgeConfig.FixedCIDRv6, "fixed-cidr-v6", "", "IPv6 subnet for fixed IPs") flags.BoolVar(&conf.BridgeConfig.EnableUserlandProxy, "userland-proxy", true, "Use userland proxy for loopback traffic") flags.StringVar(&conf.BridgeConfig.UserlandProxyPath, "userland-proxy-path", "", "Path to the userland proxy binary") - flags.BoolVar(&conf.EnableCors, "api-enable-cors", false, "Enable CORS headers in the Engine API, this is deprecated by --api-cors-header") - flags.MarkDeprecated("api-enable-cors", "Please use --api-cors-header") flags.StringVar(&conf.CgroupParent, "cgroup-parent", "", "Set parent cgroup for all containers") flags.StringVar(&conf.RemappedRoot, "userns-remap", "", "User/Group setting for user namespaces") flags.StringVar(&conf.ContainerdAddr, "containerd", "", "Path to containerd socket") diff --git a/cmd/dockerd/daemon.go b/cmd/dockerd/daemon.go index c2f3781d88..edf8f404d0 100644 --- a/cmd/dockerd/daemon.go +++ b/cmd/dockerd/daemon.go @@ -132,7 +132,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) { Logging: true, SocketGroup: cli.Config.SocketGroup, Version: dockerversion.Version, - EnableCors: cli.Config.EnableCors, CorsHeaders: cli.Config.CorsHeaders, } @@ -548,7 +547,7 @@ func (cli *DaemonCli) initMiddlewares(s *apiserver.Server, cfg *apiserver.Config vm := middleware.NewVersionMiddleware(v, api.DefaultVersion, api.MinVersion) s.UseMiddleware(vm) - if cfg.EnableCors || cfg.CorsHeaders != "" { + if cfg.CorsHeaders != "" { c := middleware.NewCORSMiddleware(cfg.CorsHeaders) s.UseMiddleware(c) } diff --git a/daemon/config/config.go b/daemon/config/config.go index d01d4a4fb4..501c07af76 100644 --- a/daemon/config/config.go +++ b/daemon/config/config.go @@ -103,7 +103,6 @@ type CommonConfig struct { Root string `json:"data-root,omitempty"` SocketGroup string `json:"group,omitempty"` CorsHeaders string `json:"api-cors-header,omitempty"` - EnableCors bool `json:"api-enable-cors,omitempty"` // TrustKeyPath is used to generate the daemon ID and for signing schema 1 manifests // when pushing to a registry which does not support schema 2. This field is marked as