1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/pkg/violation/util.go

28 lines
648 B
Go
Raw Normal View History

2019-05-13 18:17:28 -07:00
package violation
2019-04-30 17:13:44 -07:00
2019-05-21 11:00:09 -07:00
import policytype "github.com/nirmata/kyverno/pkg/apis/policy/v1alpha1"
2019-05-10 00:05:21 -07:00
2019-04-30 17:13:44 -07:00
// Source for the events recorder
const violationEventSource = "policy-controller"
// Name for the workqueue to store the events
const workqueueViolationName = "Policy-Violations"
// Event Reason
const violationEventResrouce = "Violation"
2019-07-19 15:10:40 -07:00
//Info describes the policyviolation details
2019-04-30 17:13:44 -07:00
type Info struct {
2019-05-10 00:05:21 -07:00
Policy string
policytype.Violation
2019-04-30 17:13:44 -07:00
}
func (i Info) getKey() string {
return i.Kind + "/" + i.Namespace + "/" + i.Name
}
//BuildKey returns the key format
func BuildKey(rKind, rNs, rName string) string {
return rKind + "/" + rNs + "/" + rName
}