-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow multiple 'runs' for Periscope #196
Conversation
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
==========================================
+ Coverage 80.25% 80.50% +0.25%
==========================================
Files 14 14
Lines 785 785
==========================================
+ Hits 630 632 +2
+ Misses 95 94 -1
+ Partials 60 59 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
❤️🙏☕️ THankyou so much for adding me to the review, looks awesome and especially enabling the polling mechanism rather then empty run is awesome.
as we discussed we will updated one scenario where if user is able to duplicate the Run_ID
that could lead to side effect and we can get over it by documenting it.
Thanks heaps,
This addresses #157, in particular this clarification. Rather than replacing the DaemonSet with some other resource type (which we've discussed extensively, but not found anything suitable), we make the existing DaemonSet behave more like a DaemonSet. I.e., rather than running once and doing nothing, it continues listening for a configuration change that triggers it to run again.
The specific configuration change it is looking for is the
DIAGNOSTIC_RUN_ID
setting. This is now what determines the name of the container that logs are exported to, so each time this value is changed, Periscope will run again and export to a new container. This means we can now remove theselect {}
'hack' that was introduced to prevent the DaemonSet going into CrashLoopBackoff.It also fixes #165, which describes a couple of bugs that were side-effects of Periscope trying to determine its 'run ID' by itself rather than having it specified in configuration.
Some implementation notes:
FileContentWatcher
type which is responsible for detecting changes in these mounted volumes (currently it's only used to monitor theDIAGNOSTIC_RUN_ID
value). This has a naive polling implementation because there are no cross-platform mechanisms like inotify, and the most prominent golang library for cross-platform file watching was archived when I last checked (it has since been restored, but we can manage without the dependency). There is not much point in trying to respond immediately to file content changes, because there can be a two-minute gap between updating the ConfigMap and file content changing within the pod.OSIdentifier
type, rather than astring
.helpers.go
file was cleaned up (there were a few unused functions in there).GetContent
function was added tohelpers.go
, to avoid duplication of code that read strings from functions returning anio.ReadCloser
.io/ioutil
package, so all usages have been replaced by the equivalent functions inio
/os
.