diff --git a/helm/adapter1/adapter-task-config.yaml b/helm/adapter1/adapter-task-config.yaml index be9e619..15c8595 100644 --- a/helm/adapter1/adapter-task-config.yaml +++ b/helm/adapter1/adapter-task-config.yaml @@ -39,21 +39,23 @@ spec: field: "name" - name: "generation" 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: diff --git a/helm/adapter3/adapter-task-config.yaml b/helm/adapter3/adapter-task-config.yaml index 9746668..dd59054 100644 --- a/helm/adapter3/adapter-task-config.yaml +++ b/helm/adapter3/adapter-task-config.yaml @@ -44,21 +44,23 @@ spec: field: "name" - name: "generation" 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" - # Valid CEL expression + # Precondition passes if nodepool is NOT Ready OR if nodepool is Ready and stable for >300 seconds since last transition (enables self-healing) expression: | - readyConditionStatus == "False" + nodepoolNotReady || nodepoolReadyTTL # Resources with valid K8s manifests resources: