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:
Leonard Gram
2024-04-05 18:03:45 +02:00
committed by GitHub
parent 58f32150c2
commit 1332d8ba24
4 changed files with 10 additions and 8 deletions
@@ -442,16 +442,16 @@ func (s *Service) getDashboards(ctx context.Context, id int64) ([]dashboards.Das
return result, nil
}
func (s *Service) SaveMigrationRun(ctx context.Context, cmr *cloudmigration.CloudMigrationRun) (string, error) {
func (s *Service) SaveMigrationRun(ctx context.Context, cmr *cloudmigration.CloudMigrationRun) (int64, error) {
cmr.Created = time.Now()
cmr.Updated = time.Now()
cmr.Finished = time.Now()
err := s.store.SaveMigrationRun(ctx, cmr)
if err != nil {
s.log.Error("Failed to save migration run", "err", err)
return "", err
return -1, err
}
return cmr.CloudMigrationUID, nil
return cmr.ID, nil
}
func (s *Service) GetMigrationStatus(ctx context.Context, id string, runID string) (*cloudmigration.CloudMigrationRun, error) {
@@ -50,8 +50,8 @@ func (s *NoopServiceImpl) DeleteMigration(ctx context.Context, id int64) (*cloud
return nil, cloudmigration.ErrFeatureDisabledError
}
func (s *NoopServiceImpl) SaveMigrationRun(ctx context.Context, cmr *cloudmigration.CloudMigrationRun) (string, error) {
return "", cloudmigration.ErrInternalNotImplementedError
func (s *NoopServiceImpl) SaveMigrationRun(ctx context.Context, cmr *cloudmigration.CloudMigrationRun) (int64, error) {
return -1, cloudmigration.ErrInternalNotImplementedError
}
func (s *NoopServiceImpl) GetMigrationDataJSON(ctx context.Context, id int64) ([]byte, error) {