-
Notifications
You must be signed in to change notification settings - Fork 118
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
changes to update resources based on predetermined interval #571
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take another look at the implementation in some time.
deb8688
to
e47b545
Compare
ec3a576
to
c2e70d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of comments!
Main intention being to decouple renewed resource from versioned resources.
Still need to think about what we call things finally.
Kudos for the exhaustive tests, it handles every case I could think of! We should verify it does not add a flake because 2s might be less for slower hosts
c2e70d7
to
9a3e42e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How the feature is structured looks great to me!
@kumaritanushree mentioned that today if the user chooses to recreate on update, the last-renewed annotation is not retained. Maybe we should verify if the rebase rule is working.
I do not see a lot of harm in the timer being reset in this case (right away at least). But worth verifying. I am pointing towards the rebase rule as it looks like the feature works otherwise in other case as we check existing resources directly.
Lets also check the tests for flakiness since there's sleeping involved.
TL;DR Next steps:
- Verify rebase rule
- Ensure tests are not flaky (a few re runs on the GitHub action worker maybe?)
5a96c0e
to
e0a6ef1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the small nits, it looks good to me.
…ff from clusterapply, added test case for the same
…ays-replace for non-versioned resources
4b0f079
to
d656739
Compare
…o improve functionality
d656739
to
ed4b40f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I would prefer not having the unstopped functions, but dedicating a new structure to each one of them feels a bit extra
@@ -295,3 +275,40 @@ func existingVersionedResources(rs []ctlres.Resource) versionedResources { | |||
} | |||
return result | |||
} | |||
|
|||
func newGroupedVersionedResources(rs []ctlres.Resource) map[string][]ctlres.Resource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would prefer it if this function and the next one are either scoped to a struct, maybe we can move stuff that are used by other parts of the code to a single place at a later point. Not a blocker but a nice to have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What this PR does / why we need it:
Kapp will update resources based on predetermined interval set. To set the interval user needs to add annotation kapp.k14s.io/renew-duration to the resource
Which issue(s) this PR fixes:
Fixes #224
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
Review Checklist:
a link to that PR
change
Additional documentation e.g., Proposal, usage docs, etc.:
Proposal