File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,12 @@ func (r *Service) runWatch(
186
186
select {
187
187
case <- ctx .Done ():
188
188
return
189
- case resultChannel <- singleObj .Object :
189
+ case resultChannel <- func () interface {} {
190
+ if singleObj == nil { // object will be nil in case it is deleted
191
+ return nil
192
+ }
193
+ return singleObj .Object
194
+ }():
190
195
}
191
196
} else {
192
197
items := make ([]unstructured.Unstructured , 0 , len (previousObjects ))
Original file line number Diff line number Diff line change @@ -26,12 +26,13 @@ func (suite *CommonTestSuite) TestSchemaSubscribe() {
26
26
expectError bool
27
27
}{
28
28
{
29
- testName : "subscribe_deployment_and_create_deployment_OK " ,
29
+ testName : "subscribe_create_and_delete_deployment_OK " ,
30
30
subscribeQuery : SubscribeDeployment ("my-new-deployment" , false ),
31
31
setupFunc : func (ctx context.Context ) {
32
32
suite .createDeployment (ctx , "my-new-deployment" , map [string ]string {"app" : "my-app" })
33
+ suite .deleteDeployment (ctx , "my-new-deployment" )
33
34
},
34
- expectedEvents : 1 ,
35
+ expectedEvents : 2 ,
35
36
},
36
37
{
37
38
testName : "subscribe_to_replicas_change_OK" ,
You can’t perform that action at this time.
0 commit comments