litmus
litmus copied to clipboard
Custom CronWorkflow Schedule Not Respected
What happened: When creating custom cron workflows in chaos center by importing the YAML as shown here the schedule isn't recognized/ respected.
What you expected to happen: If importing YAML or using pre-defined chaos workflow from my own custom chaos hub, the cron workflow schedule set in YAML is not recognized/ respected and it's required to set a schedule through UI. Next the YAML looks like this -- with two schedules:
kind: CronWorkflow
metadata:
name: custom-workflow-1646680408
namespace: litmus
labels:
subject: custom-workflow-1646680408_litmus
spec:
schedule: 13 14 * * 0-6
concurrencyPolicy: Forbid
startingDeadlineSeconds: 0
workflowSpec:
schedule: 00 10 * * 1-5
concurrencyPolicy: Forbid
startingDeadlineSeconds: 0
workflowSpec:
arguments:
parameters:```
**How to reproduce it (as minimally and precisely as possible)**:
You can copy or save the YAML I linked above, or any CronWorkflow YAML and import it through chaos center & as you progress through the steps in creating workflow, the schedule set in YAML isn't respected or recognized.
**Anything else we need to know?**: N/A
cc: @amityt
@amityt @rajdas98 any updates on the above question?
Hi @lamc , The workflow that you are importing is wrong according to schema.
The workflow that you are importing is not a cron workflow. Please check the kind in line-2 kind: Workflow, for cron-workflow this should be kind: CronWorkflow
If we look at this section in manifest -
schedule: 00 10 * * 1-5
concurrencyPolicy: Forbid
startingDeadlineSeconds: 0
workflowSpec:
arguments:
parameters:
- name: adminModeNamespace
value: litmus
- name: appNamespace
value: djin-shared
The above section will be respected only if you provide kind: CronWorkflow, otherwise the workflow will be considered as non cron workflow.
And because ChaosCenter is considering it as non-cron workflow, that's why the final cron workflow looks like as you posted above -
kind: CronWorkflow
metadata:
name: custom-workflow-1646680408
namespace: litmus
labels:
subject: custom-workflow-1646680408_litmus
spec:
schedule: 13 14 * * 0-6
concurrencyPolicy: Forbid
startingDeadlineSeconds: 0
workflowSpec:
schedule: 00 10 * * 1-5
concurrencyPolicy: Forbid
startingDeadlineSeconds: 0
workflowSpec:
arguments:
parameters:```
Please change the kind to kind: CronWorkflow and check again.
@amityt can add more information.
Hello, I have changed the kind to CronWorkflow in the yaml, however when I still try to schedule workflow it's not respected. here are the steps I take & here is the pre-defined chaos workflow template I use:
- Schedule Workflow in Chaos Center
- Select agent
- Select "create new workflow from one of the pre-defined workflow templates"
- Choose "djin-shared-test" (as provided in link above)
- Tune and adjust weights
- I have to set a schedule either now or recurring
I have checked if my yaml is valid and the indentation/ CronWorkflow resource documentation. Please let me know if I'm missing some steps.