Skip to content

Commit

Permalink
Don't check configuration until user input is applied
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Apr 23, 2020
1 parent 6f28c92 commit f44f830
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion cmd/podman/cliconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions cmd/podman/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f44f830

Please sign in to comment.