Merge pull request #5407 from renatolabs/loopvar-capture-fixes
Fix incorrect uses of loop variable
This commit is contained in:
commit
35b2d01d8c
@ -119,6 +119,7 @@ func (c *controller) Run(workers int, stopCh <-chan struct{}) error {
|
||||
}
|
||||
|
||||
for _, f := range c.runDurationFuncs {
|
||||
f := f // capture range variable
|
||||
go wait.Until(func() { f.fn(ctx) }, f.duration, stopCh)
|
||||
}
|
||||
|
||||
|
||||
@ -163,6 +163,7 @@ var _ = framework.CertManagerDescribe("SelfSigned CertificateRequest", func() {
|
||||
},
|
||||
}
|
||||
for _, v := range cases {
|
||||
v := v // capture range variable
|
||||
It("should generate a signed certificate valid for "+v.label, func() {
|
||||
crClient := f.CertManagerClientSet.CertmanagerV1().CertificateRequests(f.Namespace.Name)
|
||||
|
||||
@ -172,6 +173,7 @@ var _ = framework.CertManagerDescribe("SelfSigned CertificateRequest", func() {
|
||||
|
||||
_, err = crClient.Create(context.TODO(), gen.CertificateRequestFrom(basicCR,
|
||||
gen.SetCertificateRequestCSR(csr),
|
||||
gen.SetCertificateRequestDuration(v.inputDuration),
|
||||
), metav1.CreateOptions{})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user