Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions testdata/adapter-configs/cl-deployment/adapter-task-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,23 @@ spec:
field: "name"
- name: "generationSpec"
field: "generation"
- name: "readyConditionStatus"
- name: "clusterNotReady"
expression: |
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].status
: "False"
# Structured conditions with valid operators
conditions:
- field: "readyConditionStatus"
operator: "equals"
value: "False"
? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
: true
- name: "clusterReadyTTL"
expression: |
(timestamp(now()) - timestamp(
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
: now()
)).getSeconds() >= 300

- name: "validationCheck"
# Precondition passes if cluster is NOT Ready OR if cluster is Ready and stable for >300 seconds since last transition (enables self-healing)
expression: |
clusterNotReady || clusterReadyTTL

- name: "clusterAdapterStatus"
apiCall:
Expand Down
22 changes: 12 additions & 10 deletions testdata/adapter-configs/cl-job/adapter-task-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ spec:
- name: "simulateResult" # possible values: success (default), failure, hang, crash, invalid-json, missing-status
field: "simulateResult"
default: "success"
- name: "readyConditionStatus"
- name: "clusterNotReady"
expression: |
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].status
: "False"
# Structured conditions with valid operators
conditions:
- field: "readyConditionStatus"
operator: "equals"
value: "False"
? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
: true
- name: "clusterReadyTTL"
expression: |
(timestamp(now()) - timestamp(
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
: now()
)).getSeconds() >= 300

- name: "validationCheck"
# Valid CEL expression
# Precondition passes if cluster is NOT Ready OR if cluster is Ready and stable for >300 seconds since last transition (enables self-healing)
expression: |
readyConditionStatus == "False"
clusterNotReady || clusterReadyTTL

- name: "clusterAdapterStatus"
apiCall:
Expand Down
22 changes: 12 additions & 10 deletions testdata/adapter-configs/cl-namespace/adapter-task-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,23 @@ spec:
field: "name"
- name: "generationSpec"
field: "generation"
- name: "readyConditionStatus"
- name: "clusterNotReady"
expression: |
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].status
: "False"
# Structured conditions with valid operators
conditions:
- field: "readyConditionStatus"
operator: "equals"
value: "False"
? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
: true
- name: "clusterReadyTTL"
expression: |
(timestamp(now()) - timestamp(
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
: now()
)).getSeconds() >= 300

- name: "validationCheck"
# Valid CEL expression
# Precondition passes if cluster is NOT Ready OR if cluster is Ready and stable for >300 seconds since last transition (enables self-healing)
expression: |
readyConditionStatus == "False"
clusterNotReady || clusterReadyTTL

# Resources with valid K8s manifests
resources:
Expand Down
23 changes: 15 additions & 8 deletions testdata/adapter-configs/np-configmap/adapter-task-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,23 @@ spec:
field: "name"
- name: "generationSpec"
field: "generation"
- name: "readyConditionStatus"
- name: "nodepoolNotReady"
expression: |
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].status
: "False"
# Structured conditions with valid operators
conditions:
- field: "readyConditionStatus"
operator: "equals"
value: "False"
? status.conditions.filter(c, c.type == "Ready")[0].status != "True"
: true
- name: "nodepoolReadyTTL"
expression: |
(timestamp(now()) - timestamp(
status.conditions.filter(c, c.type == "Ready").size() > 0
? status.conditions.filter(c, c.type == "Ready")[0].last_transition_time
: now()
)).getSeconds() >= 300

- name: "validationCheck"
# Precondition passes if nodepool is NOT Ready OR if nodepool is Ready and stable for >300 seconds since last transition (enables self-healing)
expression: |
nodepoolNotReady || nodepoolReadyTTL

- name: "clusterAdapterStatus"
apiCall:
Expand Down