mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 15:37:50 -08:00
fix: remove auto configure environment variables via viper (#2526)
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
@@ -122,11 +121,6 @@ func loadPluginCommands() []*cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initConfig(configFile string) error {
|
func initConfig(configFile string) error {
|
||||||
// Configure environment variables
|
|
||||||
viper.SetEnvPrefix("trivy") // will be uppercased automatically
|
|
||||||
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
|
||||||
viper.AutomaticEnv()
|
|
||||||
|
|
||||||
// Read from config
|
// Read from config
|
||||||
viper.SetConfigFile(configFile)
|
viper.SetConfigFile(configFile)
|
||||||
viper.SetConfigType("yaml")
|
viper.SetConfigType("yaml")
|
||||||
|
|||||||
Reference in New Issue
Block a user