Skip to content

Instantly share code, notes, and snippets.

@timebertt
Created January 5, 2022 17:05
Show Gist options
  • Save timebertt/4c50da55db48778cb936705ae6755de4 to your computer and use it in GitHub Desktop.
Save timebertt/4c50da55db48778cb936705ae6755de4 to your computer and use it in GitHub Desktop.
Patches with optimistic locking
// json merge patch + optimistic locking
patch := client.MergeFromWithOptions(shoot.DeepCopy(), client.MergeFromWithOptimisticLock{})
// ...
// strategic merge patch + optimistic locking
patch = client.StrategicMergeFrom(shoot.DeepCopy(), client.MergeFromWithOptimisticLock{})
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment