Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions changelog/fragments/msg_scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Add information to the errors raised by scorecard basic tests to allow easily identify the scenarios

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "addition"
6 changes: 4 additions & 2 deletions internal/scorecard/tests/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package tests

import (
"fmt"

scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
apimanifests "github.com/operator-framework/api/pkg/manifests"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand All @@ -35,7 +37,7 @@ func CheckSpecTest(bundle *apimanifests.Bundle) scapiv1alpha3.TestStatus {

crSet, err := GetCRs(bundle)
if err != nil {
r.Errors = append(r.Errors, "error getting custom resources")
r.Errors = append(r.Errors, fmt.Sprintf("error getting custom resources: %s", err))
r.State = scapiv1alpha3.FailState
}

Expand All @@ -48,7 +50,7 @@ func checkSpec(crSet []unstructured.Unstructured,
res scapiv1alpha3.TestResult) scapiv1alpha3.TestResult {
for _, cr := range crSet {
if cr.Object["spec"] == nil {
res.Errors = append(res.Errors, "error spec does not exist")
res.Errors = append(res.Errors, fmt.Sprintf("error spec does not exist for the custom resource %s", cr.GetName()))
res.State = scapiv1alpha3.FailState
return res
}
Expand Down