Commit db63f9370e26d725357c703cbaf9ab63cc7b6d0a
extracted daemon configuration to its own
package, but did not update the Solaris stubs.
This updates the Solaris daemon.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
... | ... |
@@ -10,13 +10,12 @@ import ( |
10 | 10 |
"github.com/docker/docker/api/types" |
11 | 11 |
containertypes "github.com/docker/docker/api/types/container" |
12 | 12 |
"github.com/docker/docker/container" |
13 |
+ "github.com/docker/docker/daemon/config" |
|
13 | 14 |
"github.com/docker/docker/image" |
14 |
- "github.com/docker/docker/layer" |
|
15 | 15 |
"github.com/docker/docker/pkg/fileutils" |
16 | 16 |
"github.com/docker/docker/pkg/idtools" |
17 | 17 |
"github.com/docker/docker/pkg/parsers/kernel" |
18 | 18 |
"github.com/docker/docker/pkg/sysinfo" |
19 |
- refstore "github.com/docker/docker/reference" |
|
20 | 19 |
"github.com/docker/libnetwork" |
21 | 20 |
nwconfig "github.com/docker/libnetwork/config" |
22 | 21 |
"github.com/docker/libnetwork/drivers/solaris/bridge" |
... | ... |
@@ -72,7 +71,7 @@ func (daemon *Daemon) parseSecurityOpt(container *container.Container, hostConfi |
72 | 72 |
} |
73 | 73 |
|
74 | 74 |
func parseSecurityOpt(container *container.Container, config *containertypes.HostConfig) error { |
75 |
- //Since config.SecurityOpt is specifically defined as a "List of string values to |
|
75 |
+ //Since hostConfig.SecurityOpt is specifically defined as a "List of string values to |
|
76 | 76 |
//customize labels for MLs systems, such as SELinux" |
77 | 77 |
//until we figure out how to map to Trusted Extensions |
78 | 78 |
//this is being disabled for now on Solaris |
... | ... |
@@ -89,11 +88,11 @@ func parseSecurityOpt(container *container.Container, config *containertypes.Hos |
89 | 89 |
return err |
90 | 90 |
} |
91 | 91 |
|
92 |
-func setupRemappedRoot(config *Config) ([]idtools.IDMap, []idtools.IDMap, error) { |
|
93 |
- return nil, nil, nil |
|
92 |
+func setupRemappedRoot(config *config.Config) (*idtools.IDMappings, error) { |
|
93 |
+ return nil, nil |
|
94 | 94 |
} |
95 | 95 |
|
96 |
-func setupDaemonRoot(config *Config, rootDir string, rootUID, rootGID int) error { |
|
96 |
+func setupDaemonRoot(config *config.Config, rootDir string, rootIDs idtools.IDPair) error { |
|
97 | 97 |
return nil |
98 | 98 |
} |
99 | 99 |
|
... | ... |
@@ -136,7 +135,7 @@ func (daemon *Daemon) adaptContainerSettings(hostConfig *containertypes.HostConf |
136 | 136 |
} |
137 | 137 |
|
138 | 138 |
// UsingSystemd returns true if cli option includes native.cgroupdriver=systemd |
139 |
-func UsingSystemd(config *Config) bool { |
|
139 |
+func UsingSystemd(config *config.Config) bool { |
|
140 | 140 |
return false |
141 | 141 |
} |
142 | 142 |
|
... | ... |
@@ -309,25 +308,25 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. |
309 | 309 |
|
310 | 310 |
// reloadPlatform updates configuration with platform specific options |
311 | 311 |
// and updates the passed attributes |
312 |
-func (daemon *Daemon) reloadPlatform(config *Config, attributes map[string]string) { |
|
312 |
+func (daemon *Daemon) reloadPlatform(conf *config.Config, attributes map[string]string) { |
|
313 | 313 |
} |
314 | 314 |
|
315 | 315 |
// verifyDaemonSettings performs validation of daemon config struct |
316 |
-func verifyDaemonSettings(config *Config) error { |
|
316 |
+func verifyDaemonSettings(conf *config.Config) error { |
|
317 | 317 |
|
318 |
- if config.DefaultRuntime == "" { |
|
319 |
- config.DefaultRuntime = stockRuntimeName |
|
318 |
+ if conf.DefaultRuntime == "" { |
|
319 |
+ conf.DefaultRuntime = stockRuntimeName |
|
320 | 320 |
} |
321 |
- if config.Runtimes == nil { |
|
322 |
- config.Runtimes = make(map[string]types.Runtime) |
|
321 |
+ if conf.Runtimes == nil { |
|
322 |
+ conf.Runtimes = make(map[string]types.Runtime) |
|
323 | 323 |
} |
324 | 324 |
stockRuntimeOpts := []string{} |
325 |
- config.Runtimes[stockRuntimeName] = types.Runtime{Path: DefaultRuntimeBinary, Args: stockRuntimeOpts} |
|
325 |
+ conf.Runtimes[stockRuntimeName] = types.Runtime{Path: DefaultRuntimeBinary, Args: stockRuntimeOpts} |
|
326 | 326 |
|
327 |
- // checkSystem validates platform-specific requirements |
|
328 | 327 |
return nil |
329 | 328 |
} |
330 | 329 |
|
330 |
+// checkSystem validates platform-specific requirements |
|
331 | 331 |
func checkSystem() error { |
332 | 332 |
// check OS version for compatibility, ensure running in global zone |
333 | 333 |
var err error |
... | ... |
@@ -349,16 +348,16 @@ func checkSystem() error { |
349 | 349 |
|
350 | 350 |
// configureMaxThreads sets the Go runtime max threads threshold |
351 | 351 |
// which is 90% of the kernel setting from /proc/sys/kernel/threads-max |
352 |
-func configureMaxThreads(config *Config) error { |
|
352 |
+func configureMaxThreads(config *config.Config) error { |
|
353 | 353 |
return nil |
354 | 354 |
} |
355 | 355 |
|
356 |
-// configureKernelSecuritySupport configures and validate security support for the kernel |
|
356 |
+// configureKernelSecuritySupport configures and validates security support for the kernel |
|
357 | 357 |
func configureKernelSecuritySupport(config *config.Config, driverNames []string) error { |
358 | 358 |
return nil |
359 | 359 |
} |
360 | 360 |
|
361 |
-func (daemon *Daemon) initNetworkController(config *Config, activeSandboxes map[string]interface{}) (libnetwork.NetworkController, error) { |
|
361 |
+func (daemon *Daemon) initNetworkController(config *config.Config, activeSandboxes map[string]interface{}) (libnetwork.NetworkController, error) { |
|
362 | 362 |
netOptions, err := daemon.networkOptions(config, daemon.PluginStore, activeSandboxes) |
363 | 363 |
if err != nil { |
364 | 364 |
return nil, err |
... | ... |
@@ -384,7 +383,7 @@ func (daemon *Daemon) initNetworkController(config *Config, activeSandboxes map[ |
384 | 384 |
return controller, nil |
385 | 385 |
} |
386 | 386 |
|
387 |
-func initBridgeDriver(controller libnetwork.NetworkController, config *Config) error { |
|
387 |
+func initBridgeDriver(controller libnetwork.NetworkController, config *config.Config) error { |
|
388 | 388 |
if n, err := controller.NetworkByName("bridge"); err == nil { |
389 | 389 |
if err = n.Delete(); err != nil { |
390 | 390 |
return fmt.Errorf("could not delete the default bridge network: %v", err) |
... | ... |
@@ -497,12 +496,7 @@ func (daemon *Daemon) conditionalUnmountOnCleanup(container *container.Container |
497 | 497 |
return daemon.Unmount(container) |
498 | 498 |
} |
499 | 499 |
|
500 |
-func restoreCustomImage(is image.Store, ls layer.Store, rs refstore.Store) error { |
|
501 |
- // Solaris has no custom images to register |
|
502 |
- return nil |
|
503 |
-} |
|
504 |
- |
|
505 |
-func driverOptions(config *Config) []nwconfig.Option { |
|
500 |
+func driverOptions(config *config.Config) []nwconfig.Option { |
|
506 | 501 |
return []nwconfig.Option{} |
507 | 502 |
} |
508 | 503 |
|
... | ... |
@@ -520,7 +514,7 @@ func rootFSToAPIType(rootfs *image.RootFS) types.RootFS { |
520 | 520 |
return types.RootFS{} |
521 | 521 |
} |
522 | 522 |
|
523 |
-func setupDaemonProcess(config *Config) error { |
|
523 |
+func setupDaemonProcess(config *config.Config) error { |
|
524 | 524 |
return nil |
525 | 525 |
} |
526 | 526 |
|