diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index 752e05983a..3b46d88829 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -5669,8 +5669,11 @@ in order to save resources when the integration does not need to be executed. Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`. The rules for using a Kubernetes CronJob are the following: - - `timer`: when periods can be written as cron expressions. E.g. `timer:tick?period=60000`. + + - `timer`: when periods is set in absolute times in milliseconds with no remaining seconds, for example 120000. If there is any second left as in 121000 (120s and 1s) or the presence of any ot these parameters (delay, repeatCount, time) then a CronJob won't be created. + - `cron`, `quartz`: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g. + `cron:tab?schedule=0/2$\{plus}*\{plus}*\{plus}*\{plus}?` or `quartz:trigger?cron=0\{plus}0/2\{plus}*\{plus}*\{plus}*\{plus}?`. diff --git a/docs/modules/traits/pages/cron.adoc b/docs/modules/traits/pages/cron.adoc index e7b2caa17e..cf8c5277bb 100755 --- a/docs/modules/traits/pages/cron.adoc +++ b/docs/modules/traits/pages/cron.adoc @@ -11,8 +11,11 @@ in order to save resources when the integration does not need to be executed. Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`. The rules for using a Kubernetes CronJob are the following: - - `timer`: when periods can be written as cron expressions. E.g. `timer:tick?period=60000`. + + - `timer`: when periods is set in absolute times in milliseconds with no remaining seconds, for example 120000. If there is any second left as in 121000 (120s and 1s) or the presence of any ot these parameters (delay, repeatCount, time) then a CronJob won't be created. + - `cron`, `quartz`: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g. + `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`. diff --git a/pkg/apis/camel/v1/trait/cron.go b/pkg/apis/camel/v1/trait/cron.go index cb6c8582d6..2a72a9ddb0 100644 --- a/pkg/apis/camel/v1/trait/cron.go +++ b/pkg/apis/camel/v1/trait/cron.go @@ -27,8 +27,11 @@ package trait // Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`. // // The rules for using a Kubernetes CronJob are the following: -// - `timer`: when periods can be written as cron expressions. E.g. `timer:tick?period=60000`. +// +// - `timer`: when periods is set in absolute times in milliseconds with no remaining seconds, for example 120000. If there is any second left as in 121000 (120s and 1s) or the presence of any ot these parameters (delay, repeatCount, time) then a CronJob won't be created. +// // - `cron`, `quartz`: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g. +// // `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`. // // +camel-k:trait=cron. diff --git a/resources/traits.yaml b/resources/traits.yaml index dae6f5aa01..292ebf3a8c 100755 --- a/resources/traits.yaml +++ b/resources/traits.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # --------------------------------------------------------------------------- - + traits: - name: 3scale platform: false @@ -351,10 +351,13 @@ traits: CronJob instead of a standard deployment, in order to save resources when the integration does not need to be executed. Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`. The rules - for using a Kubernetes CronJob are the following: - `timer`: when periods can - be written as cron expressions. E.g. `timer:tick?period=60000`. - `cron`, `quartz`: - when the cron expression does not contain seconds (or the "seconds" part is set - to 0). E.g. `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`.' + for using a Kubernetes CronJob are the following: - `timer`: when periods is set + in absolute times in milliseconds with no remaining seconds, for example 120000. + If there is any second left as in 121000 (120s and 1s) or the presence of any + ot these parameters (delay, repeatCount, time) then a CronJob won''t be created. + - `cron`, `quartz`: when the cron expression does not contain seconds (or the + "seconds" part is set to 0). E.g. `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` + or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`.' properties: - name: enabled type: bool