mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 21:37:31 -05:00
Cloudmigration: Sets the runID correctly when saving (#85661)
Sets the runID correctly instead of setting it to the same as the migration id.
This commit is contained in:
@@ -199,7 +199,7 @@ func (cma *CloudMigrationAPI) RunMigration(c *contextmodel.ReqContext) response.
|
||||
return response.Error(http.StatusInternalServerError, "migration data get error", err)
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", path, bytes.NewReader(body))
|
||||
req, err := http.NewRequest(http.MethodPost, path, bytes.NewReader(body))
|
||||
if err != nil {
|
||||
cma.log.Error("error creating http request for cloud migration run", "err", err.Error())
|
||||
return response.Error(http.StatusInternalServerError, "http request error", err)
|
||||
@@ -235,7 +235,7 @@ func (cma *CloudMigrationAPI) RunMigration(c *contextmodel.ReqContext) response.
|
||||
return response.Error(http.StatusInternalServerError, "unmarshalling migration run response", err)
|
||||
}
|
||||
|
||||
_, err = cma.cloudMigrationService.SaveMigrationRun(ctx, &cloudmigration.CloudMigrationRun{
|
||||
runID, err := cma.cloudMigrationService.SaveMigrationRun(ctx, &cloudmigration.CloudMigrationRun{
|
||||
CloudMigrationUID: stringID,
|
||||
Result: respData,
|
||||
})
|
||||
@@ -243,6 +243,8 @@ func (cma *CloudMigrationAPI) RunMigration(c *contextmodel.ReqContext) response.
|
||||
response.Error(http.StatusInternalServerError, "migration run save error", err)
|
||||
}
|
||||
|
||||
result.RunID = runID
|
||||
|
||||
return response.JSON(http.StatusOK, result)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user