layer1: add executor namespace subscriber step 25

This commit is contained in:
Naeel
2026-04-26 10:31:54 +03:00
parent 331f531962
commit 6f77fa5a9a
3 changed files with 86 additions and 0 deletions
@@ -0,0 +1,32 @@
package multitenant
import (
"context"
"go.uber.org/zap"
"k8s.io/client-go/kubernetes"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
"github.com/fission/fission/pkg/executor/executortype"
"github.com/fission/fission/pkg/utils"
"github.com/fission/fission/pkg/utils/manager"
)
func NewNamespaceSubscriber(
logger *zap.Logger,
kubernetesClient kubernetes.Interface,
executorTypes map[fv1.ExecutorType]executortype.ExecutorType,
mgr manager.Interface,
) utils.NamespaceSubscriber {
return utils.NamespaceSubscriberFuncs{
SubscriberName: "executor",
AddFunc: func(ctx context.Context, record utils.NamespaceRecord) error {
registerNamespace(ctx, logger, kubernetesClient, record.Name, executorTypes, mgr)
return nil
},
ResyncFunc: func(ctx context.Context, record utils.NamespaceRecord) error {
registerNamespace(ctx, logger, kubernetesClient, record.Name, executorTypes, mgr)
return nil
},
}
}