kubernetes/pkg/apis
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
..
abac Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
admission generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
admissionregistration Merge pull request #107175 from roycaihw/doc/webhook-rule-validation 2022-02-09 15:35:44 -08:00
apiserverinternal refactor: Change the users of IsQualifiedName to ValidateQualifiedName 2022-02-16 14:02:11 +08:00
apps Merge pull request #111402 from verb/111030-ec-ga 2022-07-29 19:29:20 -07:00
authentication Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
authorization Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
autoscaling Generate and format files 2022-07-26 13:14:05 -04:00
batch Support handling of pod failures with respect to the specified rules 2022-08-04 18:39:08 +02:00
certificates Merge pull request #111061 from pacoxu/key-encipherment-optional 2022-08-02 18:55:51 -07:00
coordination Update pkg/apis/coordination/validation/validation.go 2022-02-03 18:25:43 +01:00
core Fix capture loop vars in parallel or ginkgo tests 2022-08-15 16:28:50 +02:00
discovery Remove obsolete refs to gate EndpointSliceNodeName 2022-07-07 13:19:59 -07:00
events generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
extensions Implementation on Network Policy Status (#107963) 2022-03-29 01:52:48 -07:00
flowcontrol Generate and format files 2022-07-26 13:14:05 -04:00
imagepolicy Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
networking Auto generate code for ClusterCIDR API 2022-08-05 01:06:35 +00:00
node remove unneeded references 2022-03-23 15:26:38 +00:00
policy Move CSIInlineVolume feature to GA 2022-08-04 13:06:30 -06:00
rbac RBAC: Modify the Description for the apiGroup. 2022-06-14 13:31:09 +05:30
scheduling fix ambiguous comments of priorityClass update validation 2022-07-27 15:30:47 +08:00
storage Move CSIInlineVolume feature to GA 2022-08-04 13:06:30 -06:00
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00