feat: Add cronjob for time-stamper in ConfigMap #1481
feat: Add cronjob for time-stamper in ConfigMap #1481
Conversation
merging personal branch to a new branch.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1481 +/- ##
==========================================
+ Coverage 95.21% 95.22% +0.01%
==========================================
Files 43 43
Lines 3132 3144 +12
==========================================
+ Hits 2982 2994 +12
Misses 150 150 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Great work so far. The script iterates over all PVCs and annotates any PVC that is mounted as well as any PVC that has no annotation. I'm leaning towards leaving PVCs without annotations alone (last use stamp would technically be incorrect / someone is going to inevitably complain about their old PVCs being messed up by the new system, especially if on by default.) Instead could we just iterate over and mark all mounted PVCs? |
removing the logic for if the pvc wasn't mounted. now only annotates mounted pvcs.
|
Deferred label add as waiting for other parts of this feature to be developed. |
Context
DAQ core plans to implement auto deletion of unused PVC, for this we need a way of telling how long something hasn't been mounted.
Description
By making use of a Cronjob this runs a command every 5 minutes to run a bash script (time-stamper.sh). the bash script loops over the PVC and annotates them, it does this by gathering all PVC's in the blueapi,then all the mounted ones, loops through these annotating the ones that either are mounted or don't have a "last-used" annotation. This is linked via the config map.