diff --git a/release-automation/internal/container/non_root_container_check.go b/release-automation/internal/container/non_root_container_check.go index 542a35eb..fd0f9d48 100644 --- a/release-automation/internal/container/non_root_container_check.go +++ b/release-automation/internal/container/non_root_container_check.go @@ -22,6 +22,7 @@ package container import ( "fmt" "regexp" + "strings" "tractusx-release-automation/internal/tractusx" ) @@ -55,7 +56,7 @@ func (n NonRootContainer) BaseDir() string { func (n NonRootContainer) Test() *tractusx.QualityResult { checkPassed := true - var errorDescription string + errorDescription := "" dockerfiles := findDockerfilesAt(n.baseDir) for _, dockerfilePath := range dockerfiles { @@ -66,10 +67,12 @@ func (n NonRootContainer) Test() *tractusx.QualityResult { if !validateUser(file.user()) { checkPassed = false - if len(errorDescription) > 0 { - errorDescription = errorDescription + "\nInvalid user specified in Dockerfile: " + dockerfilePath - } else { - errorDescription = "Invalid user specified in Dockerfile: " + dockerfilePath + if n.baseDir != "./" { + dockerfilePath = strings.Split(dockerfilePath, n.baseDir)[1] + } + errorDescription += "\nInvalid user specified in Dockerfile: " + dockerfilePath[1:] + if tractusx.CliErrOutputFormat == tractusx.WebErrOutputFormat { + errorDescription += "
" } } } diff --git a/release-automation/internal/dashboard/tractusx.go b/release-automation/internal/dashboard/tractusx.go index e931c8e5..e3e1f4a3 100644 --- a/release-automation/internal/dashboard/tractusx.go +++ b/release-automation/internal/dashboard/tractusx.go @@ -157,10 +157,13 @@ func initializeChecksForDirectory(dir string) []tractusx.QualityGuideline { checks = append(checks, docs.NewReadmeExists(dir)) checks = append(checks, docs.NewInstallExists(dir)) checks = append(checks, docs.NewChangelogExists(dir)) + checks = append(checks, repo.NewDefaultBranch(dir)) checks = append(checks, repo.NewRepoStructureExists(dir)) checks = append(checks, repo.NewLeadingRepositoryDefined(dir)) checks = append(checks, container.NewAllowedBaseImage(dir)) + checks = append(checks, container.NewNonRootContainer(dir)) checks = append(checks, helm.NewHelmStructureExists(dir)) + checks = append(checks, helm.NewResourceMgmt(dir)) checks = append(checks, helm.NewHelmWorkflowCheck(dir)) return checks }