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:
parent
8e7703b286
commit
1770a9b84b
@ -30,6 +30,8 @@ resource "sless_trigger" "hello_http" {
|
||||
name = "hello-http-trigger"
|
||||
type = "http"
|
||||
function = sless_function.hello_http.name
|
||||
# enabled = false — чтобы заморозить функцию (не удаляя ресурс), потом поставить зновь true
|
||||
enabled = true
|
||||
}
|
||||
|
||||
output "trigger_url" {
|
||||
|
||||
@ -28,12 +28,14 @@ resource "sless_function" "hello_job" {
|
||||
}
|
||||
|
||||
# Одноразовый запуск. Все поля immutable — изменение любого пересоздаёт джоб.
|
||||
# run_id: 0 = не запускать, 1+ = запустить. Для повторного запуска увеличь run_id (1→2→3...).
|
||||
resource "sless_job" "hello_run" {
|
||||
namespace = "default"
|
||||
name = "hello-run"
|
||||
function = sless_function.hello_job.name
|
||||
event_json = jsonencode({ numbers = [1, 2, 3, 4, 5] })
|
||||
wait_timeout_sec = 120
|
||||
run_id = 1
|
||||
}
|
||||
|
||||
output "job_phase" {
|
||||
|
||||
@ -8,7 +8,7 @@ terraform {
|
||||
required_providers {
|
||||
sless = {
|
||||
source = "terra.k8c.ru/naeel/sless"
|
||||
version = "~> 0.1.1"
|
||||
version = "~> 0.1.4"
|
||||
}
|
||||
archive = {
|
||||
source = "hashicorp/archive"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user