When trying to conditionally run an action that depends on the success of previous actions plus a parameter value we get an error. See example below on second action in playbook , note the "success()" function that causes the failure.
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: grant-mssql-user-db-access
spec:
description: Grant an MSSQL user read or readwrite access to a database
parameters:
- name: delay
label: Expires after
type: list
properties:
options:
- label: "1 minute"
value: '1m'
- label: "Indefinitely"
value: "0"
actions:
- name: Assign Database User Roles
if: "always()"
sql:
connection: connection://default/mssql-db
driver: mssql
query: |
<sql here>
- name: Clear Rolebinding Broken
if: success() && params.delay != "0"
delay: '.params.delay'
sql:
connection: connection://default/mssql-db
driver: mssql
query: |
<sql here>
The workaround is to use the "getAction()" function instead of "success()"
When trying to conditionally run an action that depends on the success of previous actions plus a parameter value we get an error. See example below on second action in playbook , note the "success()" function that causes the failure.
The workaround is to use the "getAction()" function instead of "success()"