0
Fork 0
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:
Andrei Aaron 2025-01-25 00:58:13 +02:00 committed by GitHub
parent ececc9c2c9
commit cf8b20d92d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}