Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions internal/storage/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@

// Copy copies the given file to the SSH storage backend.
func (b *sshStorage) Copy(file string) (returnErr error) {
if err := b.sftpClient.MkdirAll(b.DestinationPath); err != nil {
return errwrap.Wrap(err, "error ensuring destination directory")
}

source, err := os.Open(file)
_, name := path.Split(file)
if err != nil {
Expand Down Expand Up @@ -170,6 +174,10 @@
func (b *sshStorage) Prune(deadline time.Time, pruningPrefix string) (*storage.PruneStats, error) {
candidates, err := b.sftpClient.ReadDir(b.DestinationPath)
if err != nil {
// If directory doesn't exist yet, nothing to prune
if errors.Is(err, os.ErrNotExist) {

Check failure on line 178 in internal/storage/ssh/ssh.go

View workflow job for this annotation

GitHub Actions / lint

undefined: errors (typecheck)

Check failure on line 178 in internal/storage/ssh/ssh.go

View workflow job for this annotation

GitHub Actions / build

undefined: errors
Comment thread
m90 marked this conversation as resolved.
return &storage.PruneStats{}, nil
}
return nil, errwrap.Wrap(err, "error reading directory")
}

Expand Down
Loading