Skip to content

Commit

Permalink
fix for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmahanth committed Sep 30, 2023
1 parent 73a4e7c commit efb4fbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deepfence_utils/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ func SHA256sum(data []byte) string {
}

func GetEnvOrDefault(envVar string, defaultValue string) string {
envValue, has := os.LookupEnv(envVar)
if !has || len(envValue) == 0 {
envValue := os.Getenv(envVar)
if len(envValue) == 0 {
return defaultValue
}
return envValue
Expand Down
3 changes: 1 addition & 2 deletions deepfence_worker/tasks/sbom/scan_sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ import (
)

var (
attackVectorRegex = regexp.MustCompile(`.*av:n.*`)
grypeConfig = "/usr/local/bin/grype.yaml"
grypeBin = "grype"
minioHost = utils.GetEnvOrDefault("DEEPFENCE_MINIO_HOST", "deepfence-file-server")
minioPort = utils.GetEnvOrDefault("DEEPFENCE_MINIO_PORT", "9000")
GRYPE_DB_UPDATE_URL = fmt.Sprintf("GRYPE_DB_UPDATE_URL=http://%s:%s/database/database/vulnerability/listing.json", minioHost, minioPort)
)

var attackVectorRegex = regexp.MustCompile(`.*av:n.*`)

type SbomParser struct {
ingestC chan *kgo.Record
}
Expand Down

0 comments on commit efb4fbf

Please sign in to comment.