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

Fix sftp delete implementation #776

Merged
merged 2 commits into from
Nov 22, 2023
Merged

Fix sftp delete implementation #776

merged 2 commits into from
Nov 22, 2023

Conversation

sevein
Copy link
Contributor

@sevein sevein commented Nov 21, 2023

Quick follow-up for #772.

internal/sftp/goclient.go Outdated Show resolved Hide resolved
internal/sftp/goclient.go Outdated Show resolved Hide resolved
internal/sftp/goclient.go Outdated Show resolved Hide resolved
internal/sftp/goclient.go Show resolved Hide resolved
internal/sftp/goclient.go Show resolved Hide resolved
Copy link
Collaborator

@djjuhasz djjuhasz left a comment

Choose a reason for hiding this comment

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

Looks good to me @sevein. I added a couple of comments about the error reporting, but they aren't blockers.

internal/sftp/goclient.go Outdated Show resolved Hide resolved
internal/sftp/goclient.go Outdated Show resolved Hide resolved
I've found that the tests were not running because they were not named following
the convention: TestXXX. After the update, the tests did not pass. These changes
were needed:

- Accept path relative to RemoteDir in Delete method.
- Add `restrictDir` param to simulate permission error.
- Unwrap sftp.StatusError to include status code in error message. Our test does
  not trigger the return of os.ErrPermission.
@sevein sevein force-pushed the dev/sftp-improvements branch from 5874104 to f5d5db4 Compare November 22, 2023 17:46
@sevein sevein merged commit 936fb56 into main Nov 22, 2023
10 checks passed
@sevein sevein deleted the dev/sftp-improvements branch November 22, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants