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,
|
||||
})
|
||||
|
||||
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
|
||||
return err
|
||||
if err != nil {
|
||||
inUseException := new(types.ResourceInUseException)
|
||||
if !errors.As(err, &inUseException) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return dwr.waitTableToBeCreated(tableName)
|
||||
|
@ -2190,7 +2192,8 @@ func (dwr *DynamoDB) createVersionTable() error {
|
|||
BillingMode: types.BillingModePayPerRequest,
|
||||
})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Table already exists") {
|
||||
inUseException := new(types.ResourceInUseException)
|
||||
if errors.As(err, &inUseException) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue