From 98c1a3455833f3491cef96df208ed031139e013a Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Tue, 26 May 2020 10:16:03 -0600 Subject: [PATCH] bug fix: pass ca cert file to restic stats command on restore Signed-off-by: Steve Kriss --- pkg/restic/exec_commands.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/restic/exec_commands.go b/pkg/restic/exec_commands.go index 230886aaf..7b4a4f167 100644 --- a/pkg/restic/exec_commands.go +++ b/pkg/restic/exec_commands.go @@ -185,7 +185,7 @@ func getSummaryLine(b []byte) ([]byte, error) { // RunRestore runs a `restic restore` command and monitors the volume size to // provide progress updates to the caller. func RunRestore(restoreCmd *Command, log logrus.FieldLogger, updateFunc func(velerov1api.PodVolumeOperationProgress)) (string, string, error) { - snapshotSize, err := getSnapshotSize(restoreCmd.RepoIdentifier, restoreCmd.PasswordFile, restoreCmd.Args[0], restoreCmd.Env) + snapshotSize, err := getSnapshotSize(restoreCmd.RepoIdentifier, restoreCmd.PasswordFile, restoreCmd.CACertFile, restoreCmd.Args[0], restoreCmd.Env) if err != nil { return "", "", errors.Wrap(err, "error getting snapshot size") } @@ -231,9 +231,10 @@ func RunRestore(restoreCmd *Command, log logrus.FieldLogger, updateFunc func(vel return stdout, stderr, err } -func getSnapshotSize(repoIdentifier, passwordFile, snapshotID string, env []string) (int64, error) { +func getSnapshotSize(repoIdentifier, passwordFile, caCertFile, snapshotID string, env []string) (int64, error) { cmd := StatsCommand(repoIdentifier, passwordFile, snapshotID) cmd.Env = env + cmd.CACertFile = caCertFile stdout, stderr, err := exec.RunCommand(cmd.Cmd()) if err != nil {