From 190585b1f74fe68b4a7d3fca7c7d873eee372e20 Mon Sep 17 00:00:00 2001 From: Simar Date: Fri, 13 Oct 2023 21:25:07 -0600 Subject: [PATCH] cleanup --- pkg/flag/misconf_flags.go | 4 ---- pkg/flag/options.go | 2 +- pkg/result/filter.go | 4 +--- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/flag/misconf_flags.go b/pkg/flag/misconf_flags.go index 2c97706b381e..bf21b9aab642 100644 --- a/pkg/flag/misconf_flags.go +++ b/pkg/flag/misconf_flags.go @@ -76,7 +76,6 @@ type MisconfFlagGroup struct { PolicyBundleRepository *Flag // Values Files - IgnorePolicy *Flag HelmValues *Flag HelmValueFiles *Flag HelmFileValues *Flag @@ -91,7 +90,6 @@ type MisconfOptions struct { PolicyBundleRepository string // Values Files - IgnorePolicy string HelmValues []string HelmValueFiles []string HelmFileValues []string @@ -124,7 +122,6 @@ func (f *MisconfFlagGroup) Flags() []*Flag { f.IncludeNonFailures, f.ResetPolicyBundle, f.PolicyBundleRepository, - f.IgnorePolicy, f.HelmValues, f.HelmValueFiles, f.HelmFileValues, @@ -139,7 +136,6 @@ func (f *MisconfFlagGroup) ToOptions() (MisconfOptions, error) { IncludeNonFailures: getBool(f.IncludeNonFailures), ResetPolicyBundle: getBool(f.ResetPolicyBundle), PolicyBundleRepository: getString(f.PolicyBundleRepository), - IgnorePolicy: getString(f.IgnorePolicy), HelmValues: getStringSlice(f.HelmValues), HelmValueFiles: getStringSlice(f.HelmValueFiles), HelmFileValues: getStringSlice(f.HelmFileValues), diff --git a/pkg/flag/options.go b/pkg/flag/options.go index fb653b5f7126..caf723fa5bb7 100644 --- a/pkg/flag/options.go +++ b/pkg/flag/options.go @@ -153,7 +153,7 @@ func (o *Options) FilterOpts() result.FilterOption { IgnoreStatuses: o.IgnoreStatuses, IncludeNonFailures: o.IncludeNonFailures, IgnoreFile: o.IgnoreFile, - PolicyFile: o.ReportOptions.IgnorePolicy, + PolicyFile: o.IgnorePolicy, IgnoreLicenses: o.IgnoredLicenses, VEXPath: o.VEXPath, } diff --git a/pkg/result/filter.go b/pkg/result/filter.go index af06dcfc1896..9e57ff87fde5 100644 --- a/pkg/result/filter.go +++ b/pkg/result/filter.go @@ -86,13 +86,11 @@ func calcMisconfSummary(result *types.Result, misconfSummary *types.MisconfSumma return nil } - var failed, passed int + var passed int for _, rm := range result.Misconfigurations { switch rm.Status { case types.StatusPassed: passed++ - case types.StatusFailure: - failed++ } }