Skip to content

Commit 92121ea

Browse files
committed
feat(alerting): add nop uploader
ref grafana#6183
1 parent d726f49 commit 92121ea

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

conf/defaults.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ url = https://grafana.net
421421
#################################### External Image Storage ##############
422422
[external_image_storage]
423423
# You can choose between (s3, webdav)
424-
provider = s3
424+
provider =
425425

426426
[external_image_storage.s3]
427427
bucket_url =

conf/sample.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
#################################### External image storage ##########################
376376
[external_image_storage]
377377
# Used for uploading images to public servers so they can be included in slack/email messages.
378-
# you can choose between (s3, webdav or internal)
379-
;provider = s3
378+
# you can choose between (s3, webdav)
379+
;provider =
380380

381381
[external_image_storage.s3]
382382
;bucket_url =

pkg/components/imguploader/imguploader.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ type ImageUploader interface {
1010
Upload(path string) (string, error)
1111
}
1212

13+
type NopImageUploader struct {
14+
}
15+
16+
func (NopImageUploader) Upload(path string) (string, error) {
17+
return "", nil
18+
}
19+
1320
func NewImageUploader() (ImageUploader, error) {
1421

1522
switch setting.ImageUploadProvider {
@@ -53,5 +60,5 @@ func NewImageUploader() (ImageUploader, error) {
5360
return NewWebdavImageUploader(url, username, password)
5461
}
5562

56-
return nil, fmt.Errorf("could not find specified provider")
63+
return NopImageUploader{}, nil
5764
}

0 commit comments

Comments
 (0)