Added job to remove uninstalled packs from Mongo database#396
Added job to remove uninstalled packs from Mongo database#396jk464 wants to merge 1 commit intoStackStorm:masterfrom
Conversation
Useful when changing the mounted pack image, that removes previously installed packs
cognifloyd
left a comment
There was a problem hiding this comment.
This would break my cluster. I use non-existent packs on purpose for ad-hoc rules and policies that a workflow I wrote creates when deploying an updated pack. So, they're very likely to exist when upgrading st2.
As a convention, I use dunder names (__some_pack__) for packs that are not expected to exist on disk. I use a policies to delay all of the actions in a pack during a pack upgrade. I'm planning to use ad-hoc rules for scheduling the run of some action at a later time.
I do agree that this is a problem. But, I suspect we need more primitives within st2 core to handle this in a cleaner way, and in a way that is not k8s-specific.
|
@cognifloyd if you can give me any pointers into the When I took a stab at this originally, I did look at doing it in core, but got lost trying to follow the code to locate the logic where pack loading happens at bootstrap - and therefore where I could add pack un loading |
Useful when changing the mounted pack image, that removes previously installed packs.
Normally the packs have been removed from disk, but are still registered in the Mongo database.
This runs a job as part of registering packs, to check for any packs no longer present on disk and removes them from the DB.