1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/cmd/internal/reporting.go
Vishal Choudhary ec546e6fb4
feat: add helm configuration for reporting in different rules (#11376)
* feat: add helm configuration for reporting in different rules (forgot signoff)

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: linter and tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: rename reporting.imageVerification

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-10-11 09:42:29 +00:00

15 lines
661 B
Go

package internal
import (
"strings"
"github.com/go-logr/logr"
reportutils "github.com/kyverno/kyverno/pkg/utils/report"
)
func setupReporting(logger logr.Logger) reportutils.ReportingConfiguration {
logger = logger.WithName("setup-reporting").WithValues("enableReporting", enableReporting)
cfg := reportutils.NewReportingConfig(strings.Split(enableReporting, ",")...)
logger.Info("setting up reporting...", "validate", cfg.ValidateReportsEnabled(), "mutate", cfg.MutateReportsEnabled(), "mutateExisiting", cfg.MutateExistingReportsEnabled(), "imageVerify", cfg.ImageVerificationReportsEnabled(), "generate", cfg.GenerateReportsEnabled())
return cfg
}