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

Suspicious calling code for rclone backend #1896

Closed
mpsrig opened this issue Jul 19, 2018 · 3 comments · Fixed by #2932
Closed

Suspicious calling code for rclone backend #1896

mpsrig opened this issue Jul 19, 2018 · 3 comments · Fixed by #2932
Labels
backend: rclone state: need implementing cause/request established, need work/solution type: bug

Comments

@mpsrig
Copy link

mpsrig commented Jul 19, 2018

https://github.com/restic/restic/blob/master/cmd/restic/global.go#L652

rclone.Open is called here instead of rclone.Create

This additionally means that rclone.Createis unused code (except for tests).

rclone.Open and rclone.Create contain almost identical code. The main difference is that rclone.Create calls rest.Create and rclone.Open calls rest.Open.

There are a few other minor discrepancies that should probably be resolved (e.g., via a common helper function): https://github.com/restic/restic/blob/master/internal/backend/rclone/backend.go#L254 vs https://github.com/restic/restic/blob/master/internal/backend/rclone/backend.go#L282 and https://github.com/restic/restic/blob/master/internal/backend/rclone/backend.go#L260 vs https://github.com/restic/restic/blob/master/internal/backend/rclone/backend.go#L288

@fd0

@fd0 fd0 added type: bug state: need triaging need categorizing, labeling, next-step decision labels Jul 19, 2018
@mpsrig
Copy link
Author

mpsrig commented Jul 19, 2018

I've taken an initial pass at this. Opening PR.

@fd0
Copy link
Member

fd0 commented Jul 19, 2018

Thank you very much for your contribution. Can we please discuss the changes first, and then break them down into manageable work items? I don't have so much time for code review right now (for a bit of background see the forum).

@fd0
Copy link
Member

fd0 commented Jul 20, 2018

I've taken a look, we should make sure that the Create function for the rclone backend (and therefore the Create function for the REST backend) is used. The difference is that Create issues an HTTP request according to the REST protocol which tells the server that the repo should be created.

Let me know if you need any help, and thanks for taking care of this issue!

MichaelEischer added a commit to MichaelEischer/restic that referenced this issue Sep 19, 2020
This properly issues the initial repository creation command

Fixes restic#1896
@MichaelEischer MichaelEischer added backend: rclone state: need implementing cause/request established, need work/solution and removed state: need triaging need categorizing, labeling, next-step decision labels Oct 6, 2020
@fd0 fd0 closed this as completed in #2932 Oct 9, 2020
SanchithHegde pushed a commit to SanchithHegde/restic that referenced this issue Oct 31, 2020
This properly issues the initial repository creation command

Fixes restic#1896
mfrischknecht pushed a commit to mfrischknecht/restic that referenced this issue Jun 14, 2022
This properly issues the initial repository creation command

Fixes restic#1896
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: rclone state: need implementing cause/request established, need work/solution type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants