fix: handle remote cache driver misconfig (#1011)

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
Ramkumar Chinchani
2022-11-23 00:19:15 -08:00
committed by GitHub
parent 070941b1b3
commit 8746a49268
2 changed files with 39 additions and 3 deletions
+21
View File
@@ -168,6 +168,27 @@ func TestCreateCacheDatabaseDriver(t *testing.T) {
driver := api.CreateCacheDatabaseDriver(conf.Storage.StorageConfig, log)
So(driver, ShouldNotBeNil)
// negative test cases
conf.Storage.CacheDriver = map[string]interface{}{
"endpoint": "http://localhost:4566",
"region": "us-east-2",
"tableName": "BlobTable",
}
driver = api.CreateCacheDatabaseDriver(conf.Storage.StorageConfig, log)
So(driver, ShouldBeNil)
conf.Storage.CacheDriver = map[string]interface{}{
"name": "dummy",
"endpoint": "http://localhost:4566",
"region": "us-east-2",
"tableName": "BlobTable",
}
driver = api.CreateCacheDatabaseDriver(conf.Storage.StorageConfig, log)
So(driver, ShouldBeNil)
})
}