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

Add more information for failing to get path or snapshot in restic ba… #4988

Conversation

blackpiglet
Copy link
Contributor

…ckup and restore.

Signed-off-by: Xun Jiang jxun@vmware.com

Thank you for contributing to Velero!

Please add a summary of your change

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.

…ckup and restore.

Signed-off-by: Xun Jiang <jxun@vmware.com>
@blackpiglet blackpiglet force-pushed the add-more-info-for-get-path-or-snapshot-fail-by-restic branch from 8977223 to 806234e Compare June 13, 2022 03:33
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2022

Codecov Report

Merging #4988 (806234e) into main (fee46d4) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #4988      +/-   ##
==========================================
- Coverage   41.34%   41.30%   -0.05%     
==========================================
  Files         210      210              
  Lines       18435    18435              
==========================================
- Hits         7622     7614       -8     
- Misses      10241    10248       +7     
- Partials      572      573       +1     
Impacted Files Coverage Δ
pkg/controller/pod_volume_backup_controller.go 43.03% <0.00%> (ø)
pkg/controller/pod_volume_restore_controller.go 22.11% <0.00%> (ø)
pkg/restic/exec_commands.go 15.38% <0.00%> (ø)
pkg/restore/restore.go 64.48% <0.00%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fee46d4...806234e. Read the comment docs.

@@ -211,7 +211,7 @@ func (r *PodVolumeBackupReconciler) singlePathMatch(path string) (string, error)
}

if len(matches) != 1 {
return "", errors.Errorf("expected one matching path, got %d", len(matches))
return "", errors.Errorf("expected one matching path: %s, got %d", path, len(matches))
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you checked the value of path I recall it has the wildcard, what does it look like?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

	volDir, err := kube.GetVolumeDirectory(ctx, log, pod, pvb.Spec.Volume, r.Client)
	if err != nil {
		return nil, errors.Wrap(err, "getting volume directory name")
	}

	pathGlob := fmt.Sprintf("/host_pods/%s/volumes/*/%s", string(pvb.Spec.Pod.UID), volDir)
	log.WithField("pathGlob", pathGlob).Debug("Looking for path matching glob")

This is the code in PVB controller preparing path before calling the function singlePathMatch.
It has a wildcard, but the volumeDir is also included.

@reasonerjt reasonerjt added this to the 1.9.0 milestone Jun 13, 2022
@qiuming-best qiuming-best merged commit 7519014 into vmware-tanzu:main Jun 13, 2022
@blackpiglet blackpiglet deleted the add-more-info-for-get-path-or-snapshot-fail-by-restic branch October 15, 2022 04:04
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.

None yet

4 participants