1
0
Fork 0
mirror of https://github.com/kyverno/policy-reporter.git synced 2024-12-14 11:57:32 +00:00

PolicyReport CRD Mapping Update (#25)

* Support v1alpha2 "result" property name für PolicyResults
This commit is contained in:
Frank Jogeleit 2021-04-20 22:49:23 +02:00 committed by GitHub
parent dfa12c7849
commit 6e33bde8ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -5,8 +5,8 @@ description: |
It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord
type: application
version: 1.2.0
appVersion: 1.2.0
version: 1.2.1
appVersion: 1.2.1
dependencies:
- name: monitoring

View file

@ -1,7 +1,7 @@
image:
repository: fjogeleit/policy-reporter
pullPolicy: IfNotPresent
tag: 1.2.0
tag: 1.2.1
imagePullSecrets: []

View file

@ -137,7 +137,14 @@ func (m *mapper) mapResult(result map[string]interface{}) report.Result {
}
}
status := result["status"].(report.Status)
var status report.Status
if s, ok := result["status"]; ok {
status = s.(report.Status)
}
if r, ok := result["result"]; ok {
status = r.(report.Status)
}
r := report.Result{
Message: result["message"].(string),

View file

@ -82,7 +82,7 @@ var clusterPolicyMap = map[string]interface{}{
"results": []interface{}{
map[string]interface{}{
"message": "message",
"status": "fail",
"result": "fail",
"scored": true,
"policy": "required-label",
"rule": "app-label-required",