File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
staging/src/k8s.io/apiserver/pkg/endpoints/handlers Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
216
216
217
217
var unknown runtime.Unknown
218
218
internalEvent := & metav1.InternalEvent {}
219
+ outEvent := & metav1.WatchEvent {}
219
220
buf := & bytes.Buffer {}
220
221
ch := s .Watching .ResultChan ()
221
222
for {
@@ -242,10 +243,11 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
242
243
unknown .Raw = buf .Bytes ()
243
244
event .Object = & unknown
244
245
246
+ * outEvent = metav1.WatchEvent {}
247
+
245
248
// create the external type directly and encode it. Clients will only recognize the serialization we provide.
246
249
// The internal event is being reused, not reallocated so its just a few extra assignments to do it this way
247
250
// and we get the benefit of using conversion functions which already have to stay in sync
248
- outEvent := & metav1.WatchEvent {}
249
251
* internalEvent = metav1 .InternalEvent (event )
250
252
err := metav1 .Convert_v1_InternalEvent_To_v1_WatchEvent (internalEvent , outEvent , nil )
251
253
if err != nil {
You can’t perform that action at this time.
0 commit comments