Merge pull request #8804 from hashicorp/b-cronexpr-zero-padding

Fix cron handling with zero-padding months
This commit is contained in:
Mahmood Ali
2020-09-01 12:22:01 -04:00
committed by GitHub
6 changed files with 15 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ IMPROVEMENTS:
BUG FIXES:
* core: Fixed a bug where unpromoted job versions are used when rescheduling failed allocations [[GH-8691](https://github.com/hashicorp/nomad/issues/8691)]
* core: Fixed a bug where servers become unresponsive when cron jobs containing zero-padded months [[GH-8804](https://github.com/hashicorp/nomad/issues/8804)]
* core: Fixed bugs where scaling policies could be matched against incorrect jobs with a similar prefix [[GH-8753](https://github.com/hashicorp/nomad/issues/8753)]
* core: Fixed a bug where garbage collection evaluations that failed or spanned leader elections would be re-enqueued forever. [[GH-8682](https://github.com/hashicorp/nomad/issues/8682)]
* core (Enterprise): Fixed a bug where enterprise servers may self-terminate as licenses are ignored after a Raft snapshot restore. [[GH-8737](https://github.com/hashicorp/nomad/issues/8737)]

2
go.mod
View File

@@ -56,7 +56,7 @@ require (
github.com/hashicorp/consul-template v0.24.1
github.com/hashicorp/consul/api v1.6.0
github.com/hashicorp/consul/sdk v0.6.0
github.com/hashicorp/cronexpr v1.1.0
github.com/hashicorp/cronexpr v1.1.1
github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-connlimit v0.2.0

2
go.sum
View File

@@ -334,6 +334,8 @@ github.com/hashicorp/consul/sdk v0.6.0 h1:FfhMEkwvQl57CildXJyGHnwGGM4HMODGyfjGwN
github.com/hashicorp/consul/sdk v0.6.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM=
github.com/hashicorp/cronexpr v1.1.0 h1:dnNsWtH0V2ReN7JccYe8m//Bj14+PjJDntR1dz0Cixk=
github.com/hashicorp/cronexpr v1.1.0/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4=
github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c=
github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=

View File

@@ -78,15 +78,15 @@ var (
"2090": 2090, "2091": 2091, "2092": 2092, "2093": 2093, "2094": 2094, "2095": 2095, "2096": 2096, "2097": 2097, "2098": 2098, "2099": 2099,
}
monthTokens = map[string]int{
`1`: 1, `jan`: 1, `january`: 1,
`2`: 2, `feb`: 2, `february`: 2,
`3`: 3, `mar`: 3, `march`: 3,
`4`: 4, `apr`: 4, `april`: 4,
`5`: 5, `may`: 5,
`6`: 6, `jun`: 6, `june`: 6,
`7`: 7, `jul`: 7, `july`: 7,
`8`: 8, `aug`: 8, `august`: 8,
`9`: 9, `sep`: 9, `september`: 9,
`1`: 1, `01`: 1, `jan`: 1, `january`: 1,
`2`: 2, `02`: 2, `feb`: 2, `february`: 2,
`3`: 3, `03`: 3, `mar`: 3, `march`: 3,
`4`: 4, `04`: 4, `apr`: 4, `april`: 4,
`5`: 5, `05`: 5, `may`: 5,
`6`: 6, `06`: 6, `jun`: 6, `june`: 6,
`7`: 7, `07`: 7, `jul`: 7, `july`: 7,
`8`: 8, `08`: 8, `aug`: 8, `august`: 8,
`9`: 9, `09`: 9, `sep`: 9, `september`: 9,
`10`: 10, `oct`: 10, `october`: 10,
`11`: 11, `nov`: 11, `november`: 11,
`12`: 12, `dec`: 12, `december`: 12,

View File

@@ -632,6 +632,7 @@ type DispatchPayloadConfig struct {
const (
TaskLifecycleHookPrestart = "prestart"
TaskLifecycleHookPoststart = "poststart"
)
type TaskLifecycle struct {

2
vendor/modules.txt vendored
View File

@@ -363,7 +363,7 @@ github.com/hashicorp/consul/api
github.com/hashicorp/consul/sdk/freeport
github.com/hashicorp/consul/sdk/testutil
github.com/hashicorp/consul/sdk/testutil/retry
# github.com/hashicorp/cronexpr v1.1.0
# github.com/hashicorp/cronexpr v1.1.1
## explicit
github.com/hashicorp/cronexpr
# github.com/hashicorp/errwrap v1.0.0