mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Provisioning: Allows specifying uid for datasource and use that in derived fields (#23585)
* Add uid to datasource * Fix uid passing when provisioning * Better error handling and Uid column type change * Fix test and strict null error counts * Add backend tests * Add tests * Fix strict null checks * Update test * Improve tests * Update pkg/services/sqlstore/datasource.go Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com> * Variable rename Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -50,13 +50,13 @@ func (dc *DatasourceProvisioner) apply(cfg *configs) error {
|
||||
}
|
||||
|
||||
if err == models.ErrDataSourceNotFound {
|
||||
dc.log.Info("inserting datasource from configuration ", "name", ds.Name)
|
||||
dc.log.Info("inserting datasource from configuration ", "name", ds.Name, "uid", ds.UID)
|
||||
insertCmd := createInsertCommand(ds)
|
||||
if err := bus.Dispatch(insertCmd); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
dc.log.Debug("updating datasource from configuration", "name", ds.Name)
|
||||
dc.log.Debug("updating datasource from configuration", "name", ds.Name, "uid", ds.UID)
|
||||
updateCmd := createUpdateCommand(ds, cmd.Result.Id)
|
||||
if err := bus.Dispatch(updateCmd); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user