1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon: move DefaultShutdownTimeout to daemon/config

Unifying defaults to the daemon/config package

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-04-02 18:40:09 +02:00
parent 690a6fddf9
commit 83969fa3dd
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 6 additions and 7 deletions

View file

@ -9,12 +9,8 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )
const ( // defaultTrustKeyFile is the default filename for the trust key
// defaultShutdownTimeout is the default shutdown timeout for the daemon const defaultTrustKeyFile = "key.json"
defaultShutdownTimeout = 15
// defaultTrustKeyFile is the default filename for the trust key
defaultTrustKeyFile = "key.json"
)
// installCommonConfigFlags adds flags to the pflag.FlagSet to configure the daemon // installCommonConfigFlags adds flags to the pflag.FlagSet to configure the daemon
func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) error { func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) error {
@ -78,7 +74,7 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) error {
flags.IntVar(&maxConcurrentDownloads, "max-concurrent-downloads", config.DefaultMaxConcurrentDownloads, "Set the max concurrent downloads for each pull") flags.IntVar(&maxConcurrentDownloads, "max-concurrent-downloads", config.DefaultMaxConcurrentDownloads, "Set the max concurrent downloads for each pull")
flags.IntVar(&maxConcurrentUploads, "max-concurrent-uploads", config.DefaultMaxConcurrentUploads, "Set the max concurrent uploads for each push") flags.IntVar(&maxConcurrentUploads, "max-concurrent-uploads", config.DefaultMaxConcurrentUploads, "Set the max concurrent uploads for each push")
flags.IntVar(&maxDownloadAttempts, "max-download-attempts", config.DefaultDownloadAttempts, "Set the max download attempts for each pull") flags.IntVar(&maxDownloadAttempts, "max-download-attempts", config.DefaultDownloadAttempts, "Set the max download attempts for each pull")
flags.IntVar(&conf.ShutdownTimeout, "shutdown-timeout", defaultShutdownTimeout, "Set the default shutdown timeout") flags.IntVar(&conf.ShutdownTimeout, "shutdown-timeout", config.DefaultShutdownTimeout, "Set the default shutdown timeout")
flags.IntVar(&conf.NetworkDiagnosticPort, "network-diagnostic-port", 0, "TCP port number of the network diagnostic server") flags.IntVar(&conf.NetworkDiagnosticPort, "network-diagnostic-port", 0, "TCP port number of the network diagnostic server")
_ = flags.MarkHidden("network-diagnostic-port") _ = flags.MarkHidden("network-diagnostic-port")

View file

@ -38,6 +38,9 @@ const (
DefaultNetworkMtu = 1500 DefaultNetworkMtu = 1500
// DisableNetworkBridge is the default value of the option to disable network bridge // DisableNetworkBridge is the default value of the option to disable network bridge
DisableNetworkBridge = "none" DisableNetworkBridge = "none"
// DefaultShutdownTimeout is the default shutdown timeout (in seconds) for
// the daemon for containers to stop when it is shutting down.
DefaultShutdownTimeout = 15
// DefaultInitBinary is the name of the default init binary // DefaultInitBinary is the name of the default init binary
DefaultInitBinary = "docker-init" DefaultInitBinary = "docker-init"
// DefaultRuntimeBinary is the default runtime to be used by // DefaultRuntimeBinary is the default runtime to be used by