Commit Graph

24 Commits

Author SHA1 Message Date
Tim Ramlot
085136068a
fix misspell linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-04-29 15:21:07 +02:00
Ashley Davis
fb231ab641
Remove bazel 🎉
This removes all .bazel and .bzl files, and a bunch of scripts relating
to bazel, now that it's been entirely replaced.

There are still a few places where traces could be removed, but this
removes the brunt of the bazel stuff that remains.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-26 11:38:50 +01:00
Ashley Davis
89bb5481cb
Increase margin of error in an otherwise unsound test
This test can easily fail on a heavily loaded machine, such as one
running many tests in parallel.

1. The afterFunc could be delayed _massively_ on a heavily loaded
   machine, such as one running a lot of tests in parallel.
2. Requiring an accuracy of 1ms seems like a flake waiting to happen
   (as it was in this case)
3. When we write code which uses this scheduler, we can't even
   safely assume the afterFunc will _ever_ be run, let alone run
   within a 1% margin of time error. As such I don't think this
   test is providing any value beyond a general sanity check.

By increasing the allowable delta massively, we keep this test as a
sanity check but basically remove the chance of a flake. The test
essentially becomes "does afterFunc work, generally?".

Also adds a check that the elapsed time is greater than the expected
time.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-11 10:14:34 +00:00
Ashley Davis
3a055cc2f5
rename all uses of github.com/jetstack/cert-manager
This was done by running the following command twice:

 ```bash
 grep -Ri "github.com/jetstack/cert-manager" . | \
 cut -d":" -f1 | \
 sort | \
 uniq | \
 xargs sed -i
 "s/github.com\/jetstack\/cert-manager/github.com\/cert-manager\/cert-manager/"
 ```

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-02 09:08:31 +00:00
Maël Valais
e4f981da66 Revert "memory leak: clean up scheduler goroutine on cert deletion"
This reverts commit 641960b6. The reason we decided to revert this is
that we are unsure about the implications of adding the
scheduledWorkQueue.Forget call. The new Forget call is left untested,
and it makes us nervous not to know exactly if it works as intended.

The "Forget" memory leak that we are reverting now is the cause of a
tiny fraction of the overall memory leakage that was fixed in the PR
in the scheduler itself.  Reverting this means that some goroutines will
be leaked, but only when a Certificate gets removed and never recreated
with the same name.

Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-28 19:19:39 +02:00
Maël Valais
641960b666 memory leak: clean up scheduler goroutine on certificate deletion
Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-23 16:57:10 +02:00
Maël Valais
8e872632f4 memory leak: the afterFunc goroutine now stops properly
Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-21 10:25:56 +02:00
Maël Valais
eb947f98ea memory leak: add unit test to show scheduler leaking goroutines
Signed-off-by: Maël Valais <mael@vls.dev>
2021-07-21 10:25:49 +02:00
irbekrm
8d5023a72d Add a fake scheduler
To allow for testing whether an item gets re-queued in unit tests

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:05:59 +01:00
Maartje Eyskens
ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +01:00
Maartje Eyskens
1788a9d758 Update copyright to cert-manager project
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 19:04:49 +01:00
James Munnelly
1adfe16690 Bulk fix of non-test staticcheck failures
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-06-26 12:25:08 +01:00
James Munnelly
1d6424b8f2 Use 'clock' package in pkg/scheduler
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-06-23 16:23:42 +01:00
Josh Soref
eebe11ae1b spelling: coerce
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-02-24 16:16:35 -05:00
Josh Soref
05b3c8a21f spelling: because
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-02-24 16:15:23 -05:00
James Munnelly
0fcc0c666c Update copyright header year
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 15:07:55 +00:00
James Munnelly
db65d6a170 run //hack:update-bazel
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-09-13 11:24:48 +01:00
James Munnelly
51195e4c5f Update license header and add header to every file
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
2018-08-13 15:53:37 +01:00
Euan Kemp
b7d4470f81 pkg/scheduler: fix minor race
While unlikely, it was possible before for the scheduler to race in such
a way that concurrent 'Add' calls would result in "leaking" a timer,
thus making an unstoppable invocation of that event.

This includes a test which fails without the small bugfix in
scheduler.go
2018-06-25 12:01:51 -07:00
Euan Kemp
bb1fe81834 pkg/scheduler: use mock timer for tests
This speeds up the unit tests from taking about 12s to taking around
.01s
2018-06-19 17:48:16 -07:00
James Munnelly
cee4610dd6 Enable go race detector and fix race 2017-12-01 22:54:12 +00:00
James Munnelly
92385ba15b Add comments to scheduler package 2017-08-07 13:59:05 +01:00
James Munnelly
5926a53706 Refactor controller loop to only perform authorizations when issuing/renewing 2017-08-06 23:49:54 +01:00
James Munnelly
dd02061738 Set up scheduled work queue for certificate renewals 2017-08-05 22:51:52 +01:00