mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Merge pull request #118995 from pohly/test-integration-race-detection-flowcontrol-II
flowcontrol: copy object before passing it to client-go Create to avoid data race
This commit is contained in:
commit
86fec81606
@ -269,7 +269,7 @@ func EnsureConfiguration[ObjectType configurationObjectType](ctx context.Context
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we always re-create a missing configuration object
|
// we always re-create a missing configuration object
|
||||||
if _, err = ops.Create(ctx, bootstrap, metav1.CreateOptions{FieldManager: fieldManager}); err == nil {
|
if _, err = ops.Create(ctx, ops.DeepCopy(bootstrap), metav1.CreateOptions{FieldManager: fieldManager}); err == nil {
|
||||||
klog.V(2).InfoS(fmt.Sprintf("Successfully created %s", bootstrap.GetObjectKind().GroupVersionKind().Kind), "type", configurationType, "name", name)
|
klog.V(2).InfoS(fmt.Sprintf("Successfully created %s", bootstrap.GetObjectKind().GroupVersionKind().Kind), "type", configurationType, "name", name)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user