cert-manager/pkg/controller
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
..
acmechallenges Remove bazel 🎉 2022-07-26 11:38:50 +01:00
acmeorders Remove bazel 🎉 2022-07-26 11:38:50 +01:00
cainjector upgrade gateway api to v0.5.0 2022-08-08 08:52:59 +00:00
certificate-shim upgrade gateway api to v0.5.0 2022-08-08 08:52:59 +00:00
certificaterequests Adds extra informer for the CertificateRequest SelfSigned controller, 2022-08-09 08:39:50 +01:00
certificates Merge pull request #5366 from munnerz/privatekey-regen-test 2022-08-05 16:23:30 +01:00
certificatesigningrequests Updates selfsigned CertificateSigningRequest controller with new Secret 2022-08-09 11:16:10 +01:00
clusterissuers Remove bazel 🎉 2022-07-26 11:38:50 +01:00
globals Remove bazel 🎉 2022-07-26 11:38:50 +01:00
issuers Remove bazel 🎉 2022-07-26 11:38:50 +01:00
test upgrade gateway api to v0.5.0 2022-08-08 08:52:59 +00:00
builder.go rename all uses of github.com/jetstack/cert-manager 2022-02-02 09:08:31 +00:00
context_test.go Change controller context rate limiter test to ensure they are the same 2022-02-22 09:15:10 +00:00
context.go upgrade gateway api to v0.5.0 2022-08-08 08:52:59 +00:00
controller.go Fix incorrect uses of loop variable 2022-08-26 15:08:30 -04:00
helper.go rename all uses of github.com/jetstack/cert-manager 2022-02-02 09:08:31 +00:00
register.go Adds ContextFactory to controller package. Changes controller builder to 2022-01-27 12:50:12 +00:00
util_test.go Allows for annotations passed from CSR to Order to be filtered 2021-07-27 10:55:09 +01:00
util.go rename all uses of github.com/jetstack/cert-manager 2022-02-02 09:08:31 +00:00