From ee7e48690c3ccff39a8105c16c974ba27c006f74 Mon Sep 17 00:00:00 2001 From: Pradeep Sagitra Date: Wed, 10 Jun 2026 12:41:21 +0530 Subject: [PATCH] fix: allow cron aliases in schedule validation (#16100) Co-authored-by: Mason Malone <651224+MasonM@users.noreply.github.com> (cherry picked from commit 631fd14d629ba0e18bda32fbd95e0f1de6bb8811) Signed-off-by: Pradeep Sagitra Signed-off-by: Alan Clucas --- 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 +- pkg/apis/workflow/v1alpha1/cron_workflow_types.go | 2 +- pkg/apis/workflow/v1alpha1/generated.proto | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/base/crds/full/argoproj.io_cronworkflows.yaml b/manifests/base/crds/full/argoproj.io_cronworkflows.yaml index 35df12abb55c..b201c2ffff3b 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 8bac9215c9c7..7ed9b3fb6c3f 100644 --- a/manifests/quick-start-minimal.yaml +++ b/manifests/quick-start-minimal.yaml @@ -39811,7 +39811,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 f95ecbc2a850..dac7eba94fca 100644 --- a/manifests/quick-start-mysql.yaml +++ b/manifests/quick-start-mysql.yaml @@ -39811,7 +39811,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 4b8a0f2eddd1..7a1ba6a7aa3a 100644 --- a/manifests/quick-start-postgres.yaml +++ b/manifests/quick-start-postgres.yaml @@ -39811,7 +39811,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 836a38406d9e..65ca6756f11a 100644 --- a/pkg/apis/workflow/v1alpha1/cron_workflow_types.go +++ b/pkg/apis/workflow/v1alpha1/cron_workflow_types.go @@ -65,7 +65,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 d2ba7df061ed..d2d50646fb4c 100644 --- a/pkg/apis/workflow/v1alpha1/generated.proto +++ b/pkg/apis/workflow/v1alpha1/generated.proto @@ -522,7 +522,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.