diff --git a/internal/mesh/internal/controllers/xds/controller.go b/internal/mesh/internal/controllers/xds/controller.go index 5368efc48b595..604181a49e188 100644 --- a/internal/mesh/internal/controllers/xds/controller.go +++ b/internal/mesh/internal/controllers/xds/controller.go @@ -202,6 +202,9 @@ func (r *xdsReconciler) Reconcile(ctx context.Context, rt controller.Runtime, re // Step 4: Track relationships between ProxyStateTemplates and ServiceEndpoints. r.endpointsMapper.TrackItem(req.ID, endpointsInProxyStateTemplate) + if len(endpointsInProxyStateTemplate) == 0 { + r.endpointsMapper.UntrackItem(req.ID) + } // Iterate through leaf certificate references. // For each leaf certificate reference, the controller should: