fix(report): prioritize env vars over config.toml (#1194)
This commit is contained in:
		@@ -39,8 +39,6 @@ type ReportCmd struct {
 | 
			
		||||
	toS3        bool
 | 
			
		||||
	toAzureBlob bool
 | 
			
		||||
	toHTTP      bool
 | 
			
		||||
 | 
			
		||||
	toHTTPURL string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Name return subcommand name
 | 
			
		||||
@@ -162,8 +160,6 @@ func (p *ReportCmd) SetFlags(f *flag.FlagSet) {
 | 
			
		||||
	f.BoolVar(&p.gzip, "gzip", false, "gzip compression")
 | 
			
		||||
	f.BoolVar(&c.Conf.Pipe, "pipe", false, "Use args passed via PIPE")
 | 
			
		||||
 | 
			
		||||
	f.StringVar(&p.toHTTPURL, "http", "", "-to-http http://vuls-report")
 | 
			
		||||
 | 
			
		||||
	f.StringVar(&c.Conf.TrivyCacheDBDir, "trivy-cachedb-dir",
 | 
			
		||||
		utils.DefaultCacheDir(), "/path/to/dir")
 | 
			
		||||
}
 | 
			
		||||
@@ -186,9 +182,6 @@ func (p *ReportCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}
 | 
			
		||||
	c.Conf.Azure.Enabled = p.toAzureBlob
 | 
			
		||||
	c.Conf.HTTP.Enabled = p.toHTTP
 | 
			
		||||
 | 
			
		||||
	//TODO refactor
 | 
			
		||||
	c.Conf.HTTP.Init(p.toHTTPURL)
 | 
			
		||||
 | 
			
		||||
	if c.Conf.Diff {
 | 
			
		||||
		c.Conf.DiffPlus, c.Conf.DiffMinus = true, true
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user