mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
21 lines
524 B
Go
21 lines
524 B
Go
package policyruleinfo
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/kyverno/kyverno/pkg/metrics"
|
|
)
|
|
|
|
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")
|
|
}
|
|
|
|
func ParsePromMetrics(pm metrics.PromMetrics) PromMetrics {
|
|
return PromMetrics(pm)
|
|
}
|