feat: trigger.enabled + job.run_id lifecycle control (operator v0.1.6, provider v0.1.4)

- TriggerSpec.Enabled bool (default=true): enabled=false масштабирует Deployment до 0
- FunctionJobSpec.RunID int64 (default=0): run_id=0 = skip, >0 = run
- API: PATCH /v1/namespaces/{ns}/triggers/{name} (UpdateTrigger)
- Provider: enabled attribute (Optional, Computed, in-place update)
- Provider: run_id attribute (Optional, Computed, default=0, RequiresReplace)
- operator image: naeel/sless-operator:v0.1.6
- provider: terra.k8c.ru/naeel/sless v0.1.4
This commit is contained in:
“Naeel”
2026-03-08 10:10:32 +04:00
parent 8fb0ef5ea1
commit d67b9745a8
20 changed files with 509 additions and 143 deletions
@@ -62,8 +62,18 @@ spec:
functionRef:
description: FunctionRef — имя Function ресурса в том же namespace
type: string
runId:
default: 0
description: |-
RunID — идентификатор запуска. 0 = не запускать.
Каждое ненулевое значение уникально идентифицирует запуск.
Увеличь RunID (1→2→3) для повторного запуска джоба.
При RunID=0 FunctionJob создаётся в кластере, но k8s Job не запускается.
format: int64
type: integer
required:
- functionRef
- runId
type: object
status:
description: FunctionJobStatus — наблюдаемое состояние (заполняет контроллер).
@@ -55,6 +55,13 @@ spec:
spec:
description: TriggerSpec — желаемое состояние триггера.
properties:
enabled:
default: true
description: |-
Enabled — если false, Deployment функции масштабируется до 0 (функция не принимает запросы).
При true — функция запускается. По умолчанию true.
Позволяет "заморозить" функцию без удаления ресурса.
type: boolean
functionRef:
description: FunctionRef — имя Function ресурса в том же namespace
type: string
@@ -76,6 +83,7 @@ spec:
- cron
type: string
required:
- enabled
- functionRef
- type
type: object