Skip to content

Poll Mode

Poll mode repeatedly executes a command at intervals until a pattern matches or timeout.

await_command({
command: "kubectl get pods -o wide",
maxDuration: 300,
pollMode: {
enabled: true,
interval: 10
},
successPattern: "Running",
errorPattern: "CrashLoopBackOff|Error"
})
OptionTypeDefaultDescription
enabledbooleanfalseEnable poll mode
intervalnumber5Seconds between polls (1-60)
appendOutputbooleantrueAppend vs replace output
await_command({
command: "kubectl rollout status deployment/myapp",
maxDuration: 300,
pollMode: { enabled: true, interval: 5 },
successPattern: "successfully rolled out"
})
await_command({
command: "curl -s http://localhost:3000/health",
maxDuration: 120,
pollMode: { enabled: true, interval: 5 },
successPattern: '"status":"healthy"'
})
AspectStandard ModePoll Mode
ExecutionOnceRepeated
Best forLong-running commandsStatus checks
Pattern checkAt completionAfter each poll