mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
This reverts commit 65c100566c
.
This commit is contained in:
parent
65c100566c
commit
7a2045bc11
2 changed files with 2 additions and 6 deletions
pkg/metrics
|
@ -48,12 +48,10 @@ func registerPolicyExecutionDurationMetric(
|
||||||
//policy - policy related data
|
//policy - policy related data
|
||||||
//engineResponse - resource and rule related data
|
//engineResponse - resource and rule related data
|
||||||
func ProcessEngineResponse(m *metrics.MetricsConfig, policy kyvernov1.PolicyInterface, engineResponse response.EngineResponse, executionCause metrics.RuleExecutionCause, generateRuleLatencyType string, resourceRequestOperation metrics.ResourceRequestOperation) error {
|
func ProcessEngineResponse(m *metrics.MetricsConfig, policy kyvernov1.PolicyInterface, engineResponse response.EngineResponse, executionCause metrics.RuleExecutionCause, generateRuleLatencyType string, resourceRequestOperation metrics.ResourceRequestOperation) error {
|
||||||
name, namespace, policyType, backgroundMode, _, _ := metrics.GetPolicyInfos(policy)
|
name, namespace, policyType, backgroundMode, validationMode, err := metrics.GetPolicyInfos(policy)
|
||||||
validationMode, err := metrics.ParsePolicyValidationMode(engineResponse.GetValidationFailureAction())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
resourceSpec := engineResponse.PolicyResponse.Resource
|
resourceSpec := engineResponse.PolicyResponse.Resource
|
||||||
resourceKind := resourceSpec.Kind
|
resourceKind := resourceSpec.Kind
|
||||||
resourceNamespace := resourceSpec.Namespace
|
resourceNamespace := resourceSpec.Namespace
|
||||||
|
|
|
@ -43,12 +43,10 @@ func registerPolicyResultsMetric(
|
||||||
//policy - policy related data
|
//policy - policy related data
|
||||||
//engineResponse - resource and rule related data
|
//engineResponse - resource and rule related data
|
||||||
func ProcessEngineResponse(m *metrics.MetricsConfig, policy kyvernov1.PolicyInterface, engineResponse response.EngineResponse, executionCause metrics.RuleExecutionCause, resourceRequestOperation metrics.ResourceRequestOperation) error {
|
func ProcessEngineResponse(m *metrics.MetricsConfig, policy kyvernov1.PolicyInterface, engineResponse response.EngineResponse, executionCause metrics.RuleExecutionCause, resourceRequestOperation metrics.ResourceRequestOperation) error {
|
||||||
name, namespace, policyType, backgroundMode, _, _ := metrics.GetPolicyInfos(policy)
|
name, namespace, policyType, backgroundMode, validationMode, err := metrics.GetPolicyInfos(policy)
|
||||||
validationMode, err := metrics.ParsePolicyValidationMode(engineResponse.GetValidationFailureAction())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
resourceSpec := engineResponse.PolicyResponse.Resource
|
resourceSpec := engineResponse.PolicyResponse.Resource
|
||||||
resourceKind := resourceSpec.Kind
|
resourceKind := resourceSpec.Kind
|
||||||
resourceNamespace := resourceSpec.Namespace
|
resourceNamespace := resourceSpec.Namespace
|
||||||
|
|
Loading…
Add table
Reference in a new issue