iximiuz / client-go-examples

Collection of mini-programs demonstrating Kubernetes client-go usage.
https://labs.iximiuz.com/playgrounds/k8s-client-go/
Apache License 2.0
1.02k stars 131 forks source link

Example for `retry.RetryOnConflict` #5

Closed dylanhitt closed 2 years ago

dylanhitt commented 2 years ago

The repository should include an example of retry.RetryOnConflict.

Current implementation idea:

Folder Name: retry-on-conflict General Flow:

iximiuz commented 2 years ago

Hi Dylan! The retry.RetryOnConflict is one of the must-have examples, so please go for it!

For the actual code, we could probably simplify it a bit. How about:

Additionally, you could put your explanation for the real-world Pod & controllers use case on the top of this code. This would allow us to keep the mini-program simple (and not run any workloads in the cluster), and wire the example with the real-world situation. WDYT?

dylanhitt commented 2 years ago

I understand.

So the actual code execution will fail out completely once the retry limit is reached.

And yeah that sounds good, I think as long as a we have a snippet of it should really look like will suffice.

iximiuz commented 2 years ago

Implemented in #6