This repository was archived by the owner on Aug 28, 2025. It is now read-only.
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(
186186 select {
187187 case <- ctx .Done ():
188188 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+ }():
190195 }
191196 } else {
192197 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() {
2626 expectError bool
2727 }{
2828 {
29- testName : "subscribe_deployment_and_create_deployment_OK " ,
29+ testName : "subscribe_create_and_delete_deployment_OK " ,
3030 subscribeQuery : SubscribeDeployment ("my-new-deployment" , false ),
3131 setupFunc : func (ctx context.Context ) {
3232 suite .createDeployment (ctx , "my-new-deployment" , map [string ]string {"app" : "my-app" })
33+ suite .deleteDeployment (ctx , "my-new-deployment" )
3334 },
34- expectedEvents : 1 ,
35+ expectedEvents : 2 ,
3536 },
3637 {
3738 testName : "subscribe_to_replicas_change_OK" ,
You can’t perform that action at this time.
0 commit comments