Browse code

Add LCOW behind experimental, might not be the cleanest way, but it's definitly the way with the minimum code change.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>

Victor Vieux authored on 2017/09/15 04:29:42
Showing 3 changed files
... ...
@@ -99,6 +99,8 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
99 99
 		FullTimestamp:   true,
100 100
 	})
101 101
 
102
+	system.InitLCOW(cli.Config.Experimental)
103
+
102 104
 	if err := setDefaultUmask(); err != nil {
103 105
 		return fmt.Errorf("Failed to set umask: %v", err)
104 106
 	}
105 107
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+// +build !windows
1
+
2
+package system
3
+
4
+// InitLCOW does nothing since LCOW is a windows only feature
5
+func InitLCOW(experimental bool) {
6
+}
... ...
@@ -8,9 +8,10 @@ import "os"
8 8
 // on build number. @jhowardmsft
9 9
 var lcowSupported = false
10 10
 
11
-func init() {
11
+// InitLCOW sets whether LCOW is supported or not
12
+func InitLCOW(experimental bool) {
12 13
 	// LCOW initialization
13
-	if os.Getenv("LCOW_SUPPORTED") != "" {
14
+	if experimental && os.Getenv("LCOW_SUPPORTED") != "" {
14 15
 		lcowSupported = true
15 16
 	}
16 17