0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix(test): use correct aws region for dynamodb (#1093)

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu 2023-01-09 19:04:56 +02:00 committed by GitHub
parent 08a8b3d44c
commit f69b104838
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -72,8 +72,8 @@ jobs:
- if: matrix.os == 'linux' && matrix.arch == 'amd64' - if: matrix.os == 'linux' && matrix.arch == 'amd64'
name: Setup localstack service name: Setup localstack service
run: | run: |
pip install localstack # install LocalStack cli pip install localstack # Install LocalStack cli
docker pull localstack/localstack # Make sure to pull the latest version of the image docker pull localstack/localstack:1.3 # Make sure to pull the latest version of the image
localstack start -d # Start LocalStack in the background localstack start -d # Start LocalStack in the background
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container

View file

@ -45,6 +45,7 @@ var (
errorText = "new s3 error" errorText = "new s3 error"
errS3 = errors.New(errorText) errS3 = errors.New(errorText)
zotStorageTest = "zot-storage-test" zotStorageTest = "zot-storage-test"
s3Region = "us-east-2"
) )
func cleanupStorage(store driver.StorageDriver, name string) { func cleanupStorage(store driver.StorageDriver, name string) {
@ -94,7 +95,7 @@ func createObjectsStore(rootDir string, cacheDir string, dedupe bool) (
storageDriverParams := map[string]interface{}{ storageDriverParams := map[string]interface{}{
"rootDir": rootDir, "rootDir": rootDir,
"name": "s3", "name": "s3",
"region": "us-east-2", "region": s3Region,
"bucket": bucket, "bucket": bucket,
"regionendpoint": endpoint, "regionendpoint": endpoint,
"accesskey": "minioadmin", "accesskey": "minioadmin",
@ -145,7 +146,7 @@ func createObjectsStoreDynamo(rootDir string, cacheDir string, dedupe bool, tabl
storageDriverParams := map[string]interface{}{ storageDriverParams := map[string]interface{}{
"rootDir": rootDir, "rootDir": rootDir,
"name": "s3", "name": "s3",
"region": "us-east-2", "region": s3Region,
"bucket": bucket, "bucket": bucket,
"regionendpoint": endpoint, "regionendpoint": endpoint,
"accesskey": "minioadmin", "accesskey": "minioadmin",
@ -176,7 +177,7 @@ func createObjectsStoreDynamo(rootDir string, cacheDir string, dedupe bool, tabl
cacheDriver, _ = storage.Create("dynamodb", cache.DynamoDBDriverParameters{ cacheDriver, _ = storage.Create("dynamodb", cache.DynamoDBDriverParameters{
Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"), Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"),
Region: os.Getenv("us-east-2"), Region: s3Region,
TableName: tableName, TableName: tableName,
}, log) }, log)
@ -688,7 +689,7 @@ func TestNegativeCasesObjectsStorage(t *testing.T) {
StorageDriver: map[string]interface{}{ StorageDriver: map[string]interface{}{
"rootDir": "/a", "rootDir": "/a",
"name": "s3", "name": "s3",
"region": "us-east-2", "region": s3Region,
"bucket": bucket, "bucket": bucket,
"regionendpoint": endpoint, "regionendpoint": endpoint,
"accesskey": "minioadmin", "accesskey": "minioadmin",