From 24953eb56822439ba2b3019485d370a8953df820 Mon Sep 17 00:00:00 2001 From: Rafael Franco Date: Thu, 24 Feb 2022 17:01:50 +0000 Subject: [PATCH] Default to YAML when config file has no extension --- pkg/config/reader.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/config/reader.go b/pkg/config/reader.go index e8824c75335b..c2c73e6f6f08 100644 --- a/pkg/config/reader.go +++ b/pkg/config/reader.go @@ -46,6 +46,11 @@ func (r *FileReader) Read() error { if configFile != "" { viper.SetConfigFile(configFile) + + // Assume YAML if the file has no extension. + if filepath.Ext(configFile) == "" { + viper.SetConfigType("yaml") + } } else { r.setupConfigFileSearch() }