feat(job): merge sless_function into sless_job — self-contained build+run

- FunctionJobSpec: убран FunctionRef, добавлены Runtime/Entrypoint/Env/S3Key/MemoryMB/TimeoutSec
- FunctionJobStatus: новый ImageRef, новая фаза Building
- FunctionJobReconciler: Building фаза (kaniko), убрана зависимость от Function CRD
  Builder+OperatorNamespace как поля struct; аннотация sless.kube5s.ru/build-job guard
- main.go: Builder+OperatorNamespace переданы в FunctionJobReconciler
- jobs.go handler: jobRequest/jobResponse без FunctionRef; новый UploadJobCode handler
- router.go: /jobs/{name}/upload маршрут
- client.go: JobRequest/JobResponse обновлены; UploadJobCode; uploadCodeToURL общий хелпер
- job_resource.go: полная переработка — источник/среда встроены в JobModel, ModifyPlan,
  Create с upload, wait_timeout_sec=900 по умолчанию (kaniko + выполнение)
- examples/POSTGRES/functions.tf: раскомментирован, sless_function удалён,
  sless_job самодостаточен (inline source_dir/runtime/entrypoint/env_vars)
This commit is contained in:
Naeel
2026-03-20 21:27:35 +03:00
parent 1b3c8376c0
commit 8ca8faedd1
12 changed files with 569 additions and 185 deletions
+6 -4
View File
@@ -178,10 +178,12 @@ func main() {
os.Exit(1)
}
if err = (&controllers.FunctionJobReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
RegistrySecret: cfg.RegistrySecret,
KubeClient: kubernetes.NewForConfigOrDie(mgr.GetConfig()),
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
RegistrySecret: cfg.RegistrySecret,
KubeClient: kubernetes.NewForConfigOrDie(mgr.GetConfig()),
Builder: bldr,
OperatorNamespace: "sless",
}).SetupWithManager(mgr); err != nil {
log.Error("unable to create controller", "controller", "FunctionJob", "err", err)
os.Exit(1)