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

support deleteDatasources #122

Open
pschulten opened this issue Nov 5, 2021 · 3 comments
Open

support deleteDatasources #122

pschulten opened this issue Nov 5, 2021 · 3 comments

Comments

@pschulten
Copy link

Currently there is no way to delete auto-provisioned datasources before update/create (as described here: https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources)

Does it make sense to support that?

@brancz
Copy link
Owner

brancz commented Dec 7, 2021

This repository is all about maintaining Grafana instances in an immutable way where everything is configured via files, so I don't see how deleting data sources can be combined with that philosophy. Can you explain why you would need this? Can't you just delete the data source from the files and it won't be provisioned anymore?

@pschulten
Copy link
Author

Thanks for getting back!

I read the official the grafana provisioning docs (linked above) and they describe the datasources.yaml file by first deleting the standard datasource(s) before defining them.

Maybe that's not needed anymore...
But this library "implements" the creation part but not the deletion part in

'datasources.yaml': std.manifestJsonEx(

It should either expose the datasources.yaml file completely or also provide users a way to define the deleteDatasources object.

I don't want to start a hairsplitting contest here, so please close this issue, if you disagree

@brancz
Copy link
Owner

brancz commented Dec 16, 2021

Aha I see! The whole file is actually templated using _config.datasources configuration:

datasources: g._config.datasources,

This means that you can arbitrarily configure that configuration option and it will be reflected when starting Grafana with that configuration, since it's all 100% declarative.

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

2 participants