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

[Feature Request]: garbage collection / prune #557

Open
kshpytsya opened this issue Jan 13, 2025 · 5 comments
Open

[Feature Request]: garbage collection / prune #557

kshpytsya opened this issue Jan 13, 2025 · 5 comments

Comments

@kshpytsya
Copy link

Feature Request

A cursory examination of code and documentation shows that Grizzly is missing the "D" letter of CRUD. This Tanka's feature could possibly be the source of inspiration. Grafana's tags could be used as a marker for resources managed by Grizzly. And/or it should be possible to declare that Grizzly should manage everything in a specific folder.

I am aware of Grafana Terraform Provider and of Grafana Operator but out of three, it is Grizzly that is best suited for our deployment workflow.

@malcolmholmes
Copy link
Collaborator

We've considered prune, a la Tanka. But, there's no consistent place across resource types to store the marker. Yes, we could use tags on dashboards, but without somewhere to put them on folders, datasources, alert rules, etc, we're stuck. That's what blocked us from implementing this in the past.

@kshpytsya
Copy link
Author

Do all the resources manageable by Grizzly have UIDs that can be arbitrarily chosen by their creator? If so, how about using a UID prefix as a marker?

@malcolmholmes
Copy link
Collaborator

That's an interesting idea. Although it wouldn't work for existing resources. And for existing dashboards, it'd change the URL, which sucks.

@kshpytsya
Copy link
Author

A further extension to that idea:

A --manifest option allowing to provide a text file containing one UID per line with wildcard support (could be as simple as only allowing an asterisk at the end). With this Grizzly would refuse any resource definitions not covered by the manifest, and would treat all server resources matching the manifest as managed by Grizzly. Combined with --prune option to apply it would instruct Grizzly to delete any matching resources for which there are no local definitions.

A manifest (or update-manifest) command that would update the existing manifest file (or create a new one if none exists) with UIDs of locally defined resources. Maybe --sorted and --prune options to sort UIDs in manifest and remove lines that do not correspond to any locally defined resource. This command would probably be used in a one-off fashion when introducing the grizzly apply --prune into the workflow.

@kshpytsya
Copy link
Author

Related: #490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants