diff --git a/backup/backup.go b/backup/backup.go index 55eda96..20a42f2 100644 --- a/backup/backup.go +++ b/backup/backup.go @@ -666,9 +666,11 @@ func (bp BackupProvider) checkPrefixUniqueness(prefix string, ctx context.Contex } for element, user := range users { if strings.HasPrefix(element, prefix) { + logger.ErrorContext(ctx, fmt.Sprintf("provided prefix already exists or a part of another prefix: %+v", prefix)) return false, fmt.Errorf("provided prefix already exists or a part of another prefix: %+v", prefix) } if user.Attributes[resourcePrefixAttributeName] != "" && strings.HasPrefix(user.Attributes[resourcePrefixAttributeName], prefix) { + logger.ErrorContext(ctx, fmt.Sprintf("provided prefix already exists or a part of another prefix: %+v", prefix)) return false, fmt.Errorf("provided prefix already exists or a part of another prefix: %+v", prefix) } } diff --git a/basic/basic.go b/basic/basic.go index 26b0b71..a52a56e 100644 --- a/basic/basic.go +++ b/basic/basic.go @@ -332,12 +332,6 @@ func (bp BaseProvider) createDatabase(requestOnCreateDb DbCreateRequest, ctx con } } - if ok, err := common.CheckPrefixUniqueness(prefix, ctx, bp.opensearch.Client); !ok { - if err != nil { - return nil, err - } - } - resourcesToCreate := requestOnCreateDb.Settings.CreateOnly if len(resourcesToCreate) == 0 { resourcesToCreate = []string{common.UserKind, common.IndexKind}