cli: set config options before showing config paths

Config paths are set correctly but they must be set before handleShowConfig

fixes #1185

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2019-01-28 08:29:29 -06:00
parent 6f2c036601
commit 68043b5ca6

View File

@ -250,6 +250,8 @@ func beforeSubcommands(c *cli.Context) error {
var runtimeConfig oci.RuntimeConfig var runtimeConfig oci.RuntimeConfig
var err error var err error
katautils.SetConfigOptions(name, defaultRuntimeConfiguration, defaultSysConfRuntimeConfiguration)
handleShowConfig(c) handleShowConfig(c)
if userWantsUsage(c) || (c.NArg() == 1 && (c.Args()[0] == checkCmd)) { if userWantsUsage(c) || (c.NArg() == 1 && (c.Args()[0] == checkCmd)) {
@ -302,8 +304,6 @@ func beforeSubcommands(c *cli.Context) error {
ignoreLogging = true ignoreLogging = true
} }
katautils.SetConfigOptions(name, defaultRuntimeConfiguration, defaultSysConfRuntimeConfiguration)
configFile, runtimeConfig, err = katautils.LoadConfiguration(c.GlobalString(configFilePathOption), ignoreLogging, false) configFile, runtimeConfig, err = katautils.LoadConfiguration(c.GlobalString(configFilePathOption), ignoreLogging, false)
if err != nil { if err != nil {
fatal(err) fatal(err)