-
Notifications
You must be signed in to change notification settings - Fork 34
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
(feature) Implement polling image source in intervals #185
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #185 +/- ##
==========================================
- Coverage 46.15% 39.70% -6.46%
==========================================
Files 6 8 +2
Lines 364 471 +107
==========================================
+ Hits 168 187 +19
- Misses 177 265 +88
Partials 19 19
☔ View full report in Codecov by Sentry. |
0e8a94e
to
a8bcf0c
Compare
7f76823
to
7216d84
Compare
45b3bd1
to
a351b8b
Compare
2fdb4e3
to
e37fcc0
Compare
818e971
to
155b53c
Compare
if catalog.Spec.Source.Image.PollInterval == nil { | ||
return false | ||
} | ||
// if it's not time to poll yet, and the CR wasn't changed don't unpack again |
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.
This works as-is, but for future reference, it's often much easier to reason about a series of simple if conditions vs. a combination of conditions. Specifically, I find this easier:
if catalog.Generation != catalog.Status.ObservedGeneration {
return true
}
if nextPoll.After(time.Now()) {
return true
}
return false
Implements https://docs.google.com/document/d/1iWSrWL9pYRJ5Ua3VYErkK1Q2lAusBUeDCh66Ew4lDbQ/edit?usp=sharing Closes operator-framework#180 Signed-off-by: Anik Bhattacharjee <[email protected]>
0b86f72
…work#185) Implements https://docs.google.com/document/d/1iWSrWL9pYRJ5Ua3VYErkK1Q2lAusBUeDCh66Ew4lDbQ/edit?usp=sharing Closes operator-framework#180 Signed-off-by: Anik Bhattacharjee <[email protected]>
Implements https://docs.google.com/document/d/1iWSrWL9pYRJ5Ua3VYErkK1Q2lAusBUeDCh66Ew4lDbQ/edit?usp=sharing
Closes #180