From 75650907cc2ffbf5b4e8ceefafca6a39adc50876 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Tue, 9 Jul 2019 19:32:25 +0200 Subject: [PATCH] Ensure -dynamodb.url is set when calling NewTableClient() in aws mode (#1492) Signed-off-by: Marco Pracucci --- storage/factory.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/factory.go b/storage/factory.go index 7502dc92c714b..5b65e37cfa00a 100644 --- a/storage/factory.go +++ b/storage/factory.go @@ -157,6 +157,9 @@ func NewTableClient(name string, cfg Config) (chunk.TableClient, error) { case "inmemory": return chunk.NewMockStorage(), nil case "aws", "aws-dynamo": + if cfg.AWSStorageConfig.DynamoDB.URL == nil { + return nil, fmt.Errorf("Must set -dynamodb.url in aws mode") + } path := strings.TrimPrefix(cfg.AWSStorageConfig.DynamoDB.URL.Path, "/") if len(path) > 0 { level.Warn(util.Logger).Log("msg", "ignoring DynamoDB URL path", "path", path)