Skip to content

Commit

Permalink
Simplify if condition in cronjob tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugoy committed Feb 2, 2024
1 parent bb588c3 commit f8c472b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ var _ = Describe("CronJob controller", func() {
// We'll need to retry getting this newly created CronJob, given that creation may not immediately happen.
Eventually(func() bool {
err := k8sClient.Get(ctx, cronjobLookupKey, createdCronjob)
if err != nil {
return false
}
return true
return err == nil
}, timeout, interval).Should(BeTrue())
// Let's make sure our Schedule string value was properly converted/handled.
Expect(createdCronjob.Spec.Schedule).Should(Equal("1 * * * *"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ var _ = Describe("CronJob controller", func() {
// We'll need to retry getting this newly created CronJob, given that creation may not immediately happen.
Eventually(func() bool {
err := k8sClient.Get(ctx, cronjobLookupKey, createdCronjob)
if err != nil {
return false
}
return true
return err == nil
}, timeout, interval).Should(BeTrue())
// Let's make sure our Schedule string value was properly converted/handled.
Expect(createdCronjob.Spec.Schedule).Should(Equal("1 * * * *"))
Expand Down

0 comments on commit f8c472b

Please sign in to comment.