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

GenerateVeleroBackupName result is not unique #90

Open
mateusoliveira43 opened this issue Sep 25, 2024 · 3 comments
Open

GenerateVeleroBackupName result is not unique #90

mateusoliveira43 opened this issue Sep 25, 2024 · 3 comments
Assignees

Comments

@mateusoliveira43
Copy link
Contributor

Given different inputs, GenerateVeleroBackupName can return the same result.

func GenerateVeleroBackupName(namespace, nabName string) string {

This can result in bad user experience, as users can end using other users backup (or when UUID solution is implemented, #89, prevent users from using NonAdminBackup with certain names)

From what I studied, given 2 namespaces that have long names (more than 239 chars), if their names differ only in position 240 or above, any NonAdminBackup that have the same same in these namespaces, the associated VeleroBackup name will be the same.

Example

this

namespace: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1
NonAdminBackup: example

and this input

namespace: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2
NonAdminBackup: example

return the same result

Further investigation

Need to confirm no other scenarios will generate equal names.

@kaovilai
Copy link
Member

might help to look at https://github.com/kubernetes/enhancements/blob/61b21e5105e5fda4d6c53821ff82dd39a1a98f07/keps/sig-api-machinery/4420-retry-generate-name/README.md

@mpryc
Copy link
Collaborator

mpryc commented Sep 26, 2024

We could drop all together the human readable name of the object and simply use our generated UUID as the Backup object name with retry generate similar to what @kaovilai proposed above. @mateusoliveira43 what do you think? We could also add suffix (not the prefix) to that uuid with namespace and stripped backup name, this way if it's longer then 240 characters, only part of name or namespace will be lost ensuring uniqueness of the name.

@mateusoliveira43
Copy link
Contributor Author

Yeah, a retry on velero backup name seems a good approach

We can discuss the ideas on next meeting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants