Skip to content

Conversation

@learner0810
Copy link
Contributor

Thank you for contributing to Velero!

Please add a summary of your change

If an error occurs when using orLabelSelectors to fetch resources, unstructuredItems will not be added to the items, so the loop will simply jump out of the loop when an error occurs.

Does your change fix a particular issue?

Fixes #(issue)

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.

@learner0810 learner0810 changed the title enhance-listItemsForLabel Optimizing the use of orLabelSelectors to get resources Jan 2, 2024
@codecov
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (f109f38) 61.73% compared to head (a9c3b72) 61.71%.
Report is 6 commits behind head on main.

Files Patch % Lines
pkg/backup/item_collector.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7256      +/-   ##
==========================================
- Coverage   61.73%   61.71%   -0.03%     
==========================================
  Files         262      262              
  Lines       28428    28421       -7     
==========================================
- Hits        17551    17539      -12     
- Misses       9645     9650       +5     
  Partials     1232     1232              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@blackpiglet blackpiglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Velero v1.13 is on the way. We'd better wait for the release-1.13 branch cut to merge this PR.

@blackpiglet blackpiglet added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Jan 4, 2024
}
}

if errListingForNS {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, after modification, there should be no unstructed object found when listing with or label selector, it's better to have an early return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants