Skip to content

Commit

Permalink
Use full word, 'resource' instead of 'resrc'
Browse files Browse the repository at this point in the history
Signed-off-by: F. Gold <[email protected]>
  • Loading branch information
codegold79 committed Mar 15, 2021
1 parent ccbd30f commit a6252b7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1656,21 +1656,21 @@ func (ctx *restoreContext) getOrderedResourceCollection(backupResources map[stri
// getSelectedRestoreableItems applies Kubernetes selectors on individual items
// of each resource type to create a list of items which will be actually
// restored.
func (ctx *restoreContext) getSelectedRestoreableItems(resrc, targetNamespace, originalNamespace string, items []string) (restoreableResource, Result, Result) {
func (ctx *restoreContext) getSelectedRestoreableItems(resource, targetNamespace, originalNamespace string, items []string) (restoreableResource, Result, Result) {
warnings, errs := Result{}, Result{}

restorable := restoreableResource{
resource: resrc,
resource: resource,
}

if restorable.selectedItemsByNamespace == nil {
restorable.selectedItemsByNamespace = make(map[string][]restoreableItem)
}

if targetNamespace != "" {
ctx.log.Infof("Resource '%s' will be restored into namespace '%s'", resrc, targetNamespace)
ctx.log.Infof("Resource '%s' will be restored into namespace '%s'", resource, targetNamespace)
} else {
ctx.log.Infof("Resource '%s' will be restored at cluster scope", resrc)
ctx.log.Infof("Resource '%s' will be restored at cluster scope", resource)
}

// If the APIGroupVersionsFeatureFlag is enabled, the item path will be
Expand All @@ -1682,13 +1682,13 @@ func (ctx *restoreContext) getSelectedRestoreableItems(resrc, targetNamespace, o
// chosenGrpVersToRestore map would only be populated if
// APIGroupVersionsFeatureFlag was enabled for restore and the minimum
// required backup format version has been met.
cgv, ok := ctx.chosenGrpVersToRestore[resrc]
cgv, ok := ctx.chosenGrpVersToRestore[resource]
if ok {
resrc = filepath.Join(resrc, cgv.Dir)
resource = filepath.Join(resource, cgv.Dir)
}

for _, item := range items {
itemPath := archive.GetItemFilePath(ctx.restoreDir, resrc, originalNamespace, item)
itemPath := archive.GetItemFilePath(ctx.restoreDir, resource, originalNamespace, item)

obj, err := archive.Unmarshal(ctx.fileSystem, itemPath)
if err != nil {
Expand Down

0 comments on commit a6252b7

Please sign in to comment.