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

Check for empty ns list before checking nslist[0] #5302

Merged
merged 3 commits into from
Sep 7, 2022

Conversation

qiuming-best
Copy link
Contributor

In determining whether a backup includes all namespaces, item_collector checks for an empty string in the first element of the ns list. If processing includes+excludes results in an empty list, treat this as another case of a not-all-namespaces backup rather than crashing velero.

Signed-off-by: Scott Seago [email protected]

Thank you for contributing to Velero!

Please add a summary of your change

In determining whether a backup includes all namespaces, item_collector
checks for an empty string in the first element of the ns list. If processing
includes+excludes results in an empty list, treat this as another case
of a not-all-namespaces backup rather than crashing velero.

Does your change fix a particular issue?

Fixes #(issue)
Fixes #5235
Fixes #5266

Please indicate you've done the following:

  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Created a changelog file or added /kind changelog-not-required as a comment on this pull request.
  • Updated the corresponding documentation in site/content/docs/main.

In determining whether a backup includes all namespaces, item_collector
checks for an empty string in the first element of the ns list. If processing
includes+excludes results in an empty list, treat this as another case
of a not-all-namespaces backup rather than crashing velero.

Signed-off-by: Scott Seago <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Merging #5302 (f911e13) into release-1.9 (515eff5) will decrease coverage by 0.03%.
The diff coverage is 80.00%.

@@               Coverage Diff               @@
##           release-1.9    #5302      +/-   ##
===============================================
- Coverage        41.37%   41.33%   -0.04%     
===============================================
  Files              211      211              
  Lines            18462    18465       +3     
===============================================
- Hits              7638     7633       -5     
- Misses           10251    10258       +7     
- Partials           573      574       +1     
Impacted Files Coverage Δ
pkg/backup/item_collector.go 59.88% <80.00%> (+0.36%) ⬆️
pkg/restore/restore.go 63.89% <0.00%> (-0.57%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@qiuming-best qiuming-best merged commit 6ad78a1 into vmware-tanzu:release-1.9 Sep 7, 2022
danfengliu pushed a commit to danfengliu/velero that referenced this pull request Oct 14, 2022
Check for empty ns list before checking nslist[0]
danfengliu pushed a commit to danfengliu/velero that referenced this pull request Oct 15, 2022
Check for empty ns list before checking nslist[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants