-
Notifications
You must be signed in to change notification settings - Fork 897
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
purge archived only brings back archived records #14176
Conversation
@chessbyte You are correct. REPORT_ONLY is more or less "--dry-run" which I would like to keep for purging scripts as it allows a customer to run it and see what might change before deleting anything. In purge_metrics (which is the most fleshed out of the scripts), we call this parameter We should probably update all of the purge scripts at some point to a) have a common trollop based interface and b) use |
If you remove the clause then all archived VMs will go away which is not the intent. A user wants to know about recently archived VMs, but may want to clear out ones older than some time period (the ARCHIVE_CUTOFF) |
In hindsight, I change my mind. --dry-run as an option would imply that the default action is to delete everything, which I don't want. These scripts are highly destructive and so their default mode of operation should be non-destructive and just informative. The user should be forced to opt-in via a parameter. I'm open to better parameter names. |
@Fryguy Well, since the script is named ok, anyway. sorry for deleting the stuff I thought was not useful. I guess I brought upon the scope creep upon myself |
- use scope - can no longer count non-archived locally
@Fryguy ok, rolled back all the code. I just made the change to not bring back every vm and instead only bring back vms to purge. |
Checked commit kbrock@f2a05b1 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
NOTE: if this gets backported, ensure that |
Based upon feedback from http://talk.manageiq.org/t/vm-destroy-is-slow/2141/4
It was pointed out that we were bringing back every vm to determine if it was archived. This is slow.
Since that script was written,
archived
has become a virtual attribute and a scope. So we have faster means of accomplishing this request.removeREPORT_ONLY
which before turned the script into a no-op by default. Now it actually purges them by default.Not sure if the
updated_on
was put into the query for performance or business reasons. I left it in there. Suggestions for us to remove this clause? It seems arbitrary. UPDATE: no, it is intentional