executor: update gpm.podLister in AddNamespace to fix IsValid nil panic
This commit is contained in:
@@ -833,6 +833,11 @@ func (gpm *GenericPoolManager) AddNamespace(ctx context.Context, ns string, mgr
|
||||
return fmt.Errorf("AddNamespace %s: register informers: %w", ns, err)
|
||||
}
|
||||
|
||||
// Also update gpm.podLister so IsValid can resolve pods in this namespace.
|
||||
// Without this line gpm.podLister[ns] is nil for dynamically-added user namespaces,
|
||||
// causing a nil-pointer panic in IsValid, which leaves activeRequests permanently stuck at 1.
|
||||
gpm.podLister[ns] = gpmInformer.Core().V1().Pods().Lister()
|
||||
|
||||
// Start the factories — they will begin syncing immediately.
|
||||
finformer.Start(ctx.Done())
|
||||
gpmInformer.Start(ctx.Done())
|
||||
|
||||
Reference in New Issue
Block a user