File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1+ # entries is a list of entries to include in
2+ # release notes and/or the migration guide
3+ entries :
4+ - description : >
5+ Add information to the errors raised by scorecard basic tests to allow easily identify the scenarios
6+
7+ # kind is one of:
8+ # - addition
9+ # - change
10+ # - deprecation
11+ # - removal
12+ # - bugfix
13+ kind: "addition"
Original file line number Diff line number Diff line change 1515package tests
1616
1717import (
18+ "fmt"
19+
1820 scapiv1alpha3 "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
1921 apimanifests "github.com/operator-framework/api/pkg/manifests"
2022 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -35,7 +37,7 @@ func CheckSpecTest(bundle *apimanifests.Bundle) scapiv1alpha3.TestStatus {
3537
3638 crSet , err := GetCRs (bundle )
3739 if err != nil {
38- r .Errors = append (r .Errors , "error getting custom resources" )
40+ r .Errors = append (r .Errors , fmt . Sprintf ( "error getting custom resources: %s" , err ) )
3941 r .State = scapiv1alpha3 .FailState
4042 }
4143
@@ -48,7 +50,7 @@ func checkSpec(crSet []unstructured.Unstructured,
4850 res scapiv1alpha3.TestResult ) scapiv1alpha3.TestResult {
4951 for _ , cr := range crSet {
5052 if cr .Object ["spec" ] == nil {
51- res .Errors = append (res .Errors , "error spec does not exist" )
53+ res .Errors = append (res .Errors , fmt . Sprintf ( "error spec does not exist for the custom resource %s" , cr . GetName ()) )
5254 res .State = scapiv1alpha3 .FailState
5355 return res
5456 }
You can’t perform that action at this time.
0 commit comments