Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add retry to kubernetes.UpdatePodAnnotation #442

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

mycrEEpy
Copy link
Contributor

Description

This PR adds a very simple retry logic around to the kubernetes.UpdatePodAnnotation function.

Motivation

When updating a pods annotation the pod may have already been updated by some other process (e.g. a service mesh) in the meantime resulting in an optimistic lock error.

Alternative

We could also use a patch operation instead of an update operation to prevent the optimistic lock error.

This will compensate for optimistic lock errors during the update of pod annotations
@mycrEEpy mycrEEpy changed the title feat: add retry to kubernetes.UpdatePodAnnotation fix: add retry to kubernetes.UpdatePodAnnotation Jul 13, 2023
@github-actions github-actions bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 13, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.29 ⚠️

Comparison is base (89665cc) 25.69% compared to head (264e833) 25.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
- Coverage   25.69%   25.41%   -0.29%     
==========================================
  Files           6        6              
  Lines         537      543       +6     
==========================================
  Hits          138      138              
- Misses        383      389       +6     
  Partials       16       16              
Impacted Files Coverage Δ
internal/kubernetes/kubernetes.go 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@ckotzbauer ckotzbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this addition :)

@ckotzbauer ckotzbauer merged commit 87f4de0 into ckotzbauer:main Jul 15, 2023
5 of 7 checks passed
@mycrEEpy mycrEEpy mentioned this pull request Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants