fix(console): v1.3.91 — deps сохраняются в аннотации и восстанавливаются при edit
- handleCreateFunction: deps → аннотация fission-console/deps - handleUpdateFunctionCode: deps → аннотация fission-console/deps (или удаление если пусто) - GET /functions/:name: возвращает deps из аннотации - openEdit: заполняет e-deps.value = fn.deps (вместо пустого поля)
This commit is contained in:
@@ -214,6 +214,9 @@ func (s *Server) handleCreateFunction(w http.ResponseWriter, r *http.Request) {
|
||||
now := time.Now().UTC()
|
||||
fnAnnotations[functionCreatedAtAnnotation] = now.Format(time.RFC3339)
|
||||
fnAnnotations[functionUpdatedAtAnnotation] = now.Format(time.RFC3339)
|
||||
if req.Deps != "" {
|
||||
fnAnnotations["fission-console/deps"] = req.Deps
|
||||
}
|
||||
if req.TTL != "" {
|
||||
expiresAt, ttlErr := parseTTL(req.TTL)
|
||||
if ttlErr != nil {
|
||||
@@ -402,6 +405,11 @@ func (s *Server) handleUpdateFunctionCode(w http.ResponseWriter, r *http.Request
|
||||
}
|
||||
fnAnnotations[functionCreatedAtAnnotation] = createdAt.UTC().Format(time.RFC3339)
|
||||
fnAnnotations[functionUpdatedAtAnnotation] = now.Format(time.RFC3339)
|
||||
if req.Deps != "" {
|
||||
fnAnnotations["fission-console/deps"] = req.Deps
|
||||
} else {
|
||||
delete(fnAnnotations, "fission-console/deps")
|
||||
}
|
||||
fn.SetAnnotations(fnAnnotations)
|
||||
if err := unstructured.SetNestedField(fn.Object, map[string]any{
|
||||
"name": newPkgName,
|
||||
|
||||
Reference in New Issue
Block a user