diff --git a/pkg/reports/reports.go b/pkg/reports/reports.go index cbc51a30..552108bb 100644 --- a/pkg/reports/reports.go +++ b/pkg/reports/reports.go @@ -126,8 +126,10 @@ func NewReport(pm *packaging.PolicyManifest, rc *results.ResultCollection) (api. switch { case result == nil: - missing = true - missingRules = append(missingRules, rule.ID) + if !rule.Manual { + missing = true + missingRules = append(missingRules, rule.ID) + } case result.IsFailureState(): success = false violations = result.Violations diff --git a/pkg/reports/reports_test.go b/pkg/reports/reports_test.go index 02e26432..337bbaab 100644 --- a/pkg/reports/reports_test.go +++ b/pkg/reports/reports_test.go @@ -245,6 +245,11 @@ func TestNewReport(t *testing.T) { ID: "b_rule", Name: "My Rule B", }, + { + ID: "c_rule", + Name: "My Rule C", + Manual: true, + }, }, }, }, @@ -295,6 +300,15 @@ func TestNewReport(t *testing.T) { Links: []string{}, Violations: []string{"violation"}, }, + api.ReportRule{ + ID: "c_rule", + Name: "My Rule C", + Manual: true, + Success: false, + Missing: false, + Links: []string{}, + Violations: []string{}, + }, }, }, }, @@ -349,6 +363,15 @@ func TestNewReport(t *testing.T) { Links: []string{}, Violations: []string{}, }, + api.ReportRule{ + ID: "c_rule", + Name: "My Rule C", + Manual: true, + Success: false, + Missing: false, + Links: []string{}, + Violations: []string{}, + }, }, }, },