Skip to content
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

Added job to remove uninstalled packs from Mongo database #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jk464
Copy link
Contributor

@jk464 jk464 commented Feb 13, 2024

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.

Useful when changing the mounted pack image, that removes previously installed packs
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Feb 13, 2024
Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jk464
Copy link
Contributor Author

jk464 commented May 8, 2024

@cognifloyd if you can give me any pointers into the st2 core where we could add those new "primitives" I'd be happy to take a stab at re-implementing this functionality there (and I'd also add some logic to ignore dunder-name packs).

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

@jk464 jk464 requested a review from cognifloyd May 8, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature size/M PR that changes 30-99 lines. Good size to review. status:under discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants