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:
parent
dfa12c7849
commit
6e33bde8ef
4 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
image:
|
||||
repository: fjogeleit/policy-reporter
|
||||
pullPolicy: IfNotPresent
|
||||
tag: 1.2.0
|
||||
tag: 1.2.1
|
||||
|
||||
imagePullSecrets: []
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue