mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 07:57:07 +00:00
* refactor: use BackgroundProcessingEnabled method Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> * refactor: webhooks metrics reporting Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> * refactor: metrics package Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
15 lines
394 B
Go
15 lines
394 B
Go
package policyruleinfo
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func ParsePolicyRuleInfoMetricChangeType(change string) (PolicyRuleInfoMetricChangeType, error) {
|
|
if change == "created" {
|
|
return PolicyRuleCreated, nil
|
|
}
|
|
if change == "deleted" {
|
|
return PolicyRuleDeleted, nil
|
|
}
|
|
return "", fmt.Errorf("wrong policy rule count metric change type found %s. Allowed: '%s', '%s'", change, "created", "deleted")
|
|
}
|