feat: logs modal + ESC close + /functions/:name/logs endpoint (v1.3.61)

This commit is contained in:
“Naeel”
2026-05-07 20:51:02 +04:00
parent a9bd2e93c7
commit 9b0089e15a
8 changed files with 136 additions and 5 deletions
+4
View File
@@ -21,6 +21,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
)
// defaultSATokenPath — путь к service account токену внутри pod-а.
@@ -31,6 +32,7 @@ const defaultSATokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"
// Содержит все зависимости: kubernetes client, конфиги, кэши.
type Server struct {
dyn dynamic.Interface
kube kubernetes.Interface // typed client — только для логов подов
ns string // системный namespace (fallback, обычно "fission")
routerURL string
http *http.Client
@@ -62,6 +64,7 @@ type Server struct {
// Config содержит все параметры для создания Server.
type Config struct {
Dyn dynamic.Interface
Kube kubernetes.Interface
Namespace string
RouterURL string
HTTPTimeout time.Duration
@@ -80,6 +83,7 @@ func NewServer(cfg Config) *Server {
log.Printf("NewServer: storagesvcURL=%q", cfg.StoragesvcURL)
return &Server{
dyn: cfg.Dyn,
kube: cfg.Kube,
ns: cfg.Namespace,
routerURL: cfg.RouterURL,
http: &http.Client{Timeout: cfg.HTTPTimeout},