mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-30 17:01:59 +00:00
Include annotations all the time
Kubernetes-commit: 8373afef0e0886fcd05a4cbf8b0bedeaa82a4d05
This commit is contained in:
parent
f7f367ebae
commit
c633a8222b
@ -29,7 +29,6 @@ type FakeRecorder struct {
|
|||||||
Events chan string
|
Events chan string
|
||||||
|
|
||||||
IncludeObject bool
|
IncludeObject bool
|
||||||
IncludeAnnotations bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func objectString(object runtime.Object, includeObject bool) string {
|
func objectString(object runtime.Object, includeObject bool) string {
|
||||||
@ -42,13 +41,6 @@ func objectString(object runtime.Object, includeObject bool) string {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func annotationString(annotations map[string]string, includeAnnotations bool) string {
|
|
||||||
if !includeAnnotations {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return " " + fmt.Sprint(annotations)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *FakeRecorder) writeEvent(event string) {
|
func (f *FakeRecorder) writeEvent(event string) {
|
||||||
if f.Events != nil {
|
if f.Events != nil {
|
||||||
f.Events <- event
|
f.Events <- event
|
||||||
@ -57,7 +49,6 @@ func (f *FakeRecorder) writeEvent(event string) {
|
|||||||
|
|
||||||
func (f *FakeRecorder) Event(object runtime.Object, eventtype, reason, message string) {
|
func (f *FakeRecorder) Event(object runtime.Object, eventtype, reason, message string) {
|
||||||
f.writeEvent(fmt.Sprintf("%s %s %s%s", eventtype, reason, message, objectString(object, f.IncludeObject)))
|
f.writeEvent(fmt.Sprintf("%s %s %s%s", eventtype, reason, message, objectString(object, f.IncludeObject)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) {
|
func (f *FakeRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) {
|
||||||
@ -71,7 +62,7 @@ func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[st
|
|||||||
f.writeEvent(
|
f.writeEvent(
|
||||||
fmt.Sprintf(eventtype+" "+reason+" "+messageFmt, args...) +
|
fmt.Sprintf(eventtype+" "+reason+" "+messageFmt, args...) +
|
||||||
objectString(object, f.IncludeObject) +
|
objectString(object, f.IncludeObject) +
|
||||||
annotationString(annotations, f.IncludeAnnotations),
|
" " + fmt.Sprint(annotations),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user