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

existingResourcePolicy validation outside CLI #7347

Closed
mateusoliveira43 opened this issue Jan 23, 2024 · 3 comments · Fixed by #7757
Closed

existingResourcePolicy validation outside CLI #7347

mateusoliveira43 opened this issue Jan 23, 2024 · 3 comments · Fixed by #7757
Assignees
Labels
backlog Enhancement/Dev Internal or Developer-focused Enhancement to Velero

Comments

@mateusoliveira43
Copy link
Contributor

What steps did you take and what happened:
Created a restore using kubectl command and set existingResourcePolicy to "batman". Restore succeed without mentioned wrong existingResourcePolicy.

What did you expect to happen:
Warn user that is not a valid existingResourcePolicy and present user with available options.

Validation present in CLI command

func isResourcePolicyValid(resourcePolicy string) bool {
if resourcePolicy == string(api.PolicyTypeNone) || resourcePolicy == string(api.PolicyTypeUpdate) {
return true
}
return false
}

Anything else you would like to add:
As previously discussed, we do not want to add enum validation in CRD, as there are plans to add more options to that field in the future #6142

So, its best to add validation through code

Environment:

  • Velero version (use velero version): 1.12

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"
@qiuming-best qiuming-best added Enhancement/Dev Internal or Developer-focused Enhancement to Velero backlog labels Jan 24, 2024
@kaovilai
Copy link
Contributor

👋

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. If a Velero team member has requested log or more information, please provide the output of the shared commands.

@kaovilai
Copy link
Contributor

unstale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Enhancement/Dev Internal or Developer-focused Enhancement to Velero
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants