Provisioning datasources incorrect version number in database

When using automagic provisioning of datasources to control upgrades, I get a wrong version number declared in the database configuration.
What I have done:
1- Modify _internal influxdb data source, via UI, to change the database field to something like _internalfoo. Database then gets the datasource defined with version: 2
2- deploy a new puppetprovisioned.yaml file (via puppet-grafana module, but works by hand anyway) with a new database declared as _internalbar and version: 3 to ensure the value gets updated over what was changed on step 1. Database then gets updated with the new database value, but version is then restored to 1.

What I would expect to see:

  • The version field in the database keeps 3 as declared in the puppetprovisioned.yaml file.

It feels counter intuitive that this works in such way, since deploying a puppetprovisioned.yaml file with another database value but with version: 1 would result in the data source not being modified, as expected, and by increasing the version number we then get the expected values into the database, with all the defined changes from the yaml file, except the version number.

Is this per design? If so, what is the reason?

Since the database backend doesn’t show any difference in the id field it seems like the data source is updated, and not recreated, so more of a reason to expect the version number increase rather than reset to 1.

Thanks in advance for any insights

Since there was no response here I opened a github issue here: