1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/pkg/event/info.go

26 lines
557 B
Go
Raw Normal View History

2019-05-10 00:05:21 -07:00
package event
import "strings"
// Info defines the event details
2019-05-10 12:36:55 -07:00
type Info struct {
Kind string
Name string
Namespace string
RelatedAPIVersion string
RelatedKind string
RelatedName string
RelatedNamespace string
Reason Reason
Message string
Action Action
Source Source
2019-05-10 10:38:38 -07:00
}
func (i *Info) Resource() string {
if i.Namespace == "" {
return strings.Join([]string{i.Kind, i.Name}, "/")
}
return strings.Join([]string{i.Kind, i.Namespace, i.Name}, "/")
}