From 94f26b69eed98ce8ad4c22bdbb23e2d2f134ee5a Mon Sep 17 00:00:00 2001 From: Naeel Date: Sun, 26 Apr 2026 09:35:39 +0300 Subject: [PATCH] layer1: fix newdeploy namespace parity step 5 --- .../2026-04-26-namespace-manager-step5.md | 29 +++++++++++++++++++ .../executortype/newdeploy/newdeploymgr.go | 5 ++++ 2 files changed, 34 insertions(+) create mode 100644 doc/thinking/2026-04-26-namespace-manager-step5.md diff --git a/doc/thinking/2026-04-26-namespace-manager-step5.md b/doc/thinking/2026-04-26-namespace-manager-step5.md new file mode 100644 index 00000000..c802aca1 --- /dev/null +++ b/doc/thinking/2026-04-26-namespace-manager-step5.md @@ -0,0 +1,29 @@ +# 2026-04-26 — NamespaceManager rewrite, step 5 + +## Цель шага + +Исправить несимметрию между startup-path и dynamic namespace onboarding в `newdeploy` executor. + +## Дефект + +На старте `MakeNewDeploy()` регистрирует два вида обработчиков на Fission informers: + +- `FunctionEventHandlers()` +- `EnvEventHandlers()` + +Но dynamic `AddNamespace()` регистрировал только `FunctionEventHandlers()`. + +Это означало, что namespace, появившийся после старта процесса, обслуживается не тем же +код-path, что namespace, известный на старте. Для multi-tenant Layer 1 это плохая семантика: +часть поведения newdeploy зависит не от namespace, а от момента его появления. + +## Исправление + +В `AddNamespace()` добавляется регистрация `EnvEventHandlers()` перед запуском informer factory. + +## Что НЕ меняем + +- не меняем container executor; +- не меняем poolmgr; +- не добавляем remove semantics; +- не меняем router. \ No newline at end of file diff --git a/pkg/executor/executortype/newdeploy/newdeploymgr.go b/pkg/executor/executortype/newdeploy/newdeploymgr.go index c325582d..1fa34b7d 100644 --- a/pkg/executor/executortype/newdeploy/newdeploymgr.go +++ b/pkg/executor/executortype/newdeploy/newdeploymgr.go @@ -944,6 +944,11 @@ func (deploy *NewDeploy) AddNamespace(ctx context.Context, ns string, mgr manage return fmt.Errorf("AddNamespace %s (newdeploy): add function handler: %w", ns, err) } + _, err = finformer.Core().V1().Environments().Informer().AddEventHandler(deploy.EnvEventHandlers(ctx)) + if err != nil { + return fmt.Errorf("AddNamespace %s (newdeploy): add environment handler: %w", ns, err) + } + finformer.Start(ctx.Done()) ndmInformer.Start(ctx.Done())