File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
pkg/reconciler/apis/apiexport Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,13 @@ func NewController(
172172 },
173173 ))
174174
175+ _ , _ = apiExportEndpointSliceInformer .Informer ().AddEventHandler (events .WithoutSyncs (cache.ResourceEventHandlerFuncs {
176+ DeleteFunc : func (obj interface {}) {
177+ c .enqueueAllApiExportEndpointSlices (obj .(* apisv1alpha1.APIExportEndpointSlice ))
178+ },
179+ },
180+ ))
181+
175182 return c , nil
176183}
177184
@@ -261,6 +268,23 @@ func (c *controller) enqueueSecret(secret *corev1.Secret) {
261268 }
262269}
263270
271+ func (c * controller ) enqueueAllApiExportEndpointSlices (apiExportEndpointSlice * apisv1alpha1.APIExportEndpointSlice ) {
272+ clusterName := logicalcluster .From (apiExportEndpointSlice )
273+
274+ apiExportName := apiExportEndpointSlice .Spec .APIExport .Name
275+
276+ apiExport , err := c .getAPIExport (clusterName , apiExportName )
277+ if err != nil {
278+ if errors .IsNotFound (err ) {
279+ return
280+ }
281+ utilruntime .HandleError (err )
282+ return
283+ }
284+
285+ c .enqueueAPIExport (apiExport )
286+ }
287+
264288// Start starts the controller, which stops when ctx.Done() is closed.
265289func (c * controller ) Start (ctx context.Context , numThreads int ) {
266290 defer utilruntime .HandleCrash ()
You can’t perform that action at this time.
0 commit comments