mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudMigrations: handle more error codes from GMS backend (#95257)
* CloudMigrations: remove unnecessary if feature toggle gating * CloudMigrations: handle new error codes from backend
This commit is contained in:
@@ -149,6 +149,8 @@ type ItemErrorCode string
|
||||
|
||||
const (
|
||||
ErrDatasourceNameConflict ItemErrorCode = "DATASOURCE_NAME_CONFLICT"
|
||||
ErrDatasourceInvalidURL ItemErrorCode = "DATASOURCE_INVALID_URL"
|
||||
ErrFolderNameConflict ItemErrorCode = "FOLDER_NAME_CONFLICT"
|
||||
ErrDashboardAlreadyManaged ItemErrorCode = "DASHBOARD_ALREADY_MANAGED"
|
||||
ErrLibraryElementNameConflict ItemErrorCode = "LIBRARY_ELEMENT_NAME_CONFLICT"
|
||||
ErrUnsupportedDataType ItemErrorCode = "UNSUPPORTED_DATA_TYPE"
|
||||
|
||||
@@ -167,7 +167,7 @@ func (s *Service) getMigrationDataJSON(ctx context.Context, signedInUser *user.S
|
||||
})
|
||||
}
|
||||
|
||||
if s.features.IsEnabledGlobally(featuremgmt.FlagOnPremToCloudMigrationsAlerts) && len(notificationPolicies.Name) > 0 {
|
||||
if len(notificationPolicies.Name) > 0 {
|
||||
// Notification Policy can only be managed by updating its entire tree, so we send the whole thing as one item.
|
||||
migrationDataSlice = append(migrationDataSlice, cloudmigration.MigrateDataRequestItem{
|
||||
Type: cloudmigration.NotificationPolicyType,
|
||||
|
||||
@@ -106,6 +106,8 @@ type ResourceErrorCode string
|
||||
|
||||
const (
|
||||
ErrDatasourceNameConflict ResourceErrorCode = "DATASOURCE_NAME_CONFLICT"
|
||||
ErrDatasourceInvalidURL ResourceErrorCode = "DATASOURCE_INVALID_URL"
|
||||
ErrFolderNameConflict ResourceErrorCode = "FOLDER_NAME_CONFLICT"
|
||||
ErrDashboardAlreadyManaged ResourceErrorCode = "DASHBOARD_ALREADY_MANAGED"
|
||||
ErrLibraryElementNameConflict ResourceErrorCode = "LIBRARY_ELEMENT_NAME_CONFLICT"
|
||||
ErrUnsupportedDataType ResourceErrorCode = "UNSUPPORTED_DATA_TYPE"
|
||||
|
||||
Reference in New Issue
Block a user