diff --git a/pkg/config/config.go b/pkg/config/config.go index 5fd6bad58..cf6663375 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -473,8 +473,8 @@ func (conf *Config) updateFromCLI(c *cli.Context, baseFlags []cli.Flag) error { for _, flag := range c.App.Flags { flagName := flag.Names()[0] - // the `len(baseFlags) > 0` check is needed because `c.IsSet(...)` is always false in unit tests - if !c.IsSet(flagName) && len(baseFlags) > 0 { + // the `c.App.Name != "test"` check is needed because `c.IsSet(...)` is always false in unit tests + if !c.IsSet(flagName) && c.App.Name != "test" { continue } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index aa461425b..a77a276bf 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -38,6 +38,7 @@ func TestGeneratedFlags(t *testing.T) { require.NoError(t, err) app := cli.NewApp() + app.Name = "test" app.Flags = append(app.Flags, generatedFlags...) set := flag.NewFlagSet("test", 0)