This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 37c839bc50d51dc037619f3ad9416e1a0f79375e Author: zach-robinson <62120488+zach-robin...@users.noreply.github.com> AuthorDate: Fri Jun 4 03:19:14 2021 -0500 Add starting-deadline-seconds option to cron trait --- deploy/traits.yaml | 4 ++++ docs/modules/traits/pages/cron.adoc | 5 +++++ docs/modules/traits/pages/toleration.adoc | 2 +- pkg/trait/cron.go | 8 ++++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 59f6e1e..9e9944e 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -221,6 +221,10 @@ traits: or a passive consumer (e.g. `direct` is a passive consumer).It's required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. `1m` can be expressed as `0/1 * * * *`,while `35m` or `50s` cannot). + - name: starting-deadline-seconds + type: int64 + description: Optional deadline in seconds for starting the job if it misses scheduledtime + for any reason. Missed jobs executions will be counted as failed ones. - name: dependencies platform: true profiles: diff --git a/docs/modules/traits/pages/cron.adoc b/docs/modules/traits/pages/cron.adoc index bebde3e..7e67e51 100755 --- a/docs/modules/traits/pages/cron.adoc +++ b/docs/modules/traits/pages/cron.adoc @@ -71,6 +71,11 @@ either starting from a periodic consumer (only `cron`, `timer` and `quartz` are It's required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. `1m` can be expressed as `0/1 * * * *`, while `35m` or `50s` cannot). +| cron.starting-deadline-seconds +| int64 +| Optional deadline in seconds for starting the job if it misses scheduled +time for any reason. Missed jobs executions will be counted as failed ones. + |=== // End of autogenerated code - DO NOT EDIT! (configuration) diff --git a/docs/modules/traits/pages/toleration.adoc b/docs/modules/traits/pages/toleration.adoc index d3b3e88..d2df246 100755 --- a/docs/modules/traits/pages/toleration.adoc +++ b/docs/modules/traits/pages/toleration.adoc @@ -59,4 +59,4 @@ $ kamel run -t toleration.taints="node.kubernetes.io/network-unavailable:NoExecu * To tolerate the integration pod(s) to be scheduled on a node with a disk of SSD type: + [source,console] -$ kamel run -t toleration.taints="disktype=ssd:PreferNoSchedule" ... \ No newline at end of file +$ kamel run -t toleration.taints="disktype=ssd:PreferNoSchedule" ... diff --git a/pkg/trait/cron.go b/pkg/trait/cron.go index e876128..4954182 100644 --- a/pkg/trait/cron.go +++ b/pkg/trait/cron.go @@ -76,6 +76,9 @@ type cronTrait struct { // It's required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. `1m` can be expressed as `0/1 * * * *`, // while `35m` or `50s` cannot). Auto *bool `property:"auto" json:"auto,omitempty"` + // Optional deadline in seconds for starting the job if it misses scheduled + // time for any reason. Missed jobs executions will be counted as failed ones. + StartingDeadlineSeconds *int64 `property:"starting-deadline-seconds" json:"startingDeadlineSeconds,omitempty"` } var _ ControllerStrategySelector = &cronTrait{} @@ -283,8 +286,9 @@ func (t *cronTrait) getCronJobFor(e *Environment) *v1beta1.CronJob { Annotations: e.Integration.Annotations, }, Spec: v1beta1.CronJobSpec{ - Schedule: t.Schedule, - ConcurrencyPolicy: v1beta1.ConcurrencyPolicy(t.ConcurrencyPolicy), + Schedule: t.Schedule, + ConcurrencyPolicy: v1beta1.ConcurrencyPolicy(t.ConcurrencyPolicy), + StartingDeadlineSeconds: t.StartingDeadlineSeconds, JobTemplate: v1beta1.JobTemplateSpec{ Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{