fix: stage0 quick fixes (operator v0.1.19)
- TriggerReconciler: RequeueAfter 15s когда Function не Ready (ранее зависал без повторного reconcile) - FunctionJobReconciler: RequeueAfter 15s когда Function не Ready - UpdateFunction: добавлена валидация runtime/entrypoint/memory_mb (ранее мог затереть spec нулями при частичном обновлении) - CronJob: curlimages/curl:latest → curlimages/curl:8.5.0 (pin version) - Config: удалён FunctionNamespacePrefix (мёртвое поле, нигде не использовалось) - Invocations endpoint: возвращает 501 вместо пустого списка (SaveInvocation нигде не вызывается — честный ответ клиенту) - Собран образ naeel/sless-operator:v0.1.19
This commit is contained in:
@@ -160,6 +160,16 @@ func (h *Handler) UpdateFunction(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Валидация обязательных полей — PUT семантика, нельзя обнулять критичные поля
|
||||
if req.Runtime == "" || req.Entrypoint == "" {
|
||||
writeJSON(w, http.StatusBadRequest, errResp("runtime and entrypoint are required"))
|
||||
return
|
||||
}
|
||||
if req.MemoryMB <= 0 || req.MemoryMB > 4096 {
|
||||
writeJSON(w, http.StatusBadRequest, errResp("memory_mb must be between 1 and 4096"))
|
||||
return
|
||||
}
|
||||
|
||||
// Обновляем только изменяемые поля spec
|
||||
fn.Spec.Runtime = req.Runtime
|
||||
fn.Spec.Entrypoint = req.Entrypoint
|
||||
|
||||
Reference in New Issue
Block a user