mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 09:26:54 +00:00
16 lines
394 B
Go
16 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")
|
||
|
}
|