cert-manager/pkg
Renato Costa 162777aab2 Fix incorrect uses of loop variable
This fixes two instances where loop variables were being incorrectly
used:

- using a loop variable in a closure passed to `ginkgo.It()` is
incorrect, as the capture happens by reference and only the last test
case will be executed (multiple times).
- a similar issue happens in the context of a goroutine; specifically,
we need to create a copy of the `runDurationFunc` before calling it in
a goroutine as done by the controller's `Run` function.

With regards to the second issue, I believe it never came to the
surface because, in production code, only one `runDurationFunc` is
passed; tests don't exercise the multiple funcs path either.

Issues were automatically found with the `loopvarcapture` linter.

Signed-off-by: Renato Costa <renato@cockroachlabs.com>
2022-08-26 15:08:30 -04:00
..
acme Remove bazel 🎉 2022-07-26 11:38:50 +01:00
api apply go fmt for go1.19 2022-08-04 09:51:57 +00:00
apis upgrade gateway api to v0.5.0 2022-08-08 08:52:59 +00:00
client Remove bazel 🎉 2022-07-26 11:38:50 +01:00
controller Fix incorrect uses of loop variable 2022-08-26 15:08:30 -04:00
ctl Remove bazel 🎉 2022-07-26 11:38:50 +01:00
issuer Merge pull request #5376 from inteon/upgrade_gateway_api 2022-08-25 16:08:10 +01:00
logs Remove bazel 🎉 2022-07-26 11:38:50 +01:00
metrics Remove bazel 🎉 2022-07-26 11:38:50 +01:00
scheduler Remove bazel 🎉 2022-07-26 11:38:50 +01:00
util apply go fmt for go1.19 2022-08-04 09:51:57 +00:00
webhook apply go fmt for go1.19 2022-08-04 09:51:57 +00:00