st2
st2 copied to clipboard
The st2ctl reload command is missing a purge option
I discovered that when a rule, trigger, action or workflow is removed from a git repository and is no longer on the disk of a stackstorm server, the command sudo st2ctl reload --register-setup-virtualenvs --register-all does not purge these items from StackStorm. I have to manually delete them with st2 commands.
It would be very nice if there was a purge flag or something.
Yeah, sounds like a good feature request. I remember we got several reports like that before and I believe we have to put everything together and reconsider, keeping in mind infrastructure as a code principles.
Similar Issues:
- BUG: Rules that are renamed/removed not removed on reload #924
- pack install does not unload pack pre-flight (2.1) #3143
- Upon st2ctl reload (or restart), disabled sensors and rules are reenabled. #3016
There are probably other related issues in search.
+1
+1 I didn't get it why my aliases would still be present when we reload it.
+1
+1
+1
+1
Maybe someone who knows the st2ctl and pack install could post a list of what would need to happen to solve this ticket? @armab @nmaludy ?
There is some explanation in: https://github.com/StackStorm/st2/issues/3143#issuecomment-270478910. I think that statement was made from the point that possible pack content could be added via APIs, that's not present on the file system.
I think the end goal to close a bunch of issues: make sure the registered content in DB is in sync with the file system state. Unload everything else. Otherwise it looks counter-intuitive.
@armab I kind of agree. What if there was a --purge option that ran st2 pack remove? Would that solve for this without a ton of new logic?