issue 7535: don't exclude resources in MustHave list during restore

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
Lyndon-Li
2024-03-28 19:10:52 +08:00
parent 65e8ddb89b
commit 070e99da3d
2 changed files with 2 additions and 1 deletions

View File

@@ -0,0 +1 @@
Fix issue #7535, add the MustHave resource check during item collection and item filter for restore

View File

@@ -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
}