Skip to content

Commit

Permalink
Merge branch 'main' into use-go-base-image
Browse files Browse the repository at this point in the history
  • Loading branch information
adarsh-dell authored Feb 20, 2024
2 parents 2fb39e0 + b004ef8 commit 2711a67
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
20 changes: 16 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ func Run(
if v, ok := csictx.LookupEnv(ctx, gocsi.EnvVarDebug); ok {
/* #nosec G104 */
if ok, _ := strconv.ParseBool(v); ok {
csictx.Setenv(ctx, gocsi.EnvVarLogLevel, "debug")
csictx.Setenv(ctx, gocsi.EnvVarReqLogging, "true")
csictx.Setenv(ctx, gocsi.EnvVarRepLogging, "true")
err := csictx.Setenv(ctx, gocsi.EnvVarLogLevel, "debug")
if err != nil {
log.Warnf("failed to set EnvVarLogLevel")
}
err = csictx.Setenv(ctx, gocsi.EnvVarReqLogging, "true")
if err != nil {
log.Warnf("failed to set EnvVarReqLogging")
}
err = csictx.Setenv(ctx, gocsi.EnvVarRepLogging, "true")
if err != nil {
log.Warnf("failed to set EnvVarRepLogging")
}
}
}

Expand Down Expand Up @@ -130,7 +139,10 @@ func Run(
/* #nosec G104 */
if l.Addr().Network() == netUnix {
sockFile := l.Addr().String()
os.RemoveAll(sockFile)
err := os.RemoveAll(sockFile)
if err != nil {
log.Warnf("failed to remove sock file: %s", err)
}
log.WithField("path", sockFile).Info("removed sock file")
}
})
Expand Down
10 changes: 8 additions & 2 deletions retriever/go-metadata-retreiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,14 @@ func (sp *Plugin) initEnvVars(ctx context.Context) {
if v, ok := csictx.LookupEnv(ctx, gocsi.EnvVarDebug); ok {
/* #nosec G104 */
if ok, _ := strconv.ParseBool(v); ok {
csictx.Setenv(ctx, gocsi.EnvVarReqLogging, "true")
csictx.Setenv(ctx, gocsi.EnvVarRepLogging, "true")
err := csictx.Setenv(ctx, gocsi.EnvVarReqLogging, "true")
if err != nil {
log.Warnf("failed to set EnvVarReqLogging")
}
err = csictx.Setenv(ctx, gocsi.EnvVarRepLogging, "true")
if err != nil {
log.Warnf("failed to set EnvVarRepLogging")
}
}
}

Expand Down

0 comments on commit 2711a67

Please sign in to comment.