mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Rename config LiveRestore to LiveRestoreEnabled
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
		
							parent
							
								
									2a84206add
								
							
						
					
					
						commit
						b945422393
					
				
					 5 changed files with 12 additions and 9 deletions
				
			
		| 
						 | 
					@ -72,7 +72,7 @@ func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption {
 | 
				
			||||||
		args := []string{"--systemd-cgroup=true"}
 | 
							args := []string{"--systemd-cgroup=true"}
 | 
				
			||||||
		opts = append(opts, libcontainerd.WithRuntimeArgs(args))
 | 
							opts = append(opts, libcontainerd.WithRuntimeArgs(args))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if cli.Config.LiveRestore {
 | 
						if cli.Config.LiveRestoreEnabled {
 | 
				
			||||||
		opts = append(opts, libcontainerd.WithLiveRestore(true))
 | 
							opts = append(opts, libcontainerd.WithLiveRestore(true))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	opts = append(opts, libcontainerd.WithRuntimePath(daemon.DefaultRuntimeBinary))
 | 
						opts = append(opts, libcontainerd.WithRuntimePath(daemon.DefaultRuntimeBinary))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -94,7 +94,10 @@ type CommonConfig struct {
 | 
				
			||||||
	TrustKeyPath         string              `json:"-"`
 | 
						TrustKeyPath         string              `json:"-"`
 | 
				
			||||||
	CorsHeaders          string              `json:"api-cors-header,omitempty"`
 | 
						CorsHeaders          string              `json:"api-cors-header,omitempty"`
 | 
				
			||||||
	EnableCors           bool                `json:"api-enable-cors,omitempty"`
 | 
						EnableCors           bool                `json:"api-enable-cors,omitempty"`
 | 
				
			||||||
	LiveRestore          bool                `json:"live-restore,omitempty"`
 | 
					
 | 
				
			||||||
 | 
						// LiveRestoreEnabled determines whether we should keep containers
 | 
				
			||||||
 | 
						// alive upon daemon shutdown/start
 | 
				
			||||||
 | 
						LiveRestoreEnabled bool `json:"live-restore,omitempty"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// ClusterStore is the storage backend used for the cluster information. It is used by both
 | 
						// ClusterStore is the storage backend used for the cluster information. It is used by both
 | 
				
			||||||
	// multihost networking (to store networks and endpoints information) and by the node discovery
 | 
						// multihost networking (to store networks and endpoints information) and by the node discovery
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -87,7 +87,7 @@ func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) strin
 | 
				
			||||||
	cmd.StringVar(&config.CgroupParent, []string{"-cgroup-parent"}, "", usageFn("Set parent cgroup for all containers"))
 | 
						cmd.StringVar(&config.CgroupParent, []string{"-cgroup-parent"}, "", usageFn("Set parent cgroup for all containers"))
 | 
				
			||||||
	cmd.StringVar(&config.RemappedRoot, []string{"-userns-remap"}, "", usageFn("User/Group setting for user namespaces"))
 | 
						cmd.StringVar(&config.RemappedRoot, []string{"-userns-remap"}, "", usageFn("User/Group setting for user namespaces"))
 | 
				
			||||||
	cmd.StringVar(&config.ContainerdAddr, []string{"-containerd"}, "", usageFn("Path to containerd socket"))
 | 
						cmd.StringVar(&config.ContainerdAddr, []string{"-containerd"}, "", usageFn("Path to containerd socket"))
 | 
				
			||||||
	cmd.BoolVar(&config.LiveRestore, []string{"-live-restore"}, false, usageFn("Enable live restore of docker when containers are still running"))
 | 
						cmd.BoolVar(&config.LiveRestoreEnabled, []string{"-live-restore"}, false, usageFn("Enable live restore of docker when containers are still running"))
 | 
				
			||||||
	config.Runtimes = make(map[string]types.Runtime)
 | 
						config.Runtimes = make(map[string]types.Runtime)
 | 
				
			||||||
	cmd.Var(runconfigopts.NewNamedRuntimeOpt("runtimes", &config.Runtimes, stockRuntimeName), []string{"-add-runtime"}, usageFn("Register an additional OCI compatible runtime"))
 | 
						cmd.Var(runconfigopts.NewNamedRuntimeOpt("runtimes", &config.Runtimes, stockRuntimeName), []string{"-add-runtime"}, usageFn("Register an additional OCI compatible runtime"))
 | 
				
			||||||
	cmd.StringVar(&config.DefaultRuntime, []string{"-default-runtime"}, stockRuntimeName, usageFn("Default OCI runtime for containers"))
 | 
						cmd.StringVar(&config.DefaultRuntime, []string{"-default-runtime"}, stockRuntimeName, usageFn("Default OCI runtime for containers"))
 | 
				
			||||||
| 
						 | 
					@ -133,7 +133,7 @@ func (config *Config) isSwarmCompatible() error {
 | 
				
			||||||
	if config.ClusterStore != "" || config.ClusterAdvertise != "" {
 | 
						if config.ClusterStore != "" || config.ClusterAdvertise != "" {
 | 
				
			||||||
		return fmt.Errorf("--cluster-store and --cluster-advertise daemon configurations are incompatible with swarm mode")
 | 
							return fmt.Errorf("--cluster-store and --cluster-advertise daemon configurations are incompatible with swarm mode")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if config.LiveRestore {
 | 
						if config.LiveRestoreEnabled {
 | 
				
			||||||
		return fmt.Errorf("--live-restore daemon configuration is incompatible with swarm mode")
 | 
							return fmt.Errorf("--live-restore daemon configuration is incompatible with swarm mode")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -658,7 +658,7 @@ func (daemon *Daemon) Shutdown() error {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pluginShutdown()
 | 
						pluginShutdown()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if daemon.configStore.LiveRestore && daemon.containers != nil {
 | 
						if daemon.configStore.LiveRestoreEnabled && daemon.containers != nil {
 | 
				
			||||||
		// check if there are any running containers, if none we should do some cleanup
 | 
							// check if there are any running containers, if none we should do some cleanup
 | 
				
			||||||
		if ls, err := daemon.Containers(&types.ContainerListOptions{}); len(ls) != 0 || err != nil {
 | 
							if ls, err := daemon.Containers(&types.ContainerListOptions{}); len(ls) != 0 || err != nil {
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
| 
						 | 
					@ -916,8 +916,8 @@ func (daemon *Daemon) Reload(config *Config) error {
 | 
				
			||||||
		daemon.configStore.Debug = config.Debug
 | 
							daemon.configStore.Debug = config.Debug
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if config.IsValueSet("live-restore") {
 | 
						if config.IsValueSet("live-restore") {
 | 
				
			||||||
		daemon.configStore.LiveRestore = config.LiveRestore
 | 
							daemon.configStore.LiveRestoreEnabled = config.LiveRestoreEnabled
 | 
				
			||||||
		if err := daemon.containerdRemote.UpdateOptions(libcontainerd.WithLiveRestore(config.LiveRestore)); err != nil {
 | 
							if err := daemon.containerdRemote.UpdateOptions(libcontainerd.WithLiveRestore(config.LiveRestoreEnabled)); err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1076,7 +1076,7 @@ func (daemon *Daemon) networkOptions(dconfig *Config, activeSandboxes map[string
 | 
				
			||||||
	options = append(options, nwconfig.OptionLabels(dconfig.Labels))
 | 
						options = append(options, nwconfig.OptionLabels(dconfig.Labels))
 | 
				
			||||||
	options = append(options, driverOptions(dconfig)...)
 | 
						options = append(options, driverOptions(dconfig)...)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if daemon.configStore != nil && daemon.configStore.LiveRestore && len(activeSandboxes) != 0 {
 | 
						if daemon.configStore != nil && daemon.configStore.LiveRestoreEnabled && len(activeSandboxes) != 0 {
 | 
				
			||||||
		options = append(options, nwconfig.OptionActiveSandboxes(activeSandboxes))
 | 
							options = append(options, nwconfig.OptionActiveSandboxes(activeSandboxes))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ func (daemon *Daemon) verifyExperimentalContainerSettings(hostConfig *container.
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func pluginInit(d *Daemon, cfg *Config, remote libcontainerd.Remote) error {
 | 
					func pluginInit(d *Daemon, cfg *Config, remote libcontainerd.Remote) error {
 | 
				
			||||||
	return plugin.Init(cfg.Root, remote, d.RegistryService, cfg.LiveRestore, d.LogPluginEvent)
 | 
						return plugin.Init(cfg.Root, remote, d.RegistryService, cfg.LiveRestoreEnabled, d.LogPluginEvent)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func pluginShutdown() {
 | 
					func pluginShutdown() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue