Skip to content

Commit

Permalink
Fix cron trait doc, timer usage is missing information
Browse files Browse the repository at this point in the history
Fix doc related to when the timer is materialized as a CronJOb
  • Loading branch information
claudio4j committed Aug 1, 2023
1 parent 06a087a commit fe53a42
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 4 additions & 1 deletion docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}?`.
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/traits/pages/cron.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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}?`.


Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/camel/v1/trait/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/resources.go

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions resources/traits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

traits:
- name: 3scale
platform: false
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe53a42

Please sign in to comment.