CloudMigration: Interpret error code from migration resource item (#94407)

* start on loading the error code

* error code to message mapping

* use resource code type

* use defined error code

* partial updates from comments

* i18nKey gen

* fixed t

* fixed translations

* typing
This commit is contained in:
Dana Axinte
2024-10-17 14:09:09 +01:00
committed by GitHub
parent 1051561154
commit a50507e645
13 changed files with 190 additions and 13 deletions
@@ -573,6 +573,13 @@ func (s *Service) GetSnapshot(ctx context.Context, query cloudmigration.GetSnaps
s.log.Error("error applying plugin warnings, please open a bug report: %w", err)
}
// Log the errors for resources with errors at migration
for _, resource := range resources {
if resource.Status == cloudmigration.ItemStatusError && resource.Error != "" {
s.log.Error("Could not migrate resource", "resourceID", resource.RefID, "error", resource.Error)
}
}
// We need to update the snapshot in our db before reporting anything
if err := s.store.UpdateSnapshot(ctx, cloudmigration.UpdateSnapshotCmd{
UID: snapshot.UID,
@@ -832,6 +839,7 @@ func (s *Service) getResourcesWithPluginWarnings(ctx context.Context, results []
// if the plugin is not found, it means it was uninstalled, meaning it wasn't core
if !p.IsCorePlugin() || !found {
r.Status = cloudmigration.ItemStatusWarning
r.ErrorCode = cloudmigration.ErrOnlyCoreDataSources
r.Error = "Only core data sources are supported. Please ensure the plugin is installed on the cloud stack."
}