Conditional execution
TLDR;
Opctl supports using if statements and predicates to make parts of your op run conditionally.
Example
- Start this op:
name: conditionalExecution
inputs:
shouldRunContainer:
description: whether to run the container or not
boolean: {}
run:
if:
- eq: [true, $(shouldRunContainer)]
container:
cmd: [echo, 'hello!']
image: { ref: ghcr.io/linuxcontainers/alpine } - When prompted, enter
trueorfalse - Observe you only see the container run and
hello!logged when you entertrue.