mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-09 05:06:38 +10:00
data race: fix concurrent read and write of secret annotations
This bug can be reproduced using "go run -race" and by creating many Certificates and renewing them continuously. With 5000 Certificate objects, a data race is found in less than a minute. Signed-off-by: Maël Valais <mael@vls.dev>
This commit is contained in:
@@ -102,6 +102,7 @@ func (s *SecretsManager) UpdateData(ctx context.Context, crt *cmapi.Certificate,
|
||||
secret.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(crt, certificateGvk)}
|
||||
}
|
||||
|
||||
secret = secret.DeepCopy()
|
||||
err = s.setValues(crt, secret, data)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user