Skip to content

Commit

Permalink
fix(release-automation): error msg amendment for non root container c…
Browse files Browse the repository at this point in the history
…heck
  • Loading branch information
tomaszbarwicki committed Apr 16, 2024
1 parent 145e844 commit cb707d3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"fmt"
"regexp"
"strings"

"tractusx-release-automation/internal/tractusx"
)

Expand Down Expand Up @@ -68,7 +67,10 @@ func (n NonRootContainer) Test() *tractusx.QualityResult {

if !validateUser(file.user()) {
checkPassed = false
errorDescription += "\nInvalid user specified in Dockerfile: " + strings.Split(dockerfilePath, n.baseDir)[1][1:]
if n.baseDir != "./" {
dockerfilePath = strings.Split(dockerfilePath, n.baseDir)[1]
}
errorDescription += "\nInvalid user specified in Dockerfile: " + dockerfilePath[1:]
if tractusx.CliErrOutputFormat == tractusx.WebErrOutputFormat {
errorDescription += "<br>"
}
Expand Down

0 comments on commit cb707d3

Please sign in to comment.