Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/cpdev 108956 #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
6 changes: 0 additions & 6 deletions basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down