kubernetes/pkg/controller
Omer Tuchfeld eb317ecd40 Fix capture loop vars in parallel or ginkgo tests
Fixes instances of #98213 (to ultimately complete #98213 linting is
required).

This commit fixes a few instances of a common mistake done when writing
parallel subtests or Ginkgo tests (basically any test in which the test
closure is dynamically created in a loop and the loop doesn't wait for
the test closure to complete).

I'm developing a very specific linter that detects this king of mistake
and these are the only violations of it it found in this repo (it's not
airtight so there may be more).

In the case of Ginkgo tests, without this fix, only the last entry in
the loop iteratee is actually tested. In the case of Parallel tests I
think it's the same problem but maybe a bit different, iiuc it depends
on the execution speed.

Waiting for the CI to confirm the tests are still passing, even after
this fix - since it's likely it's the first time those test cases are
executed - they may be buggy or testing code that is buggy.

Another instance of this is in `test/e2e/storage/csi_mock_volume.go` and
is still failing so it has been left out of this commit and will be
addressed in a separate one
2022-08-15 16:28:50 +02:00
..
apis/config refactor: remove deprecated flags 2022-04-22 20:28:12 +08:00
bootstrap Merge pull request #105510 from damemi/wire-contexts-bootstrap 2021-11-02 14:27:42 -07:00
certificates Merge pull request #111061 from pacoxu/key-encipherment-optional 2022-08-02 18:55:51 -07:00
clusterroleaggregation Wire contexts to RBAC controllers 2021-10-07 15:04:49 -04:00
cronjob Generate and format files 2022-07-26 13:14:05 -04:00
daemon Generate and format files 2022-07-26 13:14:05 -04:00
deployment Generate and format files 2022-07-26 13:14:05 -04:00
disruption Add worker to clean up stale DisruptionTarget condition 2022-08-02 11:25:01 -04:00
endpoint Optimising print information 2022-07-14 15:03:03 +08:00
endpointslice Generate and format files 2022-07-26 13:14:05 -04:00
endpointslicemirroring cleanup: remove duplicate import 2022-07-14 11:25:19 +08:00
garbagecollector Merge pull request #110888 from likakuli/feature_ignoreeventforgc 2022-08-01 12:10:28 -07:00
history Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
job Fix deleting UIDs tracking expectations 2022-08-05 12:37:31 -04:00
namespace Generate and format files 2022-07-26 13:14:05 -04:00
nodeipam Introduce MultiCIDRRangeAllocator 2022-08-06 00:10:39 +00:00
nodelifecycle Introduction of a pod condition type indicating disruption. Its reason field indicates the reason: 2022-08-02 11:12:16 +02:00
podautoscaler Generate and format files 2022-07-26 13:14:05 -04:00
podgc Introduction of a pod condition type indicating disruption. Its reason field indicates the reason: 2022-08-02 11:12:16 +02:00
replicaset Fix event broadcaster shutdown in multiple controllers 2022-05-17 22:14:19 +02:00
replication Fix event broadcaster shutdown in multiple controllers 2022-05-17 22:14:19 +02:00
resourcequota quota: add an update filter 2022-07-08 18:39:55 -04:00
serviceaccount no auto-generation of secret-based service account token 2022-02-23 14:17:30 -08:00
statefulset Generate and format files 2022-07-26 13:14:05 -04:00
storageversiongc Wire contexts to Core controllers 2021-11-01 10:29:00 -04:00
testutil Migrate to k8s.io/utils/clock in pkg/controller 2021-09-10 11:42:32 +02:00
ttl Reduce number of buckets in ttl controller for 2k+ nodes clusters 2022-05-05 12:26:36 +00:00
ttlafterfinished OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
util Generate and format files 2022-07-26 13:14:05 -04:00
volume Fix capture loop vars in parallel or ginkgo tests 2022-08-15 16:28:50 +02:00
controller_ref_manager_test.go Merge pull request #101250 from evertrain/master 2021-11-10 09:19:26 -08:00
controller_ref_manager.go Generate and format files 2022-07-26 13:14:05 -04:00
controller_utils_test.go Wire contexts to Batch controllers (#105491) 2021-11-10 14:56:46 -08:00
controller_utils.go Generate and format files 2022-07-26 13:14:05 -04:00
doc.go
lookup_cache.go
OWNERS add myself as approver to pkg/controller 2022-01-12 19:33:02 -05:00