-
Notifications
You must be signed in to change notification settings - Fork 64
/
event_recorder.go
179 lines (161 loc) · 5.5 KB
/
event_recorder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Code generated by counterfeiter. DO NOT EDIT.
package fake
import (
"sync"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"
)
type EventRecorder struct {
AnnotatedEventfStub func(runtime.Object, map[string]string, string, string, string, ...interface{})
annotatedEventfMutex sync.RWMutex
annotatedEventfArgsForCall []struct {
arg1 runtime.Object
arg2 map[string]string
arg3 string
arg4 string
arg5 string
arg6 []interface{}
}
EventStub func(runtime.Object, string, string, string)
eventMutex sync.RWMutex
eventArgsForCall []struct {
arg1 runtime.Object
arg2 string
arg3 string
arg4 string
}
EventfStub func(runtime.Object, string, string, string, ...interface{})
eventfMutex sync.RWMutex
eventfArgsForCall []struct {
arg1 runtime.Object
arg2 string
arg3 string
arg4 string
arg5 []interface{}
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *EventRecorder) AnnotatedEventf(arg1 runtime.Object, arg2 map[string]string, arg3 string, arg4 string, arg5 string, arg6 ...interface{}) {
fake.annotatedEventfMutex.Lock()
fake.annotatedEventfArgsForCall = append(fake.annotatedEventfArgsForCall, struct {
arg1 runtime.Object
arg2 map[string]string
arg3 string
arg4 string
arg5 string
arg6 []interface{}
}{arg1, arg2, arg3, arg4, arg5, arg6})
stub := fake.AnnotatedEventfStub
fake.recordInvocation("AnnotatedEventf", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6})
fake.annotatedEventfMutex.Unlock()
if stub != nil {
fake.AnnotatedEventfStub(arg1, arg2, arg3, arg4, arg5, arg6...)
}
}
func (fake *EventRecorder) AnnotatedEventfCallCount() int {
fake.annotatedEventfMutex.RLock()
defer fake.annotatedEventfMutex.RUnlock()
return len(fake.annotatedEventfArgsForCall)
}
func (fake *EventRecorder) AnnotatedEventfCalls(stub func(runtime.Object, map[string]string, string, string, string, ...interface{})) {
fake.annotatedEventfMutex.Lock()
defer fake.annotatedEventfMutex.Unlock()
fake.AnnotatedEventfStub = stub
}
func (fake *EventRecorder) AnnotatedEventfArgsForCall(i int) (runtime.Object, map[string]string, string, string, string, []interface{}) {
fake.annotatedEventfMutex.RLock()
defer fake.annotatedEventfMutex.RUnlock()
argsForCall := fake.annotatedEventfArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6
}
func (fake *EventRecorder) Event(arg1 runtime.Object, arg2 string, arg3 string, arg4 string) {
fake.eventMutex.Lock()
fake.eventArgsForCall = append(fake.eventArgsForCall, struct {
arg1 runtime.Object
arg2 string
arg3 string
arg4 string
}{arg1, arg2, arg3, arg4})
stub := fake.EventStub
fake.recordInvocation("Event", []interface{}{arg1, arg2, arg3, arg4})
fake.eventMutex.Unlock()
if stub != nil {
fake.EventStub(arg1, arg2, arg3, arg4)
}
}
func (fake *EventRecorder) EventCallCount() int {
fake.eventMutex.RLock()
defer fake.eventMutex.RUnlock()
return len(fake.eventArgsForCall)
}
func (fake *EventRecorder) EventCalls(stub func(runtime.Object, string, string, string)) {
fake.eventMutex.Lock()
defer fake.eventMutex.Unlock()
fake.EventStub = stub
}
func (fake *EventRecorder) EventArgsForCall(i int) (runtime.Object, string, string, string) {
fake.eventMutex.RLock()
defer fake.eventMutex.RUnlock()
argsForCall := fake.eventArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}
func (fake *EventRecorder) Eventf(arg1 runtime.Object, arg2 string, arg3 string, arg4 string, arg5 ...interface{}) {
fake.eventfMutex.Lock()
fake.eventfArgsForCall = append(fake.eventfArgsForCall, struct {
arg1 runtime.Object
arg2 string
arg3 string
arg4 string
arg5 []interface{}
}{arg1, arg2, arg3, arg4, arg5})
stub := fake.EventfStub
fake.recordInvocation("Eventf", []interface{}{arg1, arg2, arg3, arg4, arg5})
fake.eventfMutex.Unlock()
if stub != nil {
fake.EventfStub(arg1, arg2, arg3, arg4, arg5...)
}
}
func (fake *EventRecorder) EventfCallCount() int {
fake.eventfMutex.RLock()
defer fake.eventfMutex.RUnlock()
return len(fake.eventfArgsForCall)
}
func (fake *EventRecorder) EventfCalls(stub func(runtime.Object, string, string, string, ...interface{})) {
fake.eventfMutex.Lock()
defer fake.eventfMutex.Unlock()
fake.EventfStub = stub
}
func (fake *EventRecorder) EventfArgsForCall(i int) (runtime.Object, string, string, string, []interface{}) {
fake.eventfMutex.RLock()
defer fake.eventfMutex.RUnlock()
argsForCall := fake.eventfArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}
func (fake *EventRecorder) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.annotatedEventfMutex.RLock()
defer fake.annotatedEventfMutex.RUnlock()
fake.eventMutex.RLock()
defer fake.eventMutex.RUnlock()
fake.eventfMutex.RLock()
defer fake.eventfMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *EventRecorder) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ record.EventRecorder = new(EventRecorder)