Browse code

Windows: Move daemon config directory

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/07/31 04:39:19
Showing 3 changed files
... ...
@@ -8,7 +8,6 @@ import (
8 8
 	"io"
9 9
 	"os"
10 10
 	"path/filepath"
11
-	"runtime"
12 11
 	"strings"
13 12
 	"time"
14 13
 
... ...
@@ -319,11 +318,3 @@ func shutdownDaemon(d *daemon.Daemon, timeout time.Duration) {
319 319
 		logrus.Error("Force shutdown daemon")
320 320
 	}
321 321
 }
322
-
323
-func getDaemonConfDir() string {
324
-	// TODO: update for Windows daemon
325
-	if runtime.GOOS == "windows" {
326
-		return cliconfig.ConfigDir()
327
-	}
328
-	return "/etc/docker"
329
-}
... ...
@@ -44,3 +44,7 @@ func setDefaultUmask() error {
44 44
 
45 45
 	return nil
46 46
 }
47
+
48
+func getDaemonConfDir() string {
49
+	return "/etc/docker"
50
+}
... ...
@@ -3,6 +3,8 @@
3 3
 package main
4 4
 
5 5
 import (
6
+	"os"
7
+
6 8
 	apiserver "github.com/docker/docker/api/server"
7 9
 	"github.com/docker/docker/daemon"
8 10
 )
... ...
@@ -21,3 +23,7 @@ func currentUserIsOwner(f string) bool {
21 21
 func setDefaultUmask() error {
22 22
 	return nil
23 23
 }
24
+
25
+func getDaemonConfDir() string {
26
+	return os.Getenv("PROGRAMDATA") + `\docker\config`
27
+}