Compare commits

...
8 Commits
Author SHA1 Message Date
releaser f8790a6916 chore(release): prepare for 1.6.12 (#429)
Unbound Release / Check Preconditions (push) Successful in 6s
Unbound Release / Create Tag (push) Skipped
Unbound Release / Generate Changelog and Handle PR (push) Successful in 1m2s
Release / release (push) Successful in 1m13s
Unbound Release / Create Release (push) Successful in 1m2s
cron-checker / vulnerabilities (push) Successful in 1m30s
cron-checker / test (push) Successful in 1m25s
cron-checker / build (push) Successful in 1m13s
## [1.6.12] - 2026-10-09

### 🐛 Bug Fixes

- *(deps)* Update module k8s.io/apimachinery to v0.37.1 (#419)
- *(deps)* Update kubernetes monorepo to v0.37.1 (#421)
- Evaluate schedules in the cronjob's spec.timeZone (#428)

### ⚙️ Miscellaneous Tasks

- *(deps)* Update go toolchain directive to v1.27.1 (#415)
- *(deps)* Update golang:1.27.1 docker digest to 2c9f73f (#417)
- *(deps)* Update golang:1.27.1 docker digest to 45639bc (#423)
- *(deps)* Update golang docker tag to v1.27.2 (#425)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: https://gitea.unbound.se/unboundsoftware/cron-checker/pulls/429
Co-authored-by: Unbound Releaser <releaser@unbound.se>
2026-10-09 07:59:04 +00:00
argoyle 52d52a222c fix: evaluate schedules in the cronjob's spec.timeZone (#428)
Unbound Release / Check Preconditions (push) Successful in 3s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 17s
Unbound Release / Create Tag (push) Skipped
cron-checker / vulnerabilities (push) Successful in 2m15s
Unbound Release / Create Release (push) Successful in 15s
Release / release (push) Successful in 21s
cron-checker / test (push) Successful in 2m12s
cron-checker / build (push) Successful in 50s
Schedules were always evaluated in UTC because `schedule.Next` uses the location of `lastScheduleTime`, which the API returns in UTC. A CronJob with `spec.timeZone` set was therefore reported as not running every day. For example, Paidit's `prod/dayclose` runs at `0 7 * * *` Europe/Stockholm: it ran at 05:00Z, but cron-checker expected 07:00Z and alerted every minute from 09:02 local time.

- Convert `since` to the CronJob's `spec.timeZone` before computing the next run. CronJobs without a `timeZone` behave as before.
- An invalid time zone returns an error, the same way an invalid schedule does.
- Embed `time/tzdata`, because the image is `FROM scratch` and has no zoneinfo.
- Tests: an invalid time zone, and a time-zone case that fails without the fix.
- Bumped golang.org/x/net to v0.60.0. govulncheck was already failing on main with five x/net advisories, which blocks the build job.
- Bumped the go toolchain to 1.27.2 for eight stdlib advisories. This is the same change as Renovate #427, which will close once this is merged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01C8SW6vsbkrTKjLNatQ8JTg
Reviewed-on: https://gitea.unbound.se/unboundsoftware/cron-checker/pulls/428
2026-10-09 07:54:30 +00:00
renovate 40311eaeaa chore(deps): update golang docker tag to v1.27.2 (#425)
Unbound Release / Check Preconditions (push) Successful in 12s
cron-checker / test (push) Successful in 1m14s
Unbound Release / Create Tag (push) Skipped
cron-checker / vulnerabilities (push) Successful in 1m15s
Unbound Release / Create Release (push) Successful in 17s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 25s
cron-checker / build (push) Successful in 2m21s
Release / release (push) Successful in 4m43s
2026-10-08 21:44:00 +00:00
renovate 1e022f86b8 chore(deps): update golang:1.27.1 docker digest to 45639bc (#423)
Unbound Release / Create Tag (push) Skipped
Unbound Release / Check Preconditions (push) Successful in 22s
cron-checker / test (push) Successful in 1m1s
cron-checker / vulnerabilities (push) Successful in 53s
Unbound Release / Create Release (push) Successful in 24s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 38s
Release / release (push) Successful in 19m46s
cron-checker / build (push) Successful in 2m19s
2026-10-06 05:27:28 +00:00
renovate dddba4a63b fix(deps): update kubernetes monorepo to v0.37.1 (#421)
Unbound Release / Generate Changelog and Handle PR (push) Successful in 37s
Unbound Release / Check Preconditions (push) Successful in 22s
Unbound Release / Create Tag (push) Skipped
cron-checker / build (push) Successful in 51s
cron-checker / test (push) Successful in 1m2s
cron-checker / vulnerabilities (push) Successful in 53s
Unbound Release / Create Release (push) Successful in 27s
Release / release (push) Successful in 1m17s
2026-09-26 23:10:05 +00:00
renovate 90977dbeac fix(deps): update module k8s.io/apimachinery to v0.37.1 (#419)
Unbound Release / Generate Changelog and Handle PR (push) Successful in 37s
Unbound Release / Check Preconditions (push) Successful in 44s
Unbound Release / Create Tag (push) Skipped
Unbound Release / Create Release (push) Successful in 26s
Release / release (push) Successful in 1m54s
cron-checker / build (push) Successful in 7m1s
cron-checker / test (push) Successful in 1m25s
cron-checker / vulnerabilities (push) Successful in 52s
2026-09-26 21:14:32 +00:00
renovate 0f3ffba117 chore(deps): update golang:1.27.1 docker digest to 2c9f73f (#417)
Unbound Release / Create Tag (push) Skipped
cron-checker / test (push) Successful in 1m9s
cron-checker / vulnerabilities (push) Successful in 1m0s
cron-checker / build (push) Successful in 50s
Release / release (push) Successful in 1m54s
Unbound Release / Check Preconditions (push) Successful in 27s
Unbound Release / Create Release (push) Successful in 29s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 52s
2026-09-19 05:18:16 +00:00
renovate fe05605c84 chore(deps): update go toolchain directive to v1.27.1 (#415)
Unbound Release / Check Preconditions (push) Successful in 30s
Unbound Release / Create Tag (push) Skipped
Unbound Release / Create Release (push) Successful in 32s
Release / release (push) Successful in 3m50s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 46s
cron-checker / build (push) Successful in 18m15s
cron-checker / test (push) Successful in 1m31s
cron-checker / vulnerabilities (push) Successful in 53s
2026-09-04 20:20:54 +00:00
7 changed files with 114 additions and 27 deletions

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
{ {
"version": "1.6.11" "version": "1.6.12"
} }
+15
View File
@@ -2,6 +2,21 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [1.6.12] - 2026-10-09
### 🐛 Bug Fixes
- *(deps)* Update module k8s.io/apimachinery to v0.37.1 (#419)
- *(deps)* Update kubernetes monorepo to v0.37.1 (#421)
- Evaluate schedules in the cronjob's spec.timeZone (#428)
### ⚙️ Miscellaneous Tasks
- *(deps)* Update go toolchain directive to v1.27.1 (#415)
- *(deps)* Update golang:1.27.1 docker digest to 2c9f73f (#417)
- *(deps)* Update golang:1.27.1 docker digest to 45639bc (#423)
- *(deps)* Update golang docker tag to v1.27.2 (#425)
## [1.6.11] - 2026-09-02 ## [1.6.11] - 2026-09-02
### 🐛 Bug Fixes ### 🐛 Bug Fixes
+1 -1
View File
@@ -1,4 +1,4 @@
FROM amd64/golang:1.27.1@sha256:e930cef3c5b281370d1ee736f163327d444f76d369b0d52cd742e5aab12e8f7f as build FROM amd64/golang:1.27.2@sha256:9e036bef9c3cd035cae4aeff523b3997c3c8aa993b13d112a71ea90143e87e48 as build
WORKDIR /build WORKDIR /build
ENV CGO_ENABLED=0 ENV CGO_ENABLED=0
ADD . /build ADD . /build
+8 -8
View File
@@ -2,16 +2,16 @@ module gitlab.com/unboundsoftware/cron-checker
go 1.26.0 go 1.26.0
toolchain go1.27.0 toolchain go1.27.2
require ( require (
github.com/alecthomas/kingpin/v2 v2.4.0 github.com/alecthomas/kingpin/v2 v2.4.0
github.com/multiplay/go-slack v0.0.0-20220428123529-0762aee71fe3 github.com/multiplay/go-slack v0.0.0-20220428123529-0762aee71fe3
github.com/robfig/cron v1.2.0 github.com/robfig/cron v1.2.0
github.com/sanity-io/litter v1.5.8 github.com/sanity-io/litter v1.5.8
k8s.io/api v0.37.0 k8s.io/api v0.37.1
k8s.io/apimachinery v0.37.0 k8s.io/apimachinery v0.37.1
k8s.io/client-go v0.37.0 k8s.io/client-go v0.37.1
) )
require ( require (
@@ -44,11 +44,11 @@ require (
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/net v0.57.0 // indirect golang.org/x/net v0.60.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sys v0.47.0 // indirect golang.org/x/sys v0.48.0 // indirect
golang.org/x/term v0.45.0 // indirect golang.org/x/term v0.46.0 // indirect
golang.org/x/text v0.40.0 // indirect golang.org/x/text v0.42.0 // indirect
golang.org/x/time v0.15.0 // indirect golang.org/x/time v0.15.0 // indirect
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
+14 -14
View File
@@ -98,16 +98,16 @@ go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU=
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg=
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI=
@@ -122,12 +122,12 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.37.0 h1:Z//Vj9N7RA/yS2sDmxyeo7h+RR4zbUrd2vrd3Z0TbB4= k8s.io/api v0.37.1 h1:l6N77U7tjwB5L056bgrBTJIEdevac/naBZ3iSvDNfpM=
k8s.io/api v0.37.0/go.mod h1:LKXgcJWMc+f4OLbP5SFR8rulEg07zZhpi/zMULiBImk= k8s.io/api v0.37.1/go.mod h1:zSlbB1YpJ1YQlFVQy20UYll81UJSJJUMLhkhvg6Z78M=
k8s.io/apimachinery v0.37.0 h1:Np2AbDtf8x6RDHiD8T9LbKJ9gaegeVNa8yNm5FuGKm0= k8s.io/apimachinery v0.37.1 h1:hGCYyvKHCwtwMitj2vU4vYx0Z16N9GyZk9BBnz0wDAE=
k8s.io/apimachinery v0.37.0/go.mod h1:RN3nhprFSCxOi5Selxd7oMTXOe/c+ZbcE7Im+TS2zkE= k8s.io/apimachinery v0.37.1/go.mod h1:jF84AyUi/IRIXRot5f+lm6MpxoWI+F1XgjaMmwCdTFw=
k8s.io/client-go v0.37.0 h1:nsN31fy8wBySuZ+QRnKmrjRSQLOG2rvoGN0tKd12zhQ= k8s.io/client-go v0.37.1 h1:QTv/5ha4jAHtW9qxxVBkQVFBRDb4jHfFopQqqMdc+wM=
k8s.io/client-go v0.37.0/go.mod h1:FcGqw+Ll/gNQiq+nPGY1Oyt9y7SgDh1d3MW3RFDEbn0= k8s.io/client-go v0.37.1/go.mod h1:dnAPtTnCNY38Ho04D2KdY1F4IKausa9UbqaAZKl60SY=
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A=
+13 -2
View File
@@ -8,6 +8,7 @@ import (
"os/signal" "os/signal"
"syscall" "syscall"
"time" "time"
_ "time/tzdata" // the image is FROM scratch, so embed zoneinfo for spec.timeZone
"github.com/alecthomas/kingpin/v2" "github.com/alecthomas/kingpin/v2"
"github.com/multiplay/go-slack/chat" "github.com/multiplay/go-slack/chat"
@@ -19,8 +20,10 @@ import (
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
) )
var checkFunc = doCheck var (
var exitFunc = os.Exit checkFunc = doCheck
exitFunc = os.Exit
)
func main() { func main() {
slackUrl := kingpin.Flag("slack-url", "The Slack Webhook URL").Envar("SLACK_URL").Required().String() slackUrl := kingpin.Flag("slack-url", "The Slack Webhook URL").Envar("SLACK_URL").Required().String()
@@ -68,6 +71,14 @@ func doCheck(client Client, slackUrl string, ic chan os.Signal, sleepTime time.D
if c.Status.LastScheduleTime != nil { if c.Status.LastScheduleTime != nil {
since = *c.Status.LastScheduleTime since = *c.Status.LastScheduleTime
} }
// The schedule is evaluated in the location of since, so use the cronjob's time zone (UTC if unset)
if c.Spec.TimeZone != nil {
loc, err := time.LoadLocation(*c.Spec.TimeZone)
if err != nil {
return fmt.Errorf("error loading time zone of %s/%s (%s): %w", c.Namespace, c.Name, *c.Spec.TimeZone, err)
}
since = v1.NewTime(since.In(loc))
}
schedule, err := parser.Parse(c.Spec.Schedule) schedule, err := parser.Parse(c.Spec.Schedule)
if err != nil { if err != nil {
return fmt.Errorf("error parsing schedule of %s/%s (%s): %w", c.Namespace, c.Name, c.Spec.Schedule, err) return fmt.Errorf("error parsing schedule of %s/%s (%s): %w", c.Namespace, c.Name, c.Spec.Schedule, err)
+62 -1
View File
@@ -106,6 +106,7 @@ func Test_doCheck(t *testing.T) {
slackResponse string slackResponse string
wantErr bool wantErr bool
wantOut []string wantOut []string
wantNotOut []string
}{ }{
{ {
name: "error getting cronjobs", name: "error getting cronjobs",
@@ -181,6 +182,57 @@ func Test_doCheck(t *testing.T) {
}, },
wantErr: true, wantErr: true,
}, },
{
name: "invalid time zone",
args: args{
client: &brokenClient{
batchApi: &batchApi{
cronApi: &cronApi{
listFn: func(_ context.Context, _ v1.ListOptions) (*cronjobv1.CronJobList, error) {
return &cronjobv1.CronJobList{
Items: []cronjobv1.CronJob{
{
Spec: cronjobv1.CronJobSpec{Schedule: "* * * * *", TimeZone: strP("Nowhere/Special")},
},
},
}, nil
},
},
},
},
},
wantErr: true,
},
{
name: "schedule evaluated in cronjob time zone",
args: args{
client: &brokenClient{
batchApi: &batchApi{
cronApi: &cronApi{
listFn: func(_ context.Context, _ v1.ListOptions) (*cronjobv1.CronJobList, error) {
// Ran 6h ago at its daily local time; read as UTC the next run would be 30 minutes ago
last := time.Now().Add(-6 * time.Hour).Truncate(time.Minute)
local := last.In(time.FixedZone("IST", 5*3600+1800)) // Asia/Kolkata has no DST
return &cronjobv1.CronJobList{
Items: []cronjobv1.CronJob{
{
ObjectMeta: v1.ObjectMeta{Name: "some-name", Namespace: "some-ns"},
Spec: cronjobv1.CronJobSpec{Schedule: fmt.Sprintf("%d %d * * *", local.Minute(), local.Hour()), TimeZone: strP("Asia/Kolkata")},
Status: cronjobv1.CronJobStatus{LastScheduleTime: &v1.Time{Time: last}},
},
},
}, nil
},
},
},
},
},
timeout: 100 * time.Millisecond,
slackResponse: `{"ok": true}`,
wantErr: false,
wantOut: []string{"Checking some-ns/some-name since"},
wantNotOut: []string{"was not scheduled"},
},
{ {
name: "only correctly running cronjobs", name: "only correctly running cronjobs",
args: args{ args: args{
@@ -308,6 +360,11 @@ func Test_doCheck(t *testing.T) {
if err := doCheck(tt.args.client, fmt.Sprintf("http://%s", baseURL), ic, 10*time.Millisecond, buff); (err != nil) != tt.wantErr { if err := doCheck(tt.args.client, fmt.Sprintf("http://%s", baseURL), ic, 10*time.Millisecond, buff); (err != nil) != tt.wantErr {
t.Errorf("doCheck() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("doCheck() error = %v, wantErr %v", err, tt.wantErr)
} }
for _, o := range tt.wantNotOut {
if strings.Contains(buff.String(), o) {
t.Errorf("doCheck() got %s, did not want %s", buff.String(), o)
}
}
if len(tt.wantOut) > 0 { if len(tt.wantOut) > 0 {
for _, o := range tt.wantOut { for _, o := range tt.wantOut {
if !strings.Contains(buff.String(), o) { if !strings.Contains(buff.String(), o) {
@@ -404,7 +461,7 @@ func (b batchApi) CronJobs(namespace string) batchv1.CronJobInterface {
} }
func (b batchApi) Jobs(namespace string) batchv1.JobInterface { func (b batchApi) Jobs(namespace string) batchv1.JobInterface {
//TODO implement me // TODO implement me
panic("implement me") panic("implement me")
} }
@@ -463,3 +520,7 @@ var _ batchv1.CronJobInterface = &cronApi{}
func boolP(b bool) *bool { func boolP(b bool) *bool {
return &b return &b
} }
func strP(s string) *string {
return &s
}