Skip to content

Commit

Permalink
FIx crash in copyVolumeDataPodFunc when location type is not GCS
Browse files Browse the repository at this point in the history
  • Loading branch information
e-sumin committed May 24, 2023
1 parent 2babd1a commit 7c974f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/function/copy_volume_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ func copyVolumeDataPodFunc(cli kubernetes.Interface, tp param.TemplateParams, na
return nil, errors.Wrapf(err, "Failed to write credentials to Pod %s", pc.PodName())
}

defer remover.Remove(context.Background()) //nolint:errcheck
if remover != nil { // WriteCredsToPod might return nil when nothing was written
defer remover.Remove(context.Background()) //nolint:errcheck
}

pod := pc.Pod()
// Get restic repository
Expand Down

0 comments on commit 7c974f1

Please sign in to comment.