mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
fix(dynamodb): properly handle ResourceInUseException for existing tables (#2909)
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user