mirror of
https://github.com/grafana/grafana.git
synced 2025-09-17 03:03:33 +08:00
CloudMigrations: Skip default contact point from snapshot (#106600)
* CloudMigrations: Skip default contact point from snapshot * Update cloud-migration-assistant.md * Update cloud-migration-assistant.md --------- Co-authored-by: Jacob Valdez <jacob.valdez@grafana.com>
This commit is contained in:
@ -186,6 +186,10 @@ The migration assistant can migrate the majority of Grafana Alerting resources t
|
||||
- Notification policy tree
|
||||
- Notification templates
|
||||
|
||||
{{< admonition type="note">}}
|
||||
The `grafana-default-email` contact point that's provisioned with every new Grafana instance doesn't have a UID by default and won't be migrated unless you edit or update and save it. You do not need to change the contact point for a UID to be generated when saved.
|
||||
{{< /admonition >}}
|
||||
|
||||
This is sufficient to have your Alerting configuration up and running in Grafana Cloud with minimal effort.
|
||||
|
||||
Migration of Silences is not supported by the migration assistant and needs to be configured manually. Alert History is also not available for migration.
|
||||
|
@ -92,6 +92,12 @@ func (s *Service) getContactPoints(ctx context.Context, signedInUser *user.Signe
|
||||
contactPoints := make([]contactPoint, 0, len(embeddedContactPoints))
|
||||
|
||||
for _, embeddedContactPoint := range embeddedContactPoints {
|
||||
// This happens in the default contact point, and would otherwise fail to migrate because it has no UID.
|
||||
// If that contact point is edited in any way, an UID is generated.
|
||||
if embeddedContactPoint.UID == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
contactPoints = append(contactPoints, contactPoint{
|
||||
UID: embeddedContactPoint.UID,
|
||||
Name: embeddedContactPoint.Name,
|
||||
|
@ -102,14 +102,12 @@ func TestGetContactPoints(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
defaultEmailContactPointCount := 1
|
||||
|
||||
createdContactPoints := createContactPoints(t, ctx, s, user)
|
||||
|
||||
contactPoints, err := s.getContactPoints(ctx, user)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, contactPoints)
|
||||
require.Len(t, contactPoints, len(createdContactPoints)+defaultEmailContactPointCount)
|
||||
require.Len(t, contactPoints, len(createdContactPoints))
|
||||
})
|
||||
|
||||
t.Run("it returns an error when user lacks permission to read contact point secrets", func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user