Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show invalid cron schedule error on cron status ui #7441

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

krrrr38
Copy link
Contributor

@krrrr38 krrrr38 commented Dec 18, 2021

Signed-off-by: krrrr38 k.kaizu38@gmail.com

Don't bother creating a PR until you've done this:

  • Run make pre-commit -B to fix codegen, lint, and commit message problems.

Problem

argo-workflows doen't support cron second, but it is possible to create from yaml. At that time cron workflow ui doesn't show error.

Pasted_Image_2021_12_18_17_50

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
  name: my-cronworkflow-template-1
spec:
  schedule: "*/2 * * * * *"
  workflowSpec:
    entrypoint: whalesay-template
    workflowTemplateRef:
      name: my-workflow-template-1
    arguments:
      parameters:
        - name: message1
          value: hello from cron

How to solve?

Copy schedule validator from cron editor has schedule validator into pretty-schedule.

if (schedule.split(' ').length === 6) {
throw new Error('seconds are not supported');
}
return (
<span>
<SuccessIcon /> {x.toString(schedule)}
</span>
);
} catch (e) {
return (
<span>
<WarningIcon /> Schedule maybe invalid: {e.toString()}
</span>

image

Signed-off-by: krrrr38 <k.kaizu38@gmail.com>
@alexec alexec merged commit c172d1d into argoproj:master Jan 19, 2022
yriveiro pushed a commit to yriveiro/argo-workflows that referenced this pull request Jan 27, 2022
@alexec alexec mentioned this pull request Jan 27, 2022
4 tasks
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants