Skip to content

Commit

Permalink
issue 7535: don't exclude resources in MustHave list during restore
Browse files Browse the repository at this point in the history
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
  • Loading branch information
Lyndon-Li committed Mar 29, 2024
1 parent 65e8ddb commit 070e99d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/unreleased/7585-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue #7535, add the MustHave resource check during item collection and item filter for restore
2 changes: 1 addition & 1 deletion pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,7 @@ func (ctx *restoreContext) getOrderedResourceCollection(

// Check if the resource should be restored according to the resource
// includes/excludes.
if !ctx.resourceIncludesExcludes.ShouldInclude(groupResource.String()) {
if !ctx.resourceIncludesExcludes.ShouldInclude(groupResource.String()) && !ctx.resourceMustHave.Has(groupResource.String()) {
ctx.log.WithField("resource", groupResource.String()).Infof("Skipping restore of resource because the restore spec excludes it")
continue
}
Expand Down

0 comments on commit 070e99d

Please sign in to comment.