diff --git a/internal/config/config.go b/internal/config/config.go index 4e0f9923a..6f0a60d70 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -3,6 +3,7 @@ package config import ( "bufio" "bytes" + "os" "strings" "time" @@ -106,6 +107,12 @@ func (config *configSchema) Read() { v.SetConfigType("yaml") configFile := v.GetString("config.file") + // if config file is not set then try loading karma.yaml from current directory + if configFile == "" { + if _, err = os.Stat("karma.yaml"); !os.IsNotExist(err) { + configFile = "karma.yaml" + } + } if configFile != "" { log.Infof("Reading configuration file %s", configFile) v.SetConfigFile(configFile)