Skip to content

Commit

Permalink
fix #330 by making the dependency track consumer debug flag into a st…
Browse files Browse the repository at this point in the history
…ring instead of a boolean switch
  • Loading branch information
northdpole committed Aug 31, 2024
1 parent 9c207f8 commit 558d238
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/consumers/dependency-track/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ var (
client *dtrack.Client
ownerAnnotation string
// used for debugging, turns off certificate and enables debug
debugDT bool
debugDTConnection string
debugDT bool
)

func main() {
Expand All @@ -37,7 +38,7 @@ func main() {
flag.StringVar(&projectName, "projectName", "", "dependency track project name")
flag.StringVar(&projectUUID, "projectUUID", "", "dependency track project name")
flag.StringVar(&projectVersion, "projectVersion", "", "dependency track project version")
flag.BoolVar(&debugDT, "debugDependencyTrackConnection", false, "setup client with no tls and enable debug")
flag.StringVar(&debugDTConnection, "debugDependencyTrackConnection", "false", "setup client with no tls and enable debug")
flag.StringVar(
&ownerAnnotation,
"ownerAnnotation",
Expand Down Expand Up @@ -65,7 +66,10 @@ func main() {
if projectVersion == "" {
log.Fatal("project version is mandatory for dependency track")
}

if debugDTConnection == "true" {
debugDT = true
slog.Info("running in debug mode, skipping certificate verification and printing requests and responses")
}
c, err := dtrack.NewClient(
authURL,
dtrack.WithHttpClient(
Expand Down

0 comments on commit 558d238

Please sign in to comment.