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

bugfix for annotation updater. #490

Merged
merged 3 commits into from
Jul 19, 2018
Merged

Conversation

timothysc
Copy link
Contributor

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:

Will try to always update annotations on every exit condition. 

/assign @liztio

return
}
wait.JitterUntil(func() {
pluginsdone := aggr.isComplete()
Copy link
Contributor Author

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.

Copy link
Contributor

@liztio liztio left a 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())
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be .Background()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this case, nope.

logrus.Info("All plugins have completed, status has been updated")
cancel()
}
}, annotationUpdateFreq, 1.2, true, ctx.Done())
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure.

cancel()
// 2. Try one last time to get an update out on exit
updater.ReceiveAll(aggr.Results)
if err := updater.Annotate(); err != nil {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

}
}()
if pluginsdone {
Copy link
Contributor

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?

Copy link
Contributor Author

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>
@timothysc timothysc merged commit 0470e24 into vmware-tanzu:master Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sonobuoy status doesn't report the tests are completed when the logs do.
2 participants