diff --git a/charts/policy-reporter/Chart.yaml b/charts/policy-reporter/Chart.yaml index a0241305..f96e052d 100644 --- a/charts/policy-reporter/Chart.yaml +++ b/charts/policy-reporter/Chart.yaml @@ -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 diff --git a/charts/policy-reporter/values.yaml b/charts/policy-reporter/values.yaml index a9b7040b..bba6d12a 100644 --- a/charts/policy-reporter/values.yaml +++ b/charts/policy-reporter/values.yaml @@ -1,7 +1,7 @@ image: repository: fjogeleit/policy-reporter pullPolicy: IfNotPresent - tag: 1.2.0 + tag: 1.2.1 imagePullSecrets: [] diff --git a/pkg/kubernetes/mapper.go b/pkg/kubernetes/mapper.go index b86db918..b83897ad 100644 --- a/pkg/kubernetes/mapper.go +++ b/pkg/kubernetes/mapper.go @@ -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), diff --git a/pkg/kubernetes/mapper_test.go b/pkg/kubernetes/mapper_test.go index af6e4649..ffe4b922 100644 --- a/pkg/kubernetes/mapper_test.go +++ b/pkg/kubernetes/mapper_test.go @@ -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",