mirror of
https://github.com/project-zot/zot.git
synced 2025-02-17 23:45:36 -05:00
fix(dynamodb): properly handle ResourceInUseException for existing tables (#2909)
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
parent
ececc9c2c9
commit
cf8b20d92d
1 changed files with 7 additions and 4 deletions
|
@ -2132,9 +2132,11 @@ func (dwr *DynamoDB) createTable(tableName string) error {
|
||||||
},
|
},
|
||||||
BillingMode: types.BillingModePayPerRequest,
|
BillingMode: types.BillingModePayPerRequest,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
|
inUseException := new(types.ResourceInUseException)
|
||||||
return err
|
if !errors.As(err, &inUseException) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dwr.waitTableToBeCreated(tableName)
|
return dwr.waitTableToBeCreated(tableName)
|
||||||
|
@ -2190,7 +2192,8 @@ func (dwr *DynamoDB) createVersionTable() error {
|
||||||
BillingMode: types.BillingModePayPerRequest,
|
BillingMode: types.BillingModePayPerRequest,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "Table already exists") {
|
inUseException := new(types.ResourceInUseException)
|
||||||
|
if errors.As(err, &inUseException) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue