From 3b152a1bb4278271d8c517aad5cc2ee5a2c7b0fd Mon Sep 17 00:00:00 2001 From: "R. Franco" <6237457+donotnoot@users.noreply.github.com> Date: Thu, 24 Feb 2022 20:01:11 +0000 Subject: [PATCH] Default to YAML when config file has no extension (#2618) --- 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() }