-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
support add --nocopy <url> #6118
Conversation
core/coreunix/add.go
Outdated
if absPath := fi.AbsPath(); filestore.IsURL(absPath) { | ||
params.URL = absPath | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need this given that we're setting AbsPath. We can probably get rid of this parameter all together and construct a WebFile
in core/commands/urlstore.go
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would that cause the data to be downloaded again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the urlstore
command, we download the data on the server (I'm talking about two different commands, we can probably fix this later).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see - this code is completely redundant, and if we use a WebFile
from urlstore
, then the URL param is unused. Would urlstore
itself be redundant also though? Is it still worth keeping around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
urlstore will be redundant but we should keep it around for compatibility (for a few releases as it is experimental).
This approach has some side effects which urlstore does not (or at least doesn't log about) - all of the paths up to the root are added as directories: > ipfs add --nocopy https://google.cloud.storage/v0/b/bucket/o/Qm...?alt=media&token=XXXXX
added Qm... https:/google.cloud.storage/v0/b/bucket/o/Qm...?alt=media
added Qm... https:/google.cloud.storage/v0/b/bucket/o
added Qm... https:/google.cloud.storage/v0/b/bucket
added Qm... https:/google.cloud.storage/v0/b
added Qm... https:/google.cloud.storage/v0
added Qm... https:/google.cloud.storage
added Qm... https:
> ipfs cat Qm...
hello world! Also note the dropping of the |
The slash thing is the auto path canonicalization. Actually, I think we have to go back and fix this in go-ipfs-cmds. When we create the web file, we need to set |
I'll put up a fix for |
License: MIT Signed-off-by: Jordan Krage <jmank88@gmail.com>
(folded) |
This PR enables
add --nocopy
support for URLs, bysettingupdating dependencies.DagBuilderParams.URL
whenfiles.FileInfo.AbsPath()
is a compatible URL.Draft untilgo-ipfs-cmds v0.0.4
is releasedFixes #6065