Skip to content

Commit

Permalink
Merge pull request #125661 from mjudeikis/mjudeikis/poststarthookctx.…
Browse files Browse the repository at this point in the history
…stopch.cleanup

Clean deprecated context.StopCh

Kubernetes-commit: bb350f711174670443e23aa3616606870a471bd7
  • Loading branch information
k8s-publishing-bot committed Jul 23, 2024
2 parents 876df11 + 4df8aea commit 3bbcc94
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
)

s.GenericAPIServer.AddPostStartHookOrDie("start-apiextensions-informers", func(context genericapiserver.PostStartHookContext) error {
s.Informers.Start(context.StopCh)
s.Informers.Start(context.Done())
return nil
})
s.GenericAPIServer.AddPostStartHookOrDie("start-apiextensions-controllers", func(context genericapiserver.PostStartHookContext) error {
Expand All @@ -231,20 +231,20 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
if s.GenericAPIServer.StaticOpenAPISpec != nil {
if s.GenericAPIServer.OpenAPIVersionedService != nil {
openapiController := openapicontroller.NewController(s.Informers.Apiextensions().V1().CustomResourceDefinitions())
go openapiController.Run(s.GenericAPIServer.StaticOpenAPISpec, s.GenericAPIServer.OpenAPIVersionedService, context.StopCh)
go openapiController.Run(s.GenericAPIServer.StaticOpenAPISpec, s.GenericAPIServer.OpenAPIVersionedService, context.Done())
}

if s.GenericAPIServer.OpenAPIV3VersionedService != nil {
openapiv3Controller := openapiv3controller.NewController(s.Informers.Apiextensions().V1().CustomResourceDefinitions())
go openapiv3Controller.Run(s.GenericAPIServer.OpenAPIV3VersionedService, context.StopCh)
go openapiv3Controller.Run(s.GenericAPIServer.OpenAPIV3VersionedService, context.Done())
}
}

go namingController.Run(context.StopCh)
go establishingController.Run(context.StopCh)
go nonStructuralSchemaController.Run(5, context.StopCh)
go apiApprovalController.Run(5, context.StopCh)
go finalizingController.Run(5, context.StopCh)
go namingController.Run(context.Done())
go establishingController.Run(context.Done())
go nonStructuralSchemaController.Run(5, context.Done())
go apiApprovalController.Run(5, context.Done())
go finalizingController.Run(5, context.Done())

discoverySyncedCh := make(chan struct{})
go discoveryController.Run(context.StopCh, discoverySyncedCh)
Expand All @@ -265,7 +265,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
return true, nil
}
return false, nil
}, context.StopCh)
}, context.Done())
})

return s, nil
Expand Down

0 comments on commit 3bbcc94

Please sign in to comment.