From 6c2afd3b6cc824b82222c69cfc15d45741931730 Mon Sep 17 00:00:00 2001 From: Pradeep Sagitra Date: Fri, 15 May 2026 05:38:50 +0000 Subject: [PATCH] fix: allow cron aliases in schedule validation CronWorkflow validation rejected valid cron aliases such as JAN and MON-FRI even though they are supported by the runtime cron parser. Updated the schedule validation regex to allow alphabetic cron aliases while semantic validation continues to be handled by the cron parser. Fixes #16052 Signed-off-by: Pradeep Sagitra --- manifests/base/crds/full/argoproj.io_cronworkflows.yaml | 2 +- manifests/quick-start-minimal.yaml | 2 +- manifests/quick-start-mysql.yaml | 2 +- manifests/quick-start-postgres.yaml | 2 +- manifests/quick-start-telemetry.yaml | 2 +- pkg/apis/workflow/v1alpha1/cron_workflow_types.go | 2 +- pkg/apis/workflow/v1alpha1/generated.proto | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/base/crds/full/argoproj.io_cronworkflows.yaml b/manifests/base/crds/full/argoproj.io_cronworkflows.yaml index 98f130592283..0687515e0bc4 100644 --- a/manifests/base/crds/full/argoproj.io_cronworkflows.yaml +++ b/manifests/base/crds/full/argoproj.io_cronworkflows.yaml @@ -57,7 +57,7 @@ spec: description: 'v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format' items: - pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$ + pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$ type: string minItems: 1 type: array diff --git a/manifests/quick-start-minimal.yaml b/manifests/quick-start-minimal.yaml index 9c1b63fefad8..83e1faece688 100644 --- a/manifests/quick-start-minimal.yaml +++ b/manifests/quick-start-minimal.yaml @@ -40732,7 +40732,7 @@ spec: description: 'v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format' items: - pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$ + pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$ type: string minItems: 1 type: array diff --git a/manifests/quick-start-mysql.yaml b/manifests/quick-start-mysql.yaml index 97539d2bf7f1..dca23c8b6e80 100644 --- a/manifests/quick-start-mysql.yaml +++ b/manifests/quick-start-mysql.yaml @@ -40732,7 +40732,7 @@ spec: description: 'v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format' items: - pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$ + pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$ type: string minItems: 1 type: array diff --git a/manifests/quick-start-postgres.yaml b/manifests/quick-start-postgres.yaml index cd87bd93d17a..e91a817967db 100644 --- a/manifests/quick-start-postgres.yaml +++ b/manifests/quick-start-postgres.yaml @@ -40732,7 +40732,7 @@ spec: description: 'v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format' items: - pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$ + pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$ type: string minItems: 1 type: array diff --git a/manifests/quick-start-telemetry.yaml b/manifests/quick-start-telemetry.yaml index e38c29bc38cf..380a4d4536b2 100644 --- a/manifests/quick-start-telemetry.yaml +++ b/manifests/quick-start-telemetry.yaml @@ -40732,7 +40732,7 @@ spec: description: 'v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format' items: - pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$ + pattern: ^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$ type: string minItems: 1 type: array diff --git a/pkg/apis/workflow/v1alpha1/cron_workflow_types.go b/pkg/apis/workflow/v1alpha1/cron_workflow_types.go index 9793c84a23e9..141fe92548b6 100644 --- a/pkg/apis/workflow/v1alpha1/cron_workflow_types.go +++ b/pkg/apis/workflow/v1alpha1/cron_workflow_types.go @@ -66,7 +66,7 @@ type CronWorkflowSpec struct { StopStrategy *StopStrategy `json:"stopStrategy,omitempty" protobuf:"bytes,10,opt,name=stopStrategy"` // v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:items:Pattern=`^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$` + // +kubebuilder:validation:items:Pattern=`^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$` Schedules []string `json:"schedules" protobuf:"bytes,11,opt,name=schedules"` // v3.6 and after: When is an expression that determines if a run should be scheduled. When string `json:"when,omitempty" protobuf:"bytes,12,opt,name=when"` diff --git a/pkg/apis/workflow/v1alpha1/generated.proto b/pkg/apis/workflow/v1alpha1/generated.proto index 107395513276..26e5d1898ce7 100644 --- a/pkg/apis/workflow/v1alpha1/generated.proto +++ b/pkg/apis/workflow/v1alpha1/generated.proto @@ -524,7 +524,7 @@ message CronWorkflowSpec { // v3.6 and after: Schedules is a list of schedules to run the Workflow in Cron format // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:items:Pattern=`^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([0-9*,/?-]+\s+){4}[0-9*,/?-]+)$` + // +kubebuilder:validation:items:Pattern=`^(@(yearly|annually|monthly|weekly|daily|midnight|hourly)|@every\s+([0-9]+(ns|us|µs|ms|s|m|h))+|([A-Za-z0-9*,/?-]+\s+){4}[A-Za-z0-9*,/?-]+)$` repeated string schedules = 11; // v3.6 and after: When is an expression that determines if a run should be scheduled.