Don't check configuration until user input is applied

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2020-04-23 09:25:15 -04:00
parent 6f28c92865
commit f44f830e9f
No known key found for this signature in database
GPG key ID: A2DF901DABE2C028
3 changed files with 5 additions and 2 deletions

View file

@ -708,7 +708,6 @@ type UntagValues struct {
func GetDefaultConfig() *config.Config {
var err error
conf, err := config.NewConfig("")
conf.CheckCgroupsAndAdjustConfig()
if err != nil {
logrus.Errorf("Error loading container config %v\n", err)
os.Exit(1)

View file

@ -126,6 +126,9 @@ func before(cmd *cobra.Command, args []string) error {
return err
}
defaultContainerConfig.Engine.CgroupManager = MainGlobalOpts.CGroupManager
defaultContainerConfig.CheckCgroupsAndAdjustConfig()
if err := setupRootless(cmd, args); err != nil {
return err
}

View file

@ -131,8 +131,9 @@ func NewRuntime(ctx context.Context, options ...RuntimeOption) (runtime *Runtime
if err != nil {
return nil, err
}
runtime, err = newRuntimeFromConfig(ctx, conf, options...)
conf.CheckCgroupsAndAdjustConfig()
return newRuntimeFromConfig(ctx, conf, options...)
return runtime, err
}
// NewRuntimeFromConfig creates a new container runtime using the given