Skip to content

Commit e0e22b0

Browse files
authored
Merge branch 'project-zot:main' into tamilhce/ecr-cred-helper
2 parents 1a98a4c + cf8b20d commit e0e22b0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/meta/dynamodb/dynamodb.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,9 +2132,11 @@ func (dwr *DynamoDB) createTable(tableName string) error {
21322132
},
21332133
BillingMode: types.BillingModePayPerRequest,
21342134
})
2135-
2136-
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
2137-
return err
2135+
if err != nil {
2136+
inUseException := new(types.ResourceInUseException)
2137+
if !errors.As(err, &inUseException) {
2138+
return err
2139+
}
21382140
}
21392141

21402142
return dwr.waitTableToBeCreated(tableName)
@@ -2190,7 +2192,8 @@ func (dwr *DynamoDB) createVersionTable() error {
21902192
BillingMode: types.BillingModePayPerRequest,
21912193
})
21922194
if err != nil {
2193-
if strings.Contains(err.Error(), "Table already exists") {
2195+
inUseException := new(types.ResourceInUseException)
2196+
if errors.As(err, &inUseException) {
21942197
return nil
21952198
}
21962199

0 commit comments

Comments
 (0)