Alerting: Bump grafana/alerting and refactor the ImageStore/Provider to provide image URL/bytes (#70182)
* implement alerting.images.Provider interface in our ImageStore * add URLExists() method to fakeConfigStore * make linter happy * update integration tests
This commit is contained in:
@@ -13,6 +13,8 @@ import (
|
||||
"github.com/grafana/grafana/pkg/infra/kvstore"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/store"
|
||||
|
||||
alertingImages "github.com/grafana/alerting/images"
|
||||
)
|
||||
|
||||
type fakeConfigStore struct {
|
||||
@@ -24,19 +26,23 @@ type fakeConfigStore struct {
|
||||
|
||||
// Saves the image or returns an error.
|
||||
func (f *fakeConfigStore) SaveImage(ctx context.Context, img *models.Image) error {
|
||||
return models.ErrImageNotFound
|
||||
return alertingImages.ErrImageNotFound
|
||||
}
|
||||
|
||||
func (f *fakeConfigStore) GetImage(ctx context.Context, token string) (*models.Image, error) {
|
||||
return nil, models.ErrImageNotFound
|
||||
return nil, alertingImages.ErrImageNotFound
|
||||
}
|
||||
|
||||
func (f *fakeConfigStore) GetImageByURL(ctx context.Context, url string) (*models.Image, error) {
|
||||
return nil, models.ErrImageNotFound
|
||||
return nil, alertingImages.ErrImageNotFound
|
||||
}
|
||||
|
||||
func (f *fakeConfigStore) URLExists(ctx context.Context, url string) (bool, error) {
|
||||
return false, alertingImages.ErrImageNotFound
|
||||
}
|
||||
|
||||
func (f *fakeConfigStore) GetImages(ctx context.Context, tokens []string) ([]models.Image, []string, error) {
|
||||
return nil, nil, models.ErrImageNotFound
|
||||
return nil, nil, alertingImages.ErrImageNotFound
|
||||
}
|
||||
|
||||
func NewFakeConfigStore(t *testing.T, configs map[int64]*models.AlertConfiguration) *fakeConfigStore {
|
||||
|
||||
Reference in New Issue
Block a user