-
Notifications
You must be signed in to change notification settings - Fork 345
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
bugfix for annotation updater. #490
Conversation
pkg/plugin/aggregation/run.go
Outdated
return | ||
} | ||
wait.JitterUntil(func() { | ||
pluginsdone := aggr.isComplete() |
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 could probably make this a var outside and used on final check in defer.
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.
Some questions, nothing blocking. Thanks Tim!
@@ -113,21 +116,31 @@ func Run(client kubernetes.Interface, plugins []plugin.Interface, cfg plugin.Agg | |||
}() | |||
|
|||
updater := newUpdater(expectedResults, namespace, client) | |||
ticker := time.NewTicker(annotationUpdateFreq) | |||
ctx, cancel := context.WithCancel(context.TODO()) |
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.
should this be .Background()
?
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.
For this case, nope.
pkg/plugin/aggregation/run.go
Outdated
logrus.Info("All plugins have completed, status has been updated") | ||
cancel() | ||
} | ||
}, annotationUpdateFreq, 1.2, true, ctx.Done()) |
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.
can you const these magic numbers?
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.
sure.
pkg/plugin/aggregation/run.go
Outdated
cancel() | ||
// 2. Try one last time to get an update out on exit | ||
updater.ReceiveAll(aggr.Results) | ||
if err := updater.Annotate(); err != nil { |
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.
could ReceiveAll() and Annotate() be combined? looks like they're duplicated.
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.
probably, I'll check the call sites and update if I can reduce.
pkg/plugin/aggregation/run.go
Outdated
} | ||
}() | ||
if pluginsdone { |
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.
any particular reason we emit this on the JitterUntil case but not on the termination guard case?
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 have two separate log statements to try and bisect in case we somehow see an issue in the wild.
Signed-off-by: Timothy St. Clair <timothysc@gmail.com>
Signed-off-by: Timothy St. Clair <timothysc@gmail.com>
Signed-off-by: Timothy St. Clair <timothysc@gmail.com>
What this PR does / why we need it:
Fixes annotation updater issue(s).
Which issue(s) this PR fixes
Special notes for your reviewer:
I still need to run some tests on this to verify.
Release note:
/assign @liztio