2019-05-10 00:05:21 -07:00
|
|
|
package event
|
|
|
|
|
2023-03-31 18:27:25 +08:00
|
|
|
import "strings"
|
|
|
|
|
2022-05-17 08:19:03 +02:00
|
|
|
// Info defines the event details
|
2019-05-10 12:36:55 -07:00
|
|
|
type Info struct {
|
2023-07-26 17:06:51 +03:00
|
|
|
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
|
|
|
}
|
2023-03-31 18:27:25 +08: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}, "/")
|
|
|
|
}
|